Converts decoded audio to one fixed AudioFormat via
libswresample. The input definition is learned from each frame and the
conversion context is rebuilt if it changes mid-stream.
D3d11DecoderWindows and d3d11 and (d3d11 or d3d12)
Decodes one video stream’s Packets into GPU-resident Video frames
via D3D11VA hardware acceleration — the D3D11 sibling of
crate::elements::D3d12vaDecoder, for a pipeline built entirely on
one shared ID3D11Device (see crate::elements::D3d11Renderer’s own
docs on why that means no explicit fence/sync is needed anywhere in
this stack, unlike the D3D12 side). A Filter, same shape as
SwDecoder/D3d12vaDecoder.
Encodes GPU-resident Pixel::D3D11Video frames into Packets on the
GPU’s dedicated NVENC block — the hardware counterpart to
crate::elements::SwEncoder, for a pipeline built entirely on one
shared ID3D11Device (see crate::elements::D3d11Renderer’s own docs
on why that means no explicit fence/sync is needed anywhere in this
stack). A Filter: receives via Sink, pushes what it produces into
its own single src pad.
Everything avcodec_open2 needs before this encoder can be opened at
all — same convention, and the same reasoning, as
crate::elements::SwEncoderOptions, which documents at length why
time_base and frame_rate are separate values rather than one
derived from the other.
Uploads CPU-resident Pixel::NV12 video frames to GPU-resident Video
frames tagged Pixel::D3D11 — the D3D11 sibling of
crate::elements::D3d12Upload, for a pipeline built entirely on one
shared ID3D11Device (see crate::elements::D3d11Renderer’s own
docs on why). Only accepts Pixel::NV12 input — chain a
crate::elements::Scaler (dst_format = Pixel::NV12) in front of
this if the source produces something else.
Uploads CPU-resident Pixel::NV12 video frames (e.g. from
crate::elements::Scaler, fed by a synthetic source, a screen
capture, …) to GPU-resident Video frames tagged Pixel::D3D12 —
the mirror image of crate::elements::D3d12vaDecoder: that one
decodes compressed Packets straight to GPU frames; this one moves
frames that start out on the CPU onto the same device a
crate::elements::D3d12Renderer reads from, so the renderer can take
its zero-copy path (Pixel::D3D12) instead of its CPU-upload one
(Pixel::YUV420P) — or so any other GPU-side stage downstream can work
on the frame without a CPU round trip.
Decodes one video stream’s Packets into GPU-resident Video frames
via D3D12VA hardware acceleration, instead of crate::elements::SwDecoder’s
plain libavcodec software path. A Filter, same shape as SwDecoder.
Delays each buffer until its presentation time, so downstream sees
frames (or, upstream of a decoder, compressed packets) at real playback
speed instead of as fast as demux/decode can produce them. A Filter:
receives via Sink, waits in short interruptible sleeps inside
consume, then pushes the same buffer through its own (single) src pad.
A pending pause/seek/stop interrupts that wait so the owning worker can
process control: pause retains the in-flight buffer for resume, while
seek and stop discard it.
Converts/resizes decoded video frames — pixel format (e.g. the YUV a
decoder produces -> the RGB most inference models expect) and
resolution (source resolution -> a model’s fixed input size) in one
pass via libswscale. A Filter: receives via Sink, pushes the
converted frame on through its own (single) src pad.
Encodes Audio frames into Packets via a software encoder (see
AudioCodec) — the audio sibling of
crate::elements::SwEncoder. A Filter: receives via Sink,
pushes what it produces into its own (single) src pad.
Construction-time options for SwAudioEncoder::new. sample_rate/
channels/time_base must already be known — same convention as
crate::elements::SwEncoder’s own width/height/time_base —
rather than inferred from the first frame, since avcodec_open2 needs
them set before this can be opened at all. What’s actually fed to
this element doesn’t have to match sample_rate/channels exactly —
see SwAudioEncoder’s own docs on why.
Decodes one stream’s Packets into Frames in software (plain
libavcodec, no hardware acceleration). A Filter: receives via Sink,
pushes what it produces into its own (single) src pad.
Encodes Pixel::YUV420PVideo frames into Packets via a software
encoder (see VideoCodec) — the mirror image of
crate::elements::SwDecoder’s decode direction. A Filter: receives
via Sink, pushes what it produces into its own (single) src pad.
Construction-time options for SwEncoder::new. width/height/
time_base must already be known — same convention as
crate::elements::Scaler/crate::elements::Pacer — rather than
inferred from the first frame, since avcodec_open2 needs them set
before this can be opened at all.
Fans a single input out to multiple sinks. TeeBuilder owns the
initial fan-out; later branches are added and removed through a
TeeHandle, which can be cloned and used from any thread, independent
of whatever thread is driving Tee::consume
(the pipeline’s source/queue-worker thread). That’s the whole reason
Tee doesn’t implement crate::element::Source like other
multi-pad elements (e.g. crate::elements::FileDemuxer): its pads
live in individually locked branch slots instead of being a plain
&mut [SrcPad]. consume only holds the branch-list lock long enough
to take a cheap Arc snapshot, so a slow downstream does not block
unrelated attach/detach operations. Detach prevents any push that has
not started yet; one already executing downstream call may finish.
A cheaply-cloneable handle for adding or removing a Tee’s sinks
while the pipeline is running. It deliberately keeps only a Weak
reference to the Tee’s shared state: retaining a handle after the
pipeline finishes must not keep downstream sinks or the pipeline’s
crate::bus::Bus sender alive. Once the Tee is gone,
TeeHandle::branch returns None.
Which software audio encoder to open. Just AudioCodec::Aac today —
unlike crate::elements::VideoCodec’s several real alternatives,
this crate only needs one working audio path right now (feeding an MP4
muxer); more can be added the same way VideoCodec was once something
actually needs a second one.
Which NVENC encoder to open. Both are hardware encoders on the GPU’s
dedicated encode block, so neither carries the GPL/licensing question
crate::elements::VideoCodec’s software encoders document — but both
still have to actually exist in the linked ffmpeg build, and
D3d11NvencEncoder::new fails with
D3d11NvencEncoderError::CodecNotFound (not a panic) if they don’t.
Which D3D11 texture format this encoder’s input frames carry. This is
the sw_format of the encoder’s own hw frames context, fixed at
avcodec_open2 time like every other codec parameter — it is not
inferred from the first frame, for the same reason
crate::elements::SwEncoderOptions takes width/height up front.
Which software encoder to open. Whatever’s picked, SwEncoder::new
fails with SwEncoderError::CodecNotFound (not a panic) if the
linked ffmpeg build doesn’t actually have it — this crate never
vendors any of these, it’s whatever the local ffmpeg install was built
with (check with ffmpeg -encoders).