+const struct bt_value *bt_stream_borrow_user_attributes_const(
+ const struct bt_stream *stream)
+{
+ BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
+ return stream->user_attributes;
+}
+
+struct bt_value *bt_stream_borrow_user_attributes(struct bt_stream *stream)
+{
+ return (void *) bt_stream_borrow_user_attributes_const((void *) stream);
+}
+
+void bt_stream_set_user_attributes(struct bt_stream *stream,
+ const struct bt_value *user_attributes)
+{
+ BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
+ BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
+ "User attributes object is not a map value object.");
+ BT_ASSERT_PRE_DEV_STREAM_HOT(stream);
+ bt_object_put_ref_no_null_check(stream->user_attributes);
+ stream->user_attributes = (void *) user_attributes;
+ bt_object_get_ref_no_null_check(stream->user_attributes);
+}
+