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.
- Video
- Raw-video consume state: decoder tasks plus their buffered decoded frames.
- 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_
connection_ stats - A snapshot of connection statistics, filled in by moq_session_stats.
- moq_
datagram - A best-effort raw track datagram delivered via moq_consume_datagrams.
- moq_
frame - Information about a frame of media.
- moq_
json_ snapshot_ config - Options for a JSON snapshot track (lossy latest-value mode).
- moq_
json_ stream_ config - Options for a JSON stream track (lossless append-log mode).
- moq_
json_ value - A JSON value delivered by a consumer callback.
- moq_
section - One untyped application catalog section: a name and its JSON value.
- moq_
string - A borrowed UTF-8 string slice, NOT NULL terminated.
- moq_
subscription - Subscriber-side raw track delivery preferences.
- moq_
track_ info - Publisher-side raw track properties.
- moq_
video_ config - Information about a video rendition in the catalog.
- moq_
video_ decoder_ output - Decode-side configuration the caller passes to
moq_consume_video_raw. - moq_
video_ frame - One decoded video frame: packed I420 plus a presentation timestamp.
- moq_
video_ properties - Catalog properties shared by every video rendition.
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 - Consume an audio track from a broadcast, emitting the frames in order.
- moq_
consume_ audio_ close - Stop an audio track consumer’s background task.
- moq_
consume_ ⚠audio_ config - Query information about an audio track in a catalog.
- moq_
consume_ ⚠audio_ raw - Subscribe to an audio track and decode it into PCM.
- moq_
consume_ audio_ raw_ close - Stop an audio (raw PCM) consumer’s 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 - Stop a catalog consumer’s background subscription.
- moq_
consume_ catalog_ free - Free a catalog snapshot received via the moq_consume_catalog callback.
- moq_
consume_ ⚠catalog_ section - Look up an application catalog section by name.
- moq_
consume_ ⚠catalog_ section_ at - Query an application catalog section by index, keyed by name.
- moq_
consume_ catalog_ section_ count - Number of untyped application catalog sections in a catalog snapshot.
- moq_
consume_ close - Close a broadcast consumer and clean up its resources.
- moq_
consume_ ⚠datagram - Read a datagram delivered via the moq_consume_datagrams callback.
- moq_
consume_ datagram_ free - Free a datagram delivered via the moq_consume_datagrams callback, releasing its payload.
- moq_
consume_ ⚠datagrams - Subscribe to a raw track’s best-effort datagrams by name.
- moq_
consume_ datagrams_ close - Stop a datagram subscription’s background task.
- moq_
consume_ ⚠frame - Get a chunk of a frame’s payload.
- moq_
consume_ frame_ free - Free a decoded frame delivered via a moq_consume_video or moq_consume_audio callback.
- moq_
consume_ json_ close - Stop a JSON consumer’s background task (snapshot or stream).
- moq_
consume_ ⚠json_ snapshot - Subscribe to a JSON snapshot track (lossy latest-value) by name.
- moq_
consume_ ⚠json_ stream - Subscribe to a JSON stream track (lossless append-log) by name.
- moq_
consume_ ⚠json_ value - Read a JSON value delivered via a moq_consume_json_snapshot or moq_consume_json_stream callback.
- moq_
consume_ json_ value_ free - Release a JSON value delivered via a consumer callback.
- moq_
consume_ ⚠track - Subscribe to a raw track by name, delivering each frame’s payload as-is.
- moq_
consume_ track_ close - Stop a raw track consumer’s background task.
- moq_
consume_ ⚠track_ frame - Read a raw frame’s payload delivered via the moq_consume_track callback.
- moq_
consume_ track_ frame_ free - Free a raw frame delivered via the moq_consume_track callback, releasing its payload.
- moq_
consume_ ⚠track_ update - Update a raw track subscription’s delivery preferences.
- moq_
consume_ ⚠video - Consume a video track from a broadcast, delivering frames in order.
- moq_
consume_ video_ close - Stop a video track consumer’s background task.
- moq_
consume_ ⚠video_ config - Query information about a video track in a catalog.
- moq_
consume_ ⚠video_ properties - Query the catalog properties shared by every video rendition.
- moq_
consume_ ⚠video_ raw - Subscribe to a video track and decode it into raw I420 frames.
- moq_
consume_ video_ raw_ close - Stop a video (raw) consumer’s background task.
- moq_
consume_ ⚠video_ raw_ frame - Copy a delivered frame’s metadata into
dst. - moq_
consume_ video_ 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_
error - Human-readable reason for the most recent failed call on the calling thread.
- 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_ free - Free a single announcement delivered to a moq_origin_announced
on_announcecallback. - 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_ announced - Consume a broadcast from an origin by path, waiting until it is announced.
- moq_
origin_ consume_ announced_ close - Abort a wait started by moq_origin_consume_announced.
- moq_
origin_ create - Create an origin for publishing broadcasts.
- moq_
origin_ ⚠publish - Create a broadcast at
pathon an origin, for publishing media tracks. - moq_
origin_ ⚠request - Request a broadcast from an origin by path, resolving as soon as it can be served.
- moq_
origin_ request_ close - Abort a request started by moq_origin_request.
- moq_
publish_ ⚠audio_ config - Add or replace an audio rendition in a broadcast’s catalog.
- moq_
publish_ ⚠audio_ raw - Open an audio track on a broadcast.
- moq_
publish_ audio_ raw_ finish - Flush any pending samples and finalize an audio producer.
- moq_
publish_ ⚠audio_ raw_ frame - Push one audio frame.
- moq_
publish_ ⚠audio_ remove - Remove an audio rendition from a broadcast’s catalog by name.
- moq_
publish_ ⚠catalog_ section - Set (or replace) a top-level application catalog section by name.
- moq_
publish_ ⚠catalog_ section_ remove - Remove a top-level application catalog section by name.
- moq_
publish_ finish - Finish a broadcast and release it, ending its catalog cleanly.
- moq_
publish_ group_ abort - Abort a raw group with an application error code.
- moq_
publish_ group_ finish - Finish a raw group. No more frames can be written.
- moq_
publish_ ⚠group_ frame - Write a frame into a raw group created by moq_publish_track_group.
- moq_
publish_ ⚠json_ snapshot - Create a JSON snapshot track (lossy latest-value) on a broadcast.
- moq_
publish_ json_ snapshot_ finish - Finish a JSON snapshot track. No more values can be published.
- moq_
publish_ ⚠json_ snapshot_ update - Publish a new value to a JSON snapshot track.
valueis a UTF-8 JSON document. A no-op if unchanged from the previous update. - moq_
publish_ ⚠json_ stream - Create a JSON stream track (lossless append-log) on a broadcast.
- moq_
publish_ ⚠json_ stream_ append - Append one record to a JSON stream track.
valueis a UTF-8 JSON document. - moq_
publish_ json_ stream_ finish - Finish a JSON stream track. No more records can be appended.
- moq_
publish_ ⚠media - Create a new media track for a broadcast
- moq_
publish_ media_ finish - Finish a media track, flushing any buffered frames. No more frames can be written.
- moq_
publish_ ⚠media_ frame - Write data to a track.
- moq_
publish_ set_ announce - Set whether a broadcast created by moq_origin_publish is live: announced by its origin.
- moq_
publish_ ⚠track - Create a raw track on a broadcast for arbitrary byte payloads.
- moq_
publish_ track_ abort - Abort a raw track with an application error code.
- moq_
publish_ ⚠track_ datagram - Send a best-effort datagram on a raw track created by moq_publish_track.
- moq_
publish_ track_ finish - Finish a raw track. No more groups or frames can be written.
- moq_
publish_ track_ finish_ at - Declare a raw track’s exclusive final group sequence.
- moq_
publish_ ⚠track_ frame - Write a single-frame group to a raw track with a timestamp.
- moq_
publish_ track_ group - Append a new group to a raw track, returning a group producer.
- moq_
publish_ track_ group_ at - Create a raw group with an explicit sequence number.
- moq_
publish_ ⚠video_ config - Add or replace a video rendition in a broadcast’s catalog.
- moq_
publish_ ⚠video_ properties - Replace the catalog properties shared by every video rendition.
- moq_
publish_ ⚠video_ remove - Remove a video rendition from a broadcast’s catalog by name.
- moq_
session_ close - Request that a session shut down.
- moq_
session_ ⚠connect - Start establishing a connection to a MoQ server.
- moq_
session_ ⚠stats - Snapshot the current connection statistics for a session.
Type Aliases§
- Status
- Status code returned by FFI functions.