Skip to main content

Module spec

Module spec 

Expand description

Text specifiers that name a video or an audio source, and open it.

A specifier is a kind and an optional id, such as cam:2, screen, test:gradient or file:clip.mp4:loop. The ids are the ones the device listings report, such as moq_video::capture::cameras. There is no backend segment: the platform picks the backend for a device.

Both specifiers implement FromStr and Display, so a --video or --audio flag parses straight into one, and a specifier written out reads back the same. With the serde feature they also deserialize from, and serialize to, the same string. VideoSourceSpec::open and AudioSourceSpec::open open the source a specifier names. MediaSpec pairs a video with the audio that goes with it, which LocalBroadcast::set_spec in moq-ext-publisher opens and publishes.

§Examples

use moq_ext_sources::spec::{VideoOpenOptions, VideoSourceSpec};

let spec: VideoSourceSpec = "test:gradient".parse()?;
let source = spec.open(&VideoOpenOptions::default()).await?;

Structs§

MediaSpec
A video source and the audio that goes with it, which a broadcast publishes together.
ParseSpecError
An error from parsing a source specifier.
VideoOpenOptions
How VideoSourceSpec::open opens a source.

Enums§

AudioSourceSpec
A parsed audio source specifier.
RpicamMode
What rpicam-vid hands over: rpicam or rpicam:raw.
TestPattern
The generated picture test and test:<name> publish.
TestTone
The generated tone test and test:<name> publish.
VideoSourceSpec
A parsed video source specifier.

Constants§

PORTAL
The id of screen:portal and window:portal.