pub struct Registry { /* private fields */ }Expand description
A runtime collection of element factories the auto-plugger searches over,
the analog of GStreamer’s plugin registry. Registration order is the
tie-break only indirectly: find_chain is breadth-first, so among
equal-length chains the one whose elements register earliest is found
first.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn register(&mut self, factory: ElementFactory) -> &mut Self
pub fn register(&mut self, factory: ElementFactory) -> &mut Self
Register one element factory (a transform / sink the search composes
into chains), returning &mut self to chain calls.
Sourcepub fn register_source(&mut self, source: SourceFactory) -> &mut Self
pub fn register_source(&mut self, source: SourceFactory) -> &mut Self
Register one source factory (a graph root for [build_playbin]),
returning &mut self to chain calls.
Sourcepub fn register_uri(&mut self, handler: UriSourceFactory) -> &mut Self
pub fn register_uri(&mut self, handler: UriSourceFactory) -> &mut Self
Register one URI-scheme handler (a graph root for
build_uridecodebin), returning
&mut self to chain calls.
Sourcepub fn register_launch(&mut self, factory: LaunchFactory) -> &mut Self
pub fn register_launch(&mut self, factory: LaunchFactory) -> &mut Self
Register a named transform / sink for the gst-launch parser and
gst-inspect (M105), returning &mut self to chain calls.
Sourcepub fn register_muxer(&mut self, factory: MuxerFactory) -> &mut Self
pub fn register_muxer(&mut self, factory: MuxerFactory) -> &mut Self
Register a named fan-in muxer for the gst-launch parser (M122),
returning &mut self to chain calls.
Sourcepub fn register_fanout_src(&mut self, factory: FanoutSrcFactory) -> &mut Self
pub fn register_fanout_src(&mut self, factory: FanoutSrcFactory) -> &mut Self
Register a named fan-out demuxer for the gst-launch parser (M210),
returning &mut self to chain calls.
Sourcepub fn is_fanout_src(&self, name: &str) -> bool
pub fn is_fanout_src(&self, name: &str) -> bool
Whether name is a registered terminal fan-out source.
Sourcepub fn make_fanout_src(
&self,
name: &str,
outputs: usize,
) -> Option<Box<dyn DynMultiOutputSource>>
pub fn make_fanout_src( &self, name: &str, outputs: usize, ) -> Option<Box<dyn DynMultiOutputSource>>
Build a registered terminal fan-out source with outputs ports.
pub fn register_demux(&mut self, factory: DemuxFactory) -> &mut Self
Sourcepub fn register_playbin(&mut self, hook: PlaybinHook) -> &mut Self
pub fn register_playbin(&mut self, hook: PlaybinHook) -> &mut Self
Register a playbin uri=X auto-fan-out hook (M382): a lone playbin
in a parse_launch pipeline tries the
registered hooks in order until one handles the URI. Register one per
container type (MKV, TS, …); each declines a container it does not
parse. Returns &mut self to chain calls.
Sourcepub fn demux_select_hooks(&self) -> &[DemuxSelectHook] ⓘ
pub fn demux_select_hooks(&self) -> &[DemuxSelectHook] ⓘ
The registered explicit-demux fan-out hooks (M476), tried in order by
parse_launch for a named demux element
with several output-pad references and a file source upstream.
Sourcepub fn register_demux_select(&mut self, hook: DemuxSelectHook) -> &mut Self
pub fn register_demux_select(&mut self, hook: DemuxSelectHook) -> &mut Self
Register an explicit-demux fan-out hook (M476): a named demux element
(matroskademux name=d d.video_0 ! ... d.audio_0 ! ...) fed by a file
source tries the registered hooks in order until one probes the file and
builds the multi-output demuxer. Register one per container type; each
declines a container it does not parse. Returns &mut self to chain.
Sourcepub fn decodebin_select_hooks(&self) -> &[DecodebinSelectHook] ⓘ
pub fn decodebin_select_hooks(&self) -> &[DecodebinSelectHook] ⓘ
The decodebin fan-out hooks (M482), tried in order by
parse_launch for a decodebin name=d
with several d. references and a file source upstream.
Sourcepub fn register_decodebin_select(
&mut self,
hook: DecodebinSelectHook,
) -> &mut Self
pub fn register_decodebin_select( &mut self, hook: DecodebinSelectHook, ) -> &mut Self
Register a decodebin fan-out hook (M482): a decodebin name=d fed by a
file source tries the registered hooks until one parses the container,
returning the multi-output demuxer + per-port caps so the parser splices
a decoder onto each port. One per container type. Returns &mut self.
Sourcepub fn register_primary_stream(&mut self, hook: PrimaryStreamHook) -> &mut Self
pub fn register_primary_stream(&mut self, hook: PrimaryStreamHook) -> &mut Self
Register a bare-decodebin primary-stream hook (M746): a filesrc location=X ! decodebin on a container tries each until one sniffs the
file and names the single-stream demux + stream selection for its primary
decodable stream. One per container type. Returns &mut self.
Sourcepub fn primary_stream(
&self,
location: &str,
caps: &Caps,
) -> Option<PrimaryStream>
pub fn primary_stream( &self, location: &str, caps: &Caps, ) -> Option<PrimaryStream>
The single-stream demux + decode selection for a bare decodebin on the
container at location with caps, from the first hook that parses it
(M746); None when none applies (no video-less container to fix, an
unreadable file, or no hook registered).
Sourcepub fn set_parser_provider(
&mut self,
provider: fn(&Caps) -> Option<&'static str>,
) -> &mut Self
pub fn set_parser_provider( &mut self, provider: fn(&Caps) -> Option<&'static str>, ) -> &mut Self
Set the parser injector consulted by decodebin and
decodebin_preferring (M421): before a
decode chain is spliced, provider(input) may name a registered parser
(e.g. an access-unit-re-framing h264parse) to prepend ahead of the
decoder, so the decoder is fed one access unit per packet. The
name-based decodebin expansion in parse_launch consults the same
mapping via parser_name (M676). Returns
&mut self to chain calls.
Sourcepub fn set_encoder_provider(&mut self, provider: EncoderProvider) -> &mut Self
pub fn set_encoder_provider(&mut self, provider: EncoderProvider) -> &mut Self
Set the encoder chooser consulted by the encodebin expansion: for a
coded target caps (a stream of an encoding profile), provider(target)
names the launch elements that can produce it, most preferred first, and
encoder_name takes the first one this build
actually registered. Returns &mut self to chain calls.
Sourcepub fn set_muxer_provider(&mut self, provider: MuxerProvider) -> &mut Self
pub fn set_muxer_provider(&mut self, provider: MuxerProvider) -> &mut Self
Set the muxer chooser consulted by the encodebin expansion: for a
container caps, provider(container) names the muxers that write it,
most preferred first. Returns &mut self to chain calls.
Sourcepub fn encoder_choice(&self, target: &Caps) -> Option<&'static EncoderChoice>
pub fn encoder_choice(&self, target: &Caps) -> Option<&'static EncoderChoice>
The encoder that produces target: the first candidate this build
registered and can run, with the properties that pin it to this codec.
None when no provider is set, the target has no candidates, or every
candidate is compiled out (the “no encoder for this profile” a caller
reports).
Sourcepub fn muxer_name(&self, container: &Caps) -> Option<&'static str>
pub fn muxer_name(&self, container: &Caps) -> Option<&'static str>
The launch name of the muxer that writes container, chosen the way
encoder_name chooses an encoder.
Sourcepub fn set_domain_converter(
&mut self,
factory: fn(MemoryDomainKind, MemoryDomainKind) -> Option<GraphNode>,
) -> &mut Self
pub fn set_domain_converter( &mut self, factory: fn(MemoryDomainKind, MemoryDomainKind) -> Option<GraphNode>, ) -> &mut Self
Set the memory-domain converter factory a parsed pipeline is spliced
with (M1017): after the graph is built, an edge whose producer and
consumer share no memory domain gets factory(from, to) inserted, so a
text pipeline reaches a GPU sink from a GPU decoder without naming the
bridge element. Returns &mut self to chain calls.
Sourcepub fn domain_converter(
&self,
) -> Option<fn(MemoryDomainKind, MemoryDomainKind) -> Option<GraphNode>>
pub fn domain_converter( &self, ) -> Option<fn(MemoryDomainKind, MemoryDomainKind) -> Option<GraphNode>>
The configured domain-converter factory, if any.
Sourcepub fn parser_name(&self, input: &Caps) -> Option<&'static str>
pub fn parser_name(&self, input: &Caps) -> Option<&'static str>
The launch name of the re-framing parser decodebin prepends ahead of
a decoder for input caps, if the provider names one (M676).
Sourcepub fn playbin_hooks(&self) -> &[PlaybinHook] ⓘ
pub fn playbin_hooks(&self) -> &[PlaybinHook] ⓘ
The registered PlaybinHooks, in registration order (empty if none,
so playbin stays the M196 single-stream pipeline). The parser tries
them in turn for a lone playbin uri=.
Sourcepub fn register_alias(
&mut self,
name: &'static str,
targets: &'static [&'static str],
) -> &mut Self
pub fn register_alias( &mut self, name: &'static str, targets: &'static [&'static str], ) -> &mut Self
Register a gst-canonical-name alias (M192): name resolves, at
make_source / make_element time, to the first of targets that is
actually registered. Use a one-entry list for a plain rename
(avdec_h264 -> ffmpegdec) and a fallback chain for an auto element
(autovideosink -> ["waylandsink", "kmssink", "fakesink"]). Returns
&mut self to chain calls.
Sourcepub fn make_source(&self, name: &str) -> Option<Box<dyn DynSourceLoop>>
pub fn make_source(&self, name: &str) -> Option<Box<dyn DynSourceLoop>>
Construct a registered source by name (the parser’s first element).
None if no source is registered under name (after alias resolution).
Sourcepub fn make_element(&self, name: &str) -> Option<Box<dyn DynAsyncElement>>
pub fn make_element(&self, name: &str) -> Option<Box<dyn DynAsyncElement>>
Construct a registered transform / sink by name (a parser interior or
tail element), default-configured. None if name is not registered
via register_launch (after alias resolution).
Sourcepub fn declared_output_caps(&self, name: &str) -> Option<Caps>
pub fn declared_output_caps(&self, name: &str) -> Option<Caps>
The caps a registered element is known to produce on its source pad,
without constructing or negotiating it: a source’s declared output, or
a transform / sink’s first fixed source-pad template alternative.
None for an unregistered name or one whose source pad is wildcard.
The decodebin parser uses this to learn its upstream caps (the input
to the auto-plug search). Reads the factory-declared media type; it does
not reflect instance properties that re-type the output (e.g. a
filesrc’s bytestream-format).
Sourcepub fn make_muxer(
&self,
name: &str,
inputs: usize,
) -> Option<Box<dyn DynMultiInputElement>>
pub fn make_muxer( &self, name: &str, inputs: usize, ) -> Option<Box<dyn DynMultiInputElement>>
Construct a registered fan-in muxer by name with inputs input pads
(the parser derives the count from link degree, so it matches the
muxer node’s input-pad count). None if name is not registered via
register_muxer.
Sourcepub fn make_demux(
&self,
name: &str,
outputs: usize,
) -> Option<Box<dyn DynMultiOutputElement>>
pub fn make_demux( &self, name: &str, outputs: usize, ) -> Option<Box<dyn DynMultiOutputElement>>
Construct a registered fan-out demuxer by name with outputs output
pads (the parser derives the count from the d. link degree, so it
matches the demux node’s fan-out). None if name is not registered
via register_demux.
Sourcepub fn is_demux(&self, name: &str) -> bool
pub fn is_demux(&self, name: &str) -> bool
Whether name is registered as a fan-out demuxer (the parser uses this
to allow a multi-output node without an explicit tee).
Sourcepub fn knows_element(&self, name: &str) -> bool
pub fn knows_element(&self, name: &str) -> bool
The names of every element registerable by the parser: sources first,
then transforms / sinks, each in registration order. The gst-inspect
element list.
Whether name names something this registry can build: any factory
list, or an alias resolving into one. The launch parser asks this to
tell a new chain’s head from a typo’d property, since both are bare
tokens with no =.
pub fn element_names(&self) -> Vec<&'static str>
Sourcepub fn element_listing(&self) -> Vec<String>
pub fn element_listing(&self) -> Vec<String>
One line per registerable element, name: Long-name (the long name
from the element’s metadata, or just
the name when it declares none), for the gst-inspect element index.
Sources, then transforms / sinks, then muxers. Each non-muxer element is
default-built to read its metadata (side-effect-free, like
inspect).
Sourcepub fn inspect(&self, name: &str) -> Option<String>
pub fn inspect(&self, name: &str) -> Option<String>
A gst-inspect-style dump for the named element: its role, its
settable properties, and (for a transform / sink) its pad templates.
None if the name is not registered. The element is default-built to
read its property table (the specs are &'static, behind an instance
method), so building must be side-effect-free, as the in-tree
constructors are.
Sourcepub fn describe(&self, name: &str) -> Option<ElementDoc>
pub fn describe(&self, name: &str) -> Option<ElementDoc>
Structured introspection: the same facts inspect
dumps as text, returned as an ElementDoc for tooling to render
(e.g. the searchable element reference the docs site is generated from).
None if the name is not registered. Like inspect, it default-builds
the element to read its &'static metadata / property table, so the
in-tree constructors must be side-effect-free.
Sourcepub fn describe_all(&self) -> Vec<ElementDoc>
pub fn describe_all(&self) -> Vec<ElementDoc>
Every registered element as an ElementDoc, in the same order as
element_names (sources, transforms / sinks,
then muxer-only names). The structured catalog behind g2g-docgen.
Sourcepub fn autoplug_names_avoiding(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
preferred: MemoryDomainKind,
avoided: &[&str],
) -> Option<Vec<&'static str>>
pub fn autoplug_names_avoiding( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, preferred: MemoryDomainKind, avoided: &[&str], ) -> Option<Vec<&'static str>>
The names of the shortest chain that avoids every factory in
avoided: the retry after one of them turned out not to decode the
stream, where the search would otherwise pick it again. An empty
avoided is autoplug_names_preferring.
Sourcepub fn autoplug_avoiding(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
preferred: MemoryDomainKind,
avoided: &[&str],
) -> Option<Vec<Box<dyn DynAsyncElement>>>
pub fn autoplug_avoiding( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, preferred: MemoryDomainKind, avoided: &[&str], ) -> Option<Vec<Box<dyn DynAsyncElement>>>
autoplug_names_avoiding, instantiated.
Sourcepub fn factory_of_instance(&self, instance: &str) -> Option<&'static str>
pub fn factory_of_instance(&self, instance: &str) -> Option<&'static str>
The factory whose element the runner would name instance (its type’s
log category plus a number, e.g. VulkanVideoDec0 -> vulkanvideodec).
The bus names a failing element by instance; acting on it per factory,
to auto-plug around the one that failed, needs the way back.
Each candidate is default-constructed to be asked its category, which
costs an allocation and opens nothing (a decoder reaches its device at
configure_pipeline). None if no registered factory matches.
Sourcepub fn autoplug_names(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
) -> Option<Vec<&'static str>>
pub fn autoplug_names( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ) -> Option<Vec<&'static str>>
The names of the shortest chain converting input into caps
satisfying target, without instantiating anything. Some(vec![])
if input already satisfies target; None if no chain exists
within max_depth.
Sourcepub fn autoplug(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
) -> Option<Vec<Box<dyn DynAsyncElement>>>
pub fn autoplug( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ) -> Option<Vec<Box<dyn DynAsyncElement>>>
Find the shortest chain converting input into caps satisfying
target and instantiate it: an ordered list of boxed elements
(upstream first), each configured to produce the caps the search
chose for it, ready to splice onto run_graph as transforms.
Some(vec![]) if no elements are needed; None if no chain exists.
Sourcepub fn decodebin(
&self,
graph: &mut Graph<GraphNode>,
from: impl Into<PadId>,
to: impl Into<PadId>,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
) -> Result<Vec<NodeId>, DecodebinError>
pub fn decodebin( &self, graph: &mut Graph<GraphNode>, from: impl Into<PadId>, to: impl Into<PadId>, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ) -> Result<Vec<NodeId>, DecodebinError>
decodebin-equivalent: auto-plug a decode chain and splice it into
graph as a run of transforms between an existing output pad from
(which produces input caps) and an existing input pad to. Returns
the inserted transform node ids in chain order.
This is the “returns a sub-graph onto run_graph” payoff: the caller
builds its source and sink, names the input caps and the target shape
(is_raw_video for playback), and the registry fills the middle. An
empty chain (input already satisfies target) links from straight
to to.
The memory-domain preference comes from the graph itself (M989): the
element behind to declares what memory it accepts
(input_domains), so a
Cuda-only consumer gets the Cuda-producing decoder without the
caller naming a domain (see
derived_memory_preference).
decodebin_preferring overrides it.
Sourcepub fn derived_memory_preference(
graph: &Graph<GraphNode>,
to: PadId,
) -> MemoryDomainKind
pub fn derived_memory_preference( graph: &Graph<GraphNode>, to: PadId, ) -> MemoryDomainKind
The memory domain the decode chain’s consumer wants, read off the
element behind the to pad: the most-preferred domain of its declared
input_domains (GPU-resident
before System, per DomainSet). An element that declares no
requirement (DomainSet::ALL, the default) or a pad with no element
behind it (a tee) derives System, the plain selection, so an ordinary
graph is unaffected.
Only the immediate consumer is consulted, never a chain of them: a
default ALL means “declares no requirement”, not “passes any domain
through”, and most CPU elements never declare, so walking past them
would hand a GPU frame to an element that can only read host bytes.
Sourcepub fn declared_memory_preference(&self, name: &str) -> MemoryDomainKind
pub fn declared_memory_preference(&self, name: &str) -> MemoryDomainKind
The memory domain the element registered under name wants its frames
in, the same rule as
derived_memory_preference but
reached by launch name rather than through a built graph (M1018): the
text parser expands a decodebin before any element exists, so its
consumer is still just a name. An unregistered name derives System.
The name is default-constructed to be asked, since input_domains is a
per-instance method and every implementation of it is constant per
element type; a factory-level copy of the same fact could drift from it.
A launch factory’s constructor takes no arguments and opens nothing (a
sink reaches its device in configure_pipeline), so the throwaway
instance costs an allocation.
Sourcepub fn decodebin_with_params(
&self,
graph: &mut Graph<GraphNode>,
from: impl Into<PadId>,
to: impl Into<PadId>,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
params: &AutoplugParams,
) -> Result<Vec<NodeId>, AutoplugError>
pub fn decodebin_with_params( &self, graph: &mut Graph<GraphNode>, from: impl Into<PadId>, to: impl Into<PadId>, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, params: &AutoplugParams, ) -> Result<Vec<NodeId>, AutoplugError>
decodebin with per-element property assignments
(see AutoplugParams): each element the search selects, plus the
injected parser, gets the assignments addressed to its factory name
applied before it is spliced into the graph. The consumer’s memory
domain is derived the same way as in decodebin.
Sourcepub fn autoplug_names_preferring(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
preferred: MemoryDomainKind,
) -> Option<Vec<&'static str>>
pub fn autoplug_names_preferring( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, preferred: MemoryDomainKind, ) -> Option<Vec<&'static str>>
Domain-aware autoplug_names: bias ties toward a
chain whose terminal element emits the preferred memory feature (see
ElementDesc::output_memory). MemoryDomainKind::System reproduces
the default selection; Cuda prefers e.g. NvDec over a CPU decoder.
Sourcepub fn autoplug_preferring(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
preferred: MemoryDomainKind,
) -> Option<Vec<Box<dyn DynAsyncElement>>>
pub fn autoplug_preferring( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, preferred: MemoryDomainKind, ) -> Option<Vec<Box<dyn DynAsyncElement>>>
Domain-aware autoplug: instantiate the chain the
domain-aware search picks (see
autoplug_names_preferring).
Sourcepub fn autoplug_names_with(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
ctx: SelectionContext,
) -> Option<Vec<&'static str>>
pub fn autoplug_names_with( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ctx: SelectionContext, ) -> Option<Vec<&'static str>>
Capability-aware autoplug_names: score
candidates against ctx (SelectionContext) to choose among
elements satisfying the same caps (memory domain, hardware, then a rank
tiebreaker). The generalization of
autoplug_names_preferring (which is
the memory-only case); a default ctx is the plain selection.
Sourcepub fn autoplug_with(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
ctx: SelectionContext,
) -> Option<Vec<Box<dyn DynAsyncElement>>>
pub fn autoplug_with( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ctx: SelectionContext, ) -> Option<Vec<Box<dyn DynAsyncElement>>>
Capability-aware autoplug: instantiate the chain the
capability-scored search (autoplug_names_with)
picks.
Sourcepub fn autoplug_with_params(
&self,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
ctx: SelectionContext,
params: &AutoplugParams,
) -> Result<Vec<Box<dyn DynAsyncElement>>, AutoplugError>
pub fn autoplug_with_params( &self, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ctx: SelectionContext, params: &AutoplugParams, ) -> Result<Vec<Box<dyn DynAsyncElement>>, AutoplugError>
Capability-aware autoplug that also applies
params to each element it builds (see AutoplugParams). The
instantiation half of decodebin_with_params.
Sourcepub fn decodebin_preferring(
&self,
graph: &mut Graph<GraphNode>,
from: impl Into<PadId>,
to: impl Into<PadId>,
input: &Caps,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
preferred: MemoryDomainKind,
) -> Result<Vec<NodeId>, DecodebinError>
pub fn decodebin_preferring( &self, graph: &mut Graph<GraphNode>, from: impl Into<PadId>, to: impl Into<PadId>, input: &Caps, target: &dyn Fn(&Caps) -> bool, max_depth: usize, preferred: MemoryDomainKind, ) -> Result<Vec<NodeId>, DecodebinError>
Domain-aware decodebin: splice in the chain the
domain-aware search picks, biased toward preferred memory (e.g. Cuda
to prefer NvDec when the downstream consumer is GPU-resident).
preferred wins over what decodebin would derive from the consumer’s
declared input domains, so this is the caller’s override (ask for
System and a Cuda-accepting consumer still gets the CPU decoder, with
the converter auto-plug uploading on the edge).
Sourcepub fn build_playbin<Sk: AsyncElement + 'static>(
&self,
source_name: &str,
sink: Sk,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
) -> Result<Graph<GraphNode>, PlaybinError>
pub fn build_playbin<Sk: AsyncElement + 'static>( &self, source_name: &str, sink: Sk, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ) -> Result<Graph<GraphNode>, PlaybinError>
playbin-equivalent: assemble a complete runnable graph from a
registered source name and a sink, auto-plugging the decode chain in
between. Looks up the source factory, takes its declared output caps
as the decodebin input, and returns source -> chain -> sink ready
for run_graph. This is the “just play
this” entry point, minus the URI-scheme front door (the caller still
names the source rather than passing a uri=).
Sourcepub fn build_playbin_with_params<Sk: AsyncElement + 'static>(
&self,
source_name: &str,
sink: Sk,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
params: &AutoplugParams,
) -> Result<Graph<GraphNode>, AutoplugError>
pub fn build_playbin_with_params<Sk: AsyncElement + 'static>( &self, source_name: &str, sink: Sk, target: &dyn Fn(&Caps) -> bool, max_depth: usize, params: &AutoplugParams, ) -> Result<Graph<GraphNode>, AutoplugError>
build_playbin with per-element property
assignments for the auto-plugged chain (see AutoplugParams).
Sourcepub fn build_uri_source(
&self,
uri: &str,
) -> Result<(Box<dyn DynSourceLoop>, Caps), UriError>
pub fn build_uri_source( &self, uri: &str, ) -> Result<(Box<dyn DynSourceLoop>, Caps), UriError>
uridecodebin-equivalent: the URI-scheme front door to
build_playbin. Parses uri, dispatches to
the registered UriSourceFactory for its scheme to construct the
source from the URI, then auto-plugs source -> chain -> sink down
to target, returning a graph ready for
run_graph.
target is a shape predicate (commonly is_raw_video for
playback); the source’s runtime caps are resolved at negotiation, so
the handler’s declared output caps only need to name the media type
the right decoder is plugged for.
Dispatch a URI to its registered scheme handler, constructing the
source from the URI and returning it with the caps it produces (the
decode-chain input). The lower half of
build_uridecodebin, exposed so the
uridecodebin / playbin text-parser nodes can splice the source into
a larger graph instead of getting a complete one.
pub fn build_uridecodebin<Sk: AsyncElement + 'static>( &self, uri: &str, sink: Sk, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ) -> Result<Graph<GraphNode>, UriError>
Sourcepub fn build_source_decodebin<Sk: AsyncElement + 'static>(
&self,
source: Box<dyn DynSourceLoop>,
source_caps: &Caps,
sink: Sk,
target: &dyn Fn(&Caps) -> bool,
max_depth: usize,
) -> Result<Graph<GraphNode>, UriError>
pub fn build_source_decodebin<Sk: AsyncElement + 'static>( &self, source: Box<dyn DynSourceLoop>, source_caps: &Caps, sink: Sk, target: &dyn Fn(&Caps) -> bool, max_depth: usize, ) -> Result<Graph<GraphNode>, UriError>
Auto-plug source -> chain -> sink from an already constructed
source whose output is source_caps, the lower half of
build_uridecodebin factored out so a
caller that built (or wrapped) its own source can still get the decode
chain auto-plugged. A gapless playlist source (GaplessSrc) uses this
to splice its decode chain without the URI-handler step.
Sourcepub fn build_playbin_graph<D: MultiOutputElement + 'static>(
&self,
uri: &str,
demux: D,
ports: Vec<PlaybinPort>,
max_depth: usize,
) -> Result<Graph<GraphNode>, PlaybinGraphError>
pub fn build_playbin_graph<D: MultiOutputElement + 'static>( &self, uri: &str, demux: D, ports: Vec<PlaybinPort>, max_depth: usize, ) -> Result<Graph<GraphNode>, PlaybinGraphError>
playbin-equivalent (M379): assemble a complete runnable graph that
splits a container into its selected streams and decodes each to its own
sink. Builds the source from uri, adds demux (a
MultiOutputElement, e.g. MkvDemuxN) as a fan-out node, and for each
PlaybinPort (one per selected stream, in port order) auto-plugs a
decode chain from that port’s elementary caps to its sink. Returns
source -> demux -> {decode chain -> sink} ready for
run_graph, the multi-stream counterpart of
build_uridecodebin.
The app derives ports from the demux’s announced
StreamCollection (M376) and its
selection (M377); demux’s port count must equal ports.len(). Each
branch retypes from the demux’s (byte-stream) input caps to its
elementary stream via the per-port CapsChanged the demux emits, so a
branch element must tolerate the startup broadcast and re-solve then (the
M210 demux-node contract); per-branch static negotiation against the port
caps is a follow-up.
Sourcepub fn build_playbin_graph_with_params<D: MultiOutputElement + 'static>(
&self,
uri: &str,
demux: D,
ports: Vec<PlaybinPort>,
max_depth: usize,
params: &AutoplugParams,
) -> Result<Graph<GraphNode>, AutoplugError>
pub fn build_playbin_graph_with_params<D: MultiOutputElement + 'static>( &self, uri: &str, demux: D, ports: Vec<PlaybinPort>, max_depth: usize, params: &AutoplugParams, ) -> Result<Graph<GraphNode>, AutoplugError>
build_playbin_graph with per-element
property assignments applied to every branch’s auto-plugged chain (see
AutoplugParams). The same assignments are offered to each branch, so
a factory selected on two branches is configured identically.
Sourcepub fn build_playbin_graph_with_source<D: MultiOutputElement + 'static>(
&self,
source: Box<dyn DynSourceLoop>,
demux: D,
ports: Vec<PlaybinPort>,
max_depth: usize,
) -> Result<Graph<GraphNode>, PlaybinGraphError>
pub fn build_playbin_graph_with_source<D: MultiOutputElement + 'static>( &self, source: Box<dyn DynSourceLoop>, demux: D, ports: Vec<PlaybinPort>, max_depth: usize, ) -> Result<Graph<GraphNode>, PlaybinGraphError>
Like build_playbin_graph but with a
pre-built byte source instead of one derived from the URI’s scheme
handler. The playbin uri= auto-fan-out hook (M382) uses this: having
probed the file to choose the demuxer, it already knows the container,
so it supplies the matching raw-byte source directly rather than the
URI handler’s source (which, for file://, may self-demux a different
container, e.g. MP4). source must emit the byte stream demux
expects.