Skip to main content

moq_encode_audio_demand

Function moq_encode_audio_demand 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn moq_encode_audio_demand( producer: u32, on_demand: moq_status_callback, user_data: *mut c_void, ) -> i32
Expand description

Watch whether the encoded audio track has subscribers, so the microphone and encoder run only while someone listens. See crate::moq_publish_media_demand for the callback contract.

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

ยงSafety

  • on_demand must be non-NULL.
  • The caller must keep user_data valid until the terminal (<= 0) on_demand callback.