Skip to main content

Module media

Module media 

Source
Expand description

Sources, broadcasts and players, with the codec stacks they sit on.

The player feature brings the player and the decoders, publisher the publisher, the encoders and the sources. media turns on both.

Re-exports§

pub use moq_audio as audio;
pub use moq_video as video;
pub use wgpu;

Modules§

audio_encoding
Audio encoding presets for LocalBroadcast::set_audio.
spec
Text specifiers that name a video or an audio source, and open it.

Structs§

Adaptation
The player’s adaptation thresholds and timers.
AudioEncodeStats
The audio publication.
AudioEncoding
How an audio source is encoded: moq-audio’s encoder settings and the span of each group.
AudioFormat
The sample rate and speaker layout of a raw audio source.
AudioFrame
One block of decoded audio, from Player::audio_frames.
AudioFrames
The decoded audio of a player, in the order it decodes.
AudioInfo
The audio track of a MediaFile.
AudioPlaybackStats
The audio decoder.
AudioSource
A raw audio source.
BouncePattern
A white square bouncing left and right on a background that drifts through the hues.
Catalog
A catalog track, created by a broadcaster to describe the tracks available in a broadcast.
Delay
How far behind the live edge a media reader plays: where it starts, and how late it may fall.
EncodeStats
One video rendition’s encoder.
EncodedFrame
One encoded frame and the time it presents at.
FrameSender
The push end of a source.
FrameTiming
When one frame arrived, left its decoder, and was presented.
LocalBroadcast
A broadcast this process produces.
MediaEncoding
How LocalBroadcast::set_spec encodes the sources it opens.
MediaFile
An MP4 file, ready to publish as it is or to decode.
MediaInfo
What a MediaFile holds, as MediaFile::info reports it.
NetworkSample
One reading of the link a broadcast arrives over.
PlaybackStats
What a Player is playing.
Player
One playback: video into VideoFrames, audio into the speaker and AudioFrames.
PlayerConfig
How a player plays.
PlayerStatus
The state of a player.
PortalGrant
A desktop portal grant kept in a file, so a later run can skip the picker.
PublishStats
What a LocalBroadcast is sending.
PublishStatus
The state of both slots of a broadcast, and of every rendition.
Rate
A rate, in bits per second.
RemoteBroadcast
A broadcast being read.
RpicamConfig
How to run the Raspberry Pi camera.
SourceClosed
The source a FrameSender feeds has gone.
UnknownBackend
An error from parsing a backend name that is no strategy and no known backend.
VideoBacklog
A queue of the pictures a Player presents, with their timing.
VideoEncoding
How a video source is encoded: one or more renditions of the same picture.
VideoFileConfig
How MediaFile::video decodes the video.
VideoFormat
The size and cadence of a raw video source.
VideoFrames
Latest-frame-wins video frames.
VideoInfo
The video track of a MediaFile.
VideoPlaybackStats
The video decoder.
VideoRendition
One encoding of a broadcast’s picture.
VideoSource
A raw video source running on its own thread.
VideoSwitch
The handle that swaps the input of a VideoSource::switchable source.

Enums§

AudioMode
What a player does with the broadcast’s audio.
Backend
A choice of encoder or decoder backend: a strategy, or one backend by name.
EncodedAudio
Encoded audio for LocalBroadcast::set_encoded_audio.
EncodedVideo
Encoded video for LocalBroadcast::set_encoded_video.
Error
An error from the media crates.
FileEnd
What a file source does when it reaches the end of the file.
MediaKind
Which medium a FrameTiming describes.
RenditionMode
How the rendition is chosen.
RenditionState
Whether one rendition is encoding.
SlotState
The state of one media slot, on a broadcast or on a player.

Constants§

DEFAULT_LATENCY
The latency of PlayerConfig::default: held for at least 100 ms, and skipped past 150 ms.
IMMEDIATE_LATENCY
No buffer and no pacing: a frame presents as soon as it decodes.

Traits§

RoomExt
Reads a room member’s broadcast as media.
SubscriptionExt
Reads a Subscription as media.

Functions§

rpicam_h264
Starts the Raspberry Pi camera’s hardware H.264 through rpicam-vid.
screen_source
Returns the capture source of the main screen, as VideoSource::screen opens it.
video_rendition
Returns the video rendition of catalog named name.