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.
CaptureRectWindows and dxgi-capture and (dxgi-capture or wasapi-capture)
A capture region in absolute virtual-desktop pixel coordinates — the same origin/units Win32 itself uses for multi-monitor layout (GetSystemMetrics(SM_XVIRTUALSCREEN), MONITORINFOEX::rcMonitor, DXGI_OUTPUT_DESC::DesktopCoordinates), not local to any one monitor. See CaptureArea::Region.
D3d11TextLayerHandleWindows and d3d11
Dynamic text drawn into a super::D3d11VideoCompositor scene, obtained via super::D3d11VideoCompositorHandle::add_text_layer — there’s no upstream Pipeline branch feeding this input, only D3d11TextLayerHandle::set_text calls. Not an crate::element::Element — never wired into a Pipeline (no Sink, no bus/topology identity). Named to match D3d11VideoLayerHandle’s family, but it isn’t as thin as the rest of that family: every other *Handle in this crate is a cheap, Clone-able Weak-backed proxy over state it doesn’t own, whereas this one owns a real device/font/frame-pool and does actual GPU work (rasterize + upload) on every set_text call.
D3d11VideoCompositorWindows and d3d11
Composites the latest frames from any number of independent GPU-backed input pipelines into one fixed-rate opaque Pixel::D3D11 (BGRA) stream, entirely on the GPU via a D3D11 pixel shader — the D3D11 sibling of crate::elements::VideoCompositor (which does the same job on the CPU via libswscale). Same VideoLayer/video_layer::VideoRect/ video_layer::VideoFit API — a caller’s layer-control code doesn’t change shape when switching between the two.
D3d11VideoCompositorHandleWindows and d3d11
A cheaply cloneable handle for adding and removing D3d11VideoCompositor inputs — the GPU sibling of crate::elements::VideoCompositorHandle, same shape and behavior.
D3d11VideoCompositorInputWindows and d3d11
The two endpoints created for one compositor input registration.
D3d11VideoCompositorInputSinkWindows and d3d11
One terminal video input returned by D3d11VideoCompositorHandle::add_source — the GPU sibling of crate::elements::VideoCompositorInputSink, same behavior (stores only the latest frame; a fast producer can’t build an unbounded queue behind a slower compositor output rate).
D3d11VideoLayerHandleWindows and d3d11
Thread-safe runtime placement control for one super::D3d11VideoCompositor input — the GPU sibling of crate::elements::VideoLayerHandle.
DxgiCaptureOptionsWindows and dxgi-capture and (dxgi-capture or wasapi-capture)
Construction-time options for DxgiCaptureSource::open.
DxgiCaptureSourceWindows and dxgi-capture and (dxgi-capture or wasapi-capture)
Captures the desktop via Windows’ DXGI Desktop Duplication API (IDXGIOutputDuplication) — GStreamer’s d3d11screencapturesrc equivalent. One src pad, pushing Pixel::BGRA frames (no internal color conversion — same division of labor as every other source in this crate: chain a crate::elements::Scaler downstream if something needs YUV420P, e.g. crate::elements::D3d12Renderer’s CPU-upload path or crate::elements::SwEncoder).
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.
WasapiCaptureOptionsWindows and wasapi-capture and (dxgi-capture or wasapi-capture)
Construction-time options for WasapiCaptureSource::open.
WasapiCaptureSourceWindows and wasapi-capture and (dxgi-capture or wasapi-capture)
Captures audio via WASAPI (IAudioClient/IAudioCaptureClient) — GStreamer’s wasapi2src equivalent. One src pad, pushing MediaBuffer::Audio frames in the captured device’s own native mix format/rate/channel count — no resampling. Same division of labor as crate::elements::DxgiCaptureSource emitting raw Pixel::BGRA and leaving conversion to a downstream crate::elements::Scaler: if something downstream needs a fixed sample rate/format, use crate::elements::AudioResampler rather than hiding conversion in this element.
WasapiDeviceWindows and (wasapi-capture or wasapi-renderer)
One active WASAPI endpoint.

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).
CaptureAreaWindows and dxgi-capture and (dxgi-capture or wasapi-capture)
Which portion of the desktop DxgiCaptureSource::open duplicates — see DxgiCaptureOptions::area.
CaptureModeWindows and dxgi-capture and (dxgi-capture or wasapi-capture)
How DxgiCaptureSource::open captures each frame — see DxgiCaptureOptions::capture_mode.
D3d11TextLayerErrorWindows and d3d11
Errors specific to D3d11TextLayerHandle.
D3d11VideoCompositorErrorWindows and d3d11
Errors specific to D3d11VideoCompositor.
DxgiCaptureSourceErrorWindows and dxgi-capture and (dxgi-capture or wasapi-capture)
Errors specific to DxgiCaptureSource. 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.
WasapiCaptureSourceErrorWindows and wasapi-capture and (dxgi-capture or wasapi-capture)
Errors specific to WasapiCaptureSource. Converts into the crate-wide Error via ? (see crate::error::Error).
WasapiDeviceKindWindows and (wasapi-capture or wasapi-renderer)
Which direction a WASAPI endpoint flows.