goto end;
}
- muxer_upstream_notif_iter->notif_iter = bt_object_get_ref(self_notif_iter);
+ muxer_upstream_notif_iter->notif_iter = self_notif_iter;
+ bt_object_get_ref(muxer_upstream_notif_iter->notif_iter);
muxer_upstream_notif_iter->notifs = g_queue_new();
if (!muxer_upstream_notif_iter->notifs) {
BT_LOGE_STR("Failed to allocate a GQueue.");
struct bt_self_component_filter *self_comp)
{
struct muxer_comp *muxer_comp = bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(self_comp));
+ bt_self_component_filter_as_self_component(self_comp));
enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
GString *port_name = NULL;
}
static
-struct bt_private_value *get_default_params(void)
+struct bt_value *get_default_params(void)
{
- struct bt_private_value *params;
+ struct bt_value *params;
int ret;
- params = bt_private_value_map_create();
+ params = bt_value_map_create();
if (!params) {
BT_LOGE_STR("Cannot create a map value object.");
goto error;
}
- ret = bt_private_value_map_insert_bool_entry(params,
+ ret = bt_value_map_insert_bool_entry(params,
ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME, false);
if (ret) {
BT_LOGE_STR("Cannot add boolean value to map value object.");
}
static
-int configure_muxer_comp(struct muxer_comp *muxer_comp, struct bt_value *params)
+int configure_muxer_comp(struct muxer_comp *muxer_comp,
+ const struct bt_value *params)
{
- struct bt_private_value *default_params = NULL;
- struct bt_private_value *real_params = NULL;
- struct bt_value *assume_absolute_clock_classes = NULL;
+ struct bt_value *default_params = NULL;
+ struct bt_value *real_params = NULL;
+ const struct bt_value *assume_absolute_clock_classes = NULL;
int ret = 0;
bt_bool bool_val;
}
ret = bt_value_map_extend(&real_params,
- bt_private_value_borrow_value(default_params), params);
+ default_params, params);
if (ret) {
BT_LOGE("Cannot extend default parameters map value: "
"muxer-comp-addr=%p, def-params-addr=%p, "
goto error;
}
- assume_absolute_clock_classes = bt_value_map_borrow_entry_value(
- bt_private_value_borrow_value(real_params),
- ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME);
+ assume_absolute_clock_classes = bt_value_map_borrow_entry_value(real_params,
+ ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME);
if (assume_absolute_clock_classes &&
!bt_value_is_bool(assume_absolute_clock_classes)) {
BT_LOGE("Expecting a boolean value for the `%s` parameter: "
muxer_comp->self_comp = self_comp;
bt_self_component_set_data(
- bt_self_component_filter_borrow_self_component(self_comp),
+ bt_self_component_filter_as_self_component(self_comp),
muxer_comp);
status = ensure_available_input_port(self_comp);
if (status != BT_SELF_COMPONENT_STATUS_OK) {
error:
destroy_muxer_comp(muxer_comp);
bt_self_component_set_data(
- bt_self_component_filter_borrow_self_component(self_comp),
+ bt_self_component_filter_as_self_component(self_comp),
NULL);
if (status == BT_SELF_COMPONENT_STATUS_OK) {
void muxer_finalize(struct bt_self_component_filter *self_comp)
{
struct muxer_comp *muxer_comp = bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(self_comp));
+ bt_self_component_filter_as_self_component(self_comp));
BT_LOGD("Finalizing muxer component: comp-addr=%p",
self_comp);
create_notif_iter_on_input_port(
struct bt_self_component_port_input *self_port, int *ret)
{
- struct bt_port *port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ struct bt_port *port = bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
self_port));
struct bt_self_component_port_input_notification_iterator *notif_iter =
NULL;
}
self_port = node->data;
- port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ port = bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
(self_port)));
BT_ASSERT(port);
struct bt_notification *notif, int64_t last_returned_ts_ns,
int64_t *ts_ns)
{
- struct bt_clock_class *clock_class = NULL;
- struct bt_clock_value *clock_value = NULL;
- struct bt_event *event = NULL;
+ const struct bt_clock_class *clock_class = NULL;
+ const struct bt_clock_value *clock_value = NULL;
+ const struct bt_event *event = NULL;
int ret = 0;
const unsigned char *cc_uuid;
const char *cc_name;
case BT_NOTIFICATION_TYPE_EVENT:
event = bt_notification_event_borrow_event(notif);
BT_ASSERT(event);
- cv_status = bt_event_borrow_default_clock_value(event,
+ cv_status = bt_event_borrow_default_clock_value_const(event,
&clock_value);
break;
goto end;
}
- clock_class = bt_clock_value_borrow_clock_class(clock_value);
+ clock_class = bt_clock_value_borrow_clock_class_const(clock_value);
BT_ASSERT(clock_class);
cc_uuid = bt_clock_class_get_uuid(clock_class);
cc_name = bt_clock_class_get_name(clock_class);
* handled by muxer_notif_iter_handle_newly_connected_ports().
*/
count = bt_component_filter_get_input_port_count(
- bt_self_component_filter_borrow_component_filter(
+ bt_self_component_filter_as_component_filter(
muxer_comp->self_comp));
if (count < 0) {
BT_LOGD("No input port to initialize for muxer component's notification iterator: "
struct bt_port *port;
BT_ASSERT(self_port);
- port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ port = bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
self_port));
BT_ASSERT(port);
int ret;
muxer_comp = bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(self_comp));
+ bt_self_component_filter_as_self_component(self_comp));
BT_ASSERT(muxer_comp);
BT_LOGD("Initializing muxer component's notification iterator: "
"comp-addr=%p, muxer-comp-addr=%p, notif-iter-addr=%p",
struct bt_port_output *other_port)
{
enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
- struct bt_port *port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ struct bt_port *port = bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
self_port));
struct muxer_comp *muxer_comp =
bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(
+ bt_self_component_filter_as_self_component(
self_comp));
size_t i;
int ret;
"other-port-addr=%p, other-port-name=\"%s\"",
self_comp, muxer_comp, self_port, bt_port_get_name(port),
other_port,
- bt_port_get_name(bt_port_output_borrow_port(other_port)));
+ bt_port_get_name(bt_port_output_as_port(other_port)));
for (i = 0; i < muxer_comp->muxer_notif_iters->len; i++) {
struct muxer_notif_iter *muxer_notif_iter =
{
struct muxer_comp *muxer_comp =
bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(
+ bt_self_component_filter_as_self_component(
self_component));
struct bt_port *port =
- bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
self_port));
BT_ASSERT(port);