Skip to main content

Module source

Module source 

Source

Structs§

AppSource
A source whose data comes from application code pushing buffers in, rather than this element reading them itself — GStreamer’s appsrc equivalent, the reverse of crate::elements::AppSink. Push encoded MediaBuffer::Packets (straight into a decoder) or already-decoded MediaBuffer::Video/MediaBuffer::Audio (e.g. frames from a camera SDK, or synthetic test data) via AppSourceHandle, from any thread — a live capture callback, a network receive loop, a test.
AppSourceHandle
A cheaply-cloneable handle for pushing buffers into an AppSource from any thread — Clone is just two refcount bumps (name and the channel sender are both cheap to share).
AudioMixer
Sums an arbitrary, dynamically-changing number of audio sources into one output stream — the structural mirror of crate::elements::Tee: Tee is one input fanned out to a dynamic set of outputs behind a lock; AudioMixer is a dynamic set of inputs (added/removed via MixerHandle, from whatever thread each one’s own source pipeline runs on) summed into one output. Unlike Tee, which is a passive Sink driven entirely by whatever calls consume, AudioMixer has to drive itself: it’s a SourceElement with its own run thread, ticking every TICK_INTERVAL to sum however many samples each currently-attached input has ready — because mixing has to keep producing something on a steady clock even when some (or all) inputs have gone quiet, the same reason WasapiCaptureSource synthesizes silence for gaps rather than just emitting nothing.
AudioMixerOptions
Construction-time options for AudioMixer::new — the mixer’s fixed output format. Every input is resampled to match this on the way in (see InputBuffer::push); the mixer never adapts to whatever an input happens to produce.
FileDemuxer
Demuxes a file, exposing one src pad per container stream (indexed the same way as StreamInfo::index). Linking a pad “selects” that stream; leaving it unlinked just drops its packets. Real demuxer I/O is blocking, so this is meant to be run as the pipeline’s source thread.
MixerHandle
A cheaply-cloneable handle for adding or removing an AudioMixer’s input sources while the pipeline is running — the mirror image of crate::elements::TeeHandle: Tee lets you attach/detach outputs from another thread; this lets you attach/detach inputs. Keeps only a Weak reference for the same reason TeeHandle does: retaining a handle after the mixer’s own pipeline finishes must not keep its internal state alive forever, and every operation becomes a harmless no-op once the mixer is gone.
MixerInputSink
One AudioMixer input, returned by MixerHandle::add_source. Resamples every incoming frame to the mixer’s fixed output format and appends it to this input’s own buffer — the actual summing happens later, on AudioMixer::run’s own thread, not here. consume runs on whatever thread is driving the upstream source this got linked to (a different pipeline’s own thread, in the normal case), so every access to the shared input map goes through MixerShared’s lock.
RtspOptions
Construction-time options for RtspSource::open.
RtspSource
Demuxes a live RTSP stream — the client/receive counterpart to crate::elements::RtspSink (which publishes). One src pad per stream the server advertises, same shape as crate::elements::FileDemuxer.
StreamInfo
Metadata about one stream in an opened container, reported up front so callers can decide what to build downstream before the pipeline runs.
TestAudioOptions
Construction-time options for TestAudioSource::new.
TestAudioSource
Generates a synthetic sine-wave tone — GStreamer’s audiotestsrc equivalent. No real capture device involved: TestAudioSource::run fabricates however many samples wall-clock time now owes on a drift-free absolute schedule (expected = elapsed * sample_rate, needed = expected - samples_emitted — the same shape WasapiCaptureSource::fill_silence_gap/AudioMixer::mix_tick both use, not a fixed per-tick sample count, which would drift the same way a fixed-duration thread::sleep-only schedule would), stamps it with an increasing pts (one sample per tick of TestAudioSource::time_base’s units), and pushes it straight downstream — useful for exercising AudioMixer/an encoder/a muxer without a real microphone.
TestVideoOptions
Construction-time options for TestVideoSource::new.
TestVideoSource
Generates a synthetic, moving-diagonal-gradient video stream — GStreamer’s videotestsrc equivalent. No real decode/demux involved: run() fabricates one Pixel::YUV420P frame per tick, stamps it with an increasing pts (one tick per frame, in TestVideoSource::time_base’s units), and pushes it straight downstream — useful for exercising Scaler/Pacer/D3d12Renderer/etc. without a real file or camera. D3d12Renderer in particular already handles Pixel::YUV420P on its CPU-upload path, so this can feed a renderer directly, no decoder needed.
TextLayer
Construction-time settings for one text layer, passed to D3d11VideoCompositorHandle::add_text_layer — the text sibling of super::video_layer::VideoLayer, which add_source takes the same way. font_data (raw TTF/OTF bytes; this crate bundles no font of its own) has no sane default, so — mirroring super::video_layer::VideoLayer::new, which takes the one field a caller must supply (rect) and defaults the rest — Self::new takes only font_data and defaults font_size/color/x/y, all freely reassignable before the call to add_text_layer.
VideoCompositor
Composites the latest frames from any number of independent input pipelines into one fixed-rate opaque BGRA video stream.
VideoCompositorHandle
A cheaply cloneable handle for adding and removing compositor inputs. It mirrors crate::elements::MixerHandle, but each registration also returns a VideoLayerHandle for changing that input’s placement.
VideoCompositorInput
The two endpoints created for one compositor input registration. Move sink into the upstream pipeline and retain layer in application code for runtime placement changes.
VideoCompositorInputSink
One terminal video input returned by VideoCompositorHandle::add_source. It stores only the latest frame, so a fast producer cannot build an unbounded queue behind a slower compositor output rate.
VideoCompositorOptions
The compositor’s fixed output definition. Every emitted frame is an opaque ffmpeg::format::Pixel::BGRA frame at width x height.
VideoInputId
An opaque, stable identity for one compositor input registration. Replacing an input with the same name creates a different identity, so an old sink or layer handle can never affect its replacement.
VideoLayer
Runtime-adjustable spatial settings for one compositor input.
VideoLayerHandle
Thread-safe runtime placement control for one compositor input. Retaining it does not keep the input or compositor alive.
VideoRect
An output-space rectangle. Signed coordinates allow a layer to be moved partially outside the canvas while its size remains positive.

Enums§

AppSourceError
Errors specific to AppSource. Converts into the crate-wide Error via ? (see crate::error::Error).
AudioMixerError
Errors specific to AudioMixer. Converts into the crate-wide Error via ? (see crate::error::Error).
FileDemuxError
Errors specific to FileDemuxer. Converts into the crate-wide Error via ? (see crate::error::Error).
RtspSourceError
Errors specific to RtspSource. Converts into the crate-wide Error via ? (see crate::error::Error).
TestAudioSourceError
Errors specific to TestAudioSource. Converts into the crate-wide Error via ? (see crate::error::Error).
TestVideoSourceError
Errors specific to TestVideoSource. Converts into the crate-wide Error via ? (see crate::error::Error).
VideoCompositorError
Errors specific to VideoCompositor.
VideoFit
How an input’s aspect ratio is mapped into its VideoRect.