Expand description
C bindings for moq_net.
Provides a C-compatible API for real-time pub/sub over QUIC.
§Concepts
- Session: Network connection to a MoQ relay
- Origin: Collection of broadcasts
- Broadcast: Container for tracks
- Track: Named stream of groups
- Group: Collection of frames
- Frame: Sized payload with timestamp
§Error Handling
All functions return negative error codes on failure or non-negative values on success. Resources are managed through opaque integer handles that must be explicitly closed.
Structs§
- Audio
- Id
- Opaque resource identifier returned to C code.
- moq_
announced - Information about a broadcast announced by an origin.
- moq_
audio_ config - Information about an audio rendition in the catalog.
- moq_
audio_ decoder_ output - PCM layout the caller wants out of
moq_consume_audio_raw. - moq_
audio_ encoder_ input - PCM layout the caller hands to
moq_publish_audio_raw_frame. - moq_
audio_ encoder_ output - Codec-side configuration.
sample_rate/channels= 0 means “match the input (snapping the rate up to a libopus-supported value if necessary)”. - moq_
audio_ frame - One audio frame: payload bytes plus a presentation timestamp.
- moq_
frame - Information about a frame of media.
- moq_
video_ config - Information about a video rendition in the catalog.
Enums§
- Error
- Error types that can occur in the FFI layer.
- moq_
audio_ format - Raw PCM sample layout, mirroring WebCodecs
AudioData.format.
Functions§
- moq_
consume_ audio_ close - Close an audio track consumer and clean up its resources.
- moq_
consume_ ⚠audio_ config - Query information about an audio track in a catalog.
- moq_
consume_ ⚠audio_ ordered - Consume an audio track from a broadcast, emitting the frames in order.
- moq_
consume_ ⚠audio_ raw - Subscribe to an audio track and decode it into PCM.
- moq_
consume_ audio_ raw_ close - Stop consuming an audio track and cancel its background task.
- moq_
consume_ ⚠audio_ raw_ frame - Copy a delivered frame’s metadata into
dst. - moq_
consume_ audio_ raw_ frame_ free - Free a frame previously delivered through the consume callback. Required for every delivered frame ID; closing the parent consumer is not enough.
- moq_
consume_ ⚠catalog - Create a catalog consumer for a broadcast.
- moq_
consume_ catalog_ close - Close a catalog consumer and cancel its background task.
- moq_
consume_ catalog_ free - Free a catalog snapshot received via the moq_consume_catalog callback.
- moq_
consume_ close - Close a broadcast consumer and clean up its resources.
- moq_
consume_ ⚠frame - Get a chunk of a frame’s payload.
- moq_
consume_ frame_ close - Close a frame and clean up its resources.
- moq_
consume_ video_ close - Close a video track consumer and clean up its resources.
- moq_
consume_ ⚠video_ config - Query information about a video track in a catalog.
- moq_
consume_ ⚠video_ ordered - Consume a video track from a broadcast, delivering frames in order.
- moq_
log_ ⚠level - Initialize the library with a log level.
- moq_
origin_ ⚠announced - Learn about all broadcasts published to an origin.
- moq_
origin_ announced_ close - Stop receiving announcements for broadcasts published to an origin.
- moq_
origin_ ⚠announced_ info - Query information about a broadcast discovered by moq_origin_announced.
- moq_
origin_ close - Close an origin and clean up its resources.
- moq_
origin_ ⚠consume - Consume a broadcast from an origin by path.
- moq_
origin_ create - Create an origin for publishing broadcasts.
- moq_
origin_ ⚠publish - Publish a broadcast to an origin.
- moq_
publish_ ⚠audio_ raw - Open an audio track on a broadcast.
- moq_
publish_ audio_ raw_ close - Flush any pending samples and finalize an audio producer.
- moq_
publish_ ⚠audio_ raw_ frame - Push one audio frame.
- moq_
publish_ close - Close a broadcast and clean up its resources.
- moq_
publish_ create - Create a new broadcast for publishing media tracks.
- moq_
publish_ media_ close - Remove a track from a broadcast.
- moq_
publish_ ⚠media_ frame - Write data to a track.
- moq_
publish_ ⚠media_ ordered - Create a new media track for a broadcast
- moq_
session_ close - Close a connection to a MoQ server and cancel its background task.
- moq_
session_ ⚠connect - Start establishing a connection to a MoQ server.
Type Aliases§
- Status
- Status code returned by FFI functions.