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.
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).
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)