Values API: standardize function names
[babeltrace.git] / plugins / utils / muxer / muxer.c
index f3740a354b1ed5eac7363e1cc11d4f074572943a..f629e6d54d57048f1d8b6f456baa68106217392c 100644 (file)
@@ -254,7 +254,7 @@ struct bt_value *get_default_params(void)
                goto error;
        }
 
-       ret = bt_value_map_insert_bool(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.");
@@ -295,7 +295,7 @@ int configure_muxer_comp(struct muxer_comp *muxer_comp, struct bt_value *params)
                goto error;
        }
 
-       assume_absolute_clock_classes = bt_value_map_borrow(real_params,
+       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)) {
@@ -607,6 +607,7 @@ int get_notif_ts_ns(struct muxer_comp *muxer_comp,
        int ret = 0;
        const unsigned char *cc_uuid;
        const char *cc_name;
+       enum bt_clock_value_status cv_status = BT_CLOCK_VALUE_STATUS_KNOWN;
 
        BT_ASSERT(notif);
        BT_ASSERT(ts_ns);
@@ -620,7 +621,8 @@ int get_notif_ts_ns(struct muxer_comp *muxer_comp,
        case BT_NOTIFICATION_TYPE_EVENT:
                event = bt_notification_event_borrow_event(notif);
                BT_ASSERT(event);
-               clock_value = bt_event_borrow_default_clock_value(event);
+               cv_status = bt_event_borrow_default_clock_value(event,
+                       &clock_value);
                break;
 
        case BT_NOTIFICATION_TYPE_INACTIVITY:
@@ -635,6 +637,12 @@ int get_notif_ts_ns(struct muxer_comp *muxer_comp,
                goto end;
        }
 
+       if (cv_status != BT_CLOCK_VALUE_STATUS_KNOWN) {
+               BT_LOGE_STR("Unsupported unknown clock value.");
+               ret = -1;
+               goto end;
+       }
+
        /*
         * If the clock value is missing, then we consider that this
         * notification has no time. In this case it's always the
@@ -647,7 +655,7 @@ int get_notif_ts_ns(struct muxer_comp *muxer_comp,
                goto end;
        }
 
-       clock_class = bt_clock_value_borrow_class(clock_value);
+       clock_class = bt_clock_value_borrow_clock_class(clock_value);
        BT_ASSERT(clock_class);
        cc_uuid = bt_clock_class_get_uuid(clock_class);
        cc_name = bt_clock_class_get_name(clock_class);
@@ -800,7 +808,7 @@ int get_notif_ts_ns(struct muxer_comp *muxer_comp,
                }
        }
 
-       ret = bt_clock_value_get_value_ns_from_epoch(clock_value, ts_ns);
+       ret = bt_clock_value_get_ns_from_origin(clock_value, ts_ns);
        if (ret) {
                BT_LOGE("Cannot get nanoseconds from Epoch of clock value: "
                        "clock-value-addr=%p", clock_value);
This page took 0.025673 seconds and 4 git commands to generate.