- BT_ASSERT(cur_muxer_upstream_notif_iter->notifs->length > 0);
- notif = g_queue_peek_head(cur_muxer_upstream_notif_iter->notifs);
- BT_ASSERT(notif);
- ret = get_notif_ts_ns(muxer_comp, muxer_notif_iter, notif,
- muxer_notif_iter->last_returned_ts_ns, ¬if_ts_ns);
+ BT_ASSERT(cur_muxer_upstream_msg_iter->msgs->length > 0);
+ msg = g_queue_peek_head(cur_muxer_upstream_msg_iter->msgs);
+ BT_ASSERT(msg);
+
+ if (unlikely(bt_message_get_type(msg) ==
+ BT_MESSAGE_TYPE_STREAM_BEGINNING)) {
+ ret = validate_new_stream_clock_class(
+ muxer_msg_iter, muxer_comp,
+ bt_message_stream_beginning_borrow_stream_const(
+ msg));
+ if (ret) {
+ /*
+ * validate_new_stream_clock_class() logs
+ * errors.
+ */
+ status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
+ goto end;
+ }
+ } else if (unlikely(bt_message_get_type(msg) ==
+ BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY)) {
+ const bt_clock_snapshot *cs;
+ bt_clock_snapshot_state cs_state;
+
+ cs_state = bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
+ msg, &cs);
+
+ if (cs_state != BT_CLOCK_SNAPSHOT_STATE_KNOWN) {
+ BT_LOGE("Message iterator inactivity message's "
+ "default clock snapshot is unknown: "
+ "msg-addr=%p",
+ msg);
+ status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
+ goto end;
+ }
+
+ ret = validate_clock_class(muxer_msg_iter, muxer_comp,
+ bt_clock_snapshot_borrow_clock_class_const(cs));
+ if (ret) {
+ /* validate_clock_class() logs errors */
+ status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
+ goto end;
+ }
+ }
+
+ ret = get_msg_ts_ns(muxer_comp, muxer_msg_iter, msg,
+ muxer_msg_iter->last_returned_ts_ns, &msg_ts_ns);