BT_ASSERT(ec);
if (stream->sc->default_clock_class) {
- (void) bt_message_event_borrow_default_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_event_borrow_default_clock_snapshot_const(
+ msg);
}
ret = fs_sink_stream_write_event(stream, cs, ir_event, ec);
}
if (stream->sc->default_clock_class) {
- (void) bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
}
}
if (stream->sc->default_clock_class) {
- (void) bt_message_packet_end_borrow_default_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_packet_end_borrow_default_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
}
if (stream->sc->default_clock_class) {
- (void) bt_message_packet_end_borrow_default_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_packet_end_borrow_default_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
}
bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
const bt_stream *ir_stream =
bt_message_stream_beginning_borrow_stream_const(msg);
+ const bt_stream_class *ir_sc =
+ bt_stream_borrow_class_const(ir_stream);
struct fs_sink_stream *stream;
+ /*
+ * Temporary: if the stream's class has a default clock class,
+ * make sure packet beginning and end messages have default
+ * clock snapshots until the support for not having them is
+ * implemented.
+ */
+ if (bt_stream_class_borrow_default_clock_class_const(ir_sc)) {
+ if (!bt_stream_class_packets_have_default_beginning_clock_snapshot(
+ ir_sc)) {
+ BT_LOGE("Unsupported stream: packets have "
+ "no beginning clock snapshot: "
+ "stream-addr=%p, "
+ "stream-id=%" PRIu64 ", "
+ "stream-name=\"%s\"",
+ ir_stream, bt_stream_get_id(ir_stream),
+ bt_stream_get_name(ir_stream));
+ status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
+ goto end;
+ }
+
+ if (!bt_stream_class_packets_have_default_end_clock_snapshot(
+ ir_sc)) {
+ BT_LOGE("Unsupported stream: packets have "
+ "no end clock snapshot: "
+ "stream-addr=%p, "
+ "stream-id=%" PRIu64 ", "
+ "stream-name=\"%s\"",
+ ir_stream, bt_stream_get_id(ir_stream),
+ bt_stream_get_name(ir_stream));
+ status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
+ goto end;
+ }
+ }
+
stream = borrow_stream(fs_sink, ir_stream);
if (!stream) {
status = BT_SELF_COMPONENT_STATUS_ERROR;
* The clock snapshot values will be validated when
* handling the next "packet beginning" message.
*/
- (void) bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
stream->discarded_events_state.beginning_cs =
bt_clock_snapshot_get_value(cs);
- cs = NULL;
- (void) bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
stream->discarded_events_state.end_cs =
bt_clock_snapshot_get_value(cs);
* The clock snapshot values will be validated when
* handling the next "packet beginning" message.
*/
- (void) bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
stream->discarded_packets_state.beginning_cs =
bt_clock_snapshot_get_value(cs);
- cs = NULL;
- (void) bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
stream->discarded_packets_state.end_cs =
bt_clock_snapshot_get_value(cs);