Skip to main content

Crate moq

Crate moq 

Source
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_json_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
An untyped application section in the catalog: a top-level key beyond video/audio.
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
Stop an audio track consumer’s background task.
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 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
Query an untyped application section in a catalog by index.
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_json
Subscribe to a JSON snapshot track (lossy latest-value) by name.
moq_consume_json_close
Stop a JSON consumer’s background task (snapshot or stream).
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 or moq_consume_json_stream callback.
moq_consume_json_value_close
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_close
Close a raw frame and clean up its resources.
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_ordered
Consume a video track from a broadcast, delivering frames in order.
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_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_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
Publish a broadcast to an origin.
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_close
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 an untyped application section in a broadcast’s catalog.
moq_publish_catalog_section_remove
Remove an untyped application section from a broadcast’s catalog by name.
moq_publish_close
Close a broadcast and clean up its resources.
moq_publish_create
Create a new broadcast for publishing media tracks.
moq_publish_group_close
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
Create a JSON snapshot track (lossy latest-value) on a broadcast.
moq_publish_json_close
Finish a JSON snapshot track. No more values can be published.
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. value is a UTF-8 JSON document.
moq_publish_json_stream_close
Finish a JSON stream track. No more records can be appended.
moq_publish_json_update
Publish a new value to a JSON snapshot track. value is a UTF-8 JSON document. A no-op if unchanged from the previous update.
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_publish_track
Create a raw track on a broadcast for arbitrary byte payloads.
moq_publish_track_close
Finish a raw track. No more groups or frames can be written.
moq_publish_track_frame
Write a single-frame group to a raw track.
moq_publish_track_group
Append a new group to a raw track, returning a group producer.
moq_publish_video_config
Add or replace a video rendition in a broadcast’s catalog.
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.

Type Aliases§

Status
Status code returned by FFI functions.