Skip to main content

moq_origin_announced

Function moq_origin_announced 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn moq_origin_announced( origin: u32, prefix: *const c_char, prefix_len: usize, filter: *const c_char, filter_len: usize, on_announce: moq_status_callback, user_data: *mut c_void, ) -> i32
Expand description

Learn about broadcasts matching a pattern scope under an origin.

prefix is a literal path root. filter is a pattern relative to that prefix, or NULL for every path beneath it. Empty is a valid exact filter. Delivered moq_announce_update prefixes remain relative to the origin.

on_announce is invoked with a positive announced ID for each broadcast, then exactly once more with a terminal code: 0 (stopped cleanly) or a negative error. After the terminal (<= 0) callback, on_announce is never called again and user_data is never touched again, so release user_data there. The terminal callback fires even after moq_origin_announced_cancel.

Returns a non-zero handle on success, or a negative code on failure.

ยงSafety

  • The caller must keep user_data valid until the terminal (<= 0) on_announce callback.