Skip to main content

moq_consume_json_stream

Function moq_consume_json_stream 

Source
#[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, ) -> i32
Expand 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 name is a valid pointer to name_len bytes and config a valid pointer.
  • The caller must keep user_data valid until the terminal (<= 0) on_value callback.