#[unsafe(no_mangle)]pub unsafe extern "C" fn moq_consume_json_stream(
broadcast: u32,
name: *const c_char,
name_len: usize,
config: *const moq_json_stream_config,
on_value: Option<extern "C" fn(user_data: *mut c_void, value: i32)>,
user_data: *mut c_void,
) -> i32Expand description
Subscribe to a JSON stream track (lossless append-log) by name.
on_value is called with a positive value ID for each record, in order, then once more with
a terminal 0 or negative error where user_data should be released. Read each value with
moq_consume_json_value and release it with moq_consume_json_value_close.
Returns a non-zero handle to the task on success, or a negative code on failure.
ยงSafety
- The caller must ensure
nameis a valid pointer toname_lenbytes andconfiga valid pointer. - The caller must keep
user_datavalid until the terminal (<= 0)on_valuecallback.