pub enum GraphNodeRef<'a> {
Source(Box<dyn DynSourceLoop + 'a>),
Element(Box<dyn DynAsyncElement + 'a>),
Muxer(Box<dyn DynMultiInputElement + 'a>),
FanoutSource(Box<dyn DynMultiOutputSource + 'a>),
Demux(Box<dyn DynMultiOutputElement + 'a>),
}Expand description
Element payload for a Graph driven by run_graph. Sources,
transforms/sinks, and muxers implement different traits (a source has no
input pad, a muxer has many), so the payload is an enum the runner matches
on per node kind. A tee carries no element (Graph::add_tee takes none).
The 'a lifetime is the lifetime of the boxed elements. Owned 'static
elements (the common case, GraphNode) use source / element / muxer;
the convenience wrappers build a borrowing graph over their &mut element
references with source_ref / element_ref / muxer_ref, so they can call
run_graph without taking ownership and the caller keeps its elements.
Variants§
Source(Box<dyn DynSourceLoop + 'a>)
Element(Box<dyn DynAsyncElement + 'a>)
Muxer(Box<dyn DynMultiInputElement + 'a>)
FanoutSource(Box<dyn DynMultiOutputSource + 'a>)
A terminal fan-out source (M727): 0 inputs, N outputs it generates
itself (a WebRTC session receiving several tracks). Graph::add_fanout_src.
Demux(Box<dyn DynMultiOutputElement + 'a>)
A content-routing demultiplexer: 1 input, N outputs. Structurally a tee
(its node kind is Tee(n)), so it negotiates as a tee at startup, but it
carries a MultiOutputElement that routes each packet to a chosen
output instead of broadcasting, and emits per-output CapsChanged so each
branch retypes from the byte-stream input (M210). Graph::add_demux.
Implementations§
Source§impl<'a> GraphNodeRef<'a>
impl<'a> GraphNodeRef<'a>
Sourcepub fn source<S: SourceLoop + 'static>(source: S) -> Self
pub fn source<S: SourceLoop + 'static>(source: S) -> Self
Box an owned source (add_source).
Sourcepub fn element<E: AsyncElement + 'static>(element: E) -> Self
pub fn element<E: AsyncElement + 'static>(element: E) -> Self
Box an owned transform or sink (add_transform / add_sink).
Sourcepub fn muxer<M: MultiInputElement + 'static>(muxer: M) -> Self
pub fn muxer<M: MultiInputElement + 'static>(muxer: M) -> Self
Box an owned fan-in muxer (add_muxer).
Sourcepub fn fanout_source<S: MultiOutputSource + 'static>(source: S) -> Self
pub fn fanout_source<S: MultiOutputSource + 'static>(source: S) -> Self
Box an owned terminal fan-out source (add_fanout_src).
Sourcepub fn source_ref(source: &'a mut (dyn DynSourceLoop + 'a)) -> Self
pub fn source_ref(source: &'a mut (dyn DynSourceLoop + 'a)) -> Self
Box a borrowed source, for a borrowing graph (the convenience wrappers).
Sourcepub fn element_ref(element: &'a mut (dyn DynAsyncElement + 'a)) -> Self
pub fn element_ref(element: &'a mut (dyn DynAsyncElement + 'a)) -> Self
Box a borrowed transform or sink.
Sourcepub fn muxer_ref(muxer: &'a mut (dyn DynMultiInputElement + 'a)) -> Self
pub fn muxer_ref(muxer: &'a mut (dyn DynMultiInputElement + 'a)) -> Self
Box a borrowed fan-in muxer.
Sourcepub fn fanout_source_ref(
source: &'a mut (dyn DynMultiOutputSource + 'a),
) -> Self
pub fn fanout_source_ref( source: &'a mut (dyn DynMultiOutputSource + 'a), ) -> Self
Box a borrowed terminal fan-out source.
Sourcepub fn demux<D: MultiOutputElement + 'static>(demux: D) -> Self
pub fn demux<D: MultiOutputElement + 'static>(demux: D) -> Self
Box an owned fan-out demultiplexer (add_demux).
Sourcepub fn demux_ref(demux: &'a mut (dyn DynMultiOutputElement + 'a)) -> Self
pub fn demux_ref(demux: &'a mut (dyn DynMultiOutputElement + 'a)) -> Self
Box a borrowed fan-out demultiplexer.
Sourcepub fn log_category(&self) -> &'static str
pub fn log_category(&self) -> &'static str
The element’s log category (M179), its short type name, e.g.
videotestsrc. The runner uses it to derive instance names
(<category>N); a DOT dump uses it as the node label before the run
assigns the suffixed name. Fan-in / fan-out elements don’t expose a
category on their dyn trait (the runner doesn’t name them either), so
they report their structural role.
Sourcepub fn output_memory(&self) -> MemoryDomainKind
pub fn output_memory(&self) -> MemoryDomainKind
The memory domain of the frames this node emits on its output pad(s)
(M285): the source’s / element’s output_memory, surfaced per edge for
the DOT dump so a GPU / zero-copy link is marked. Fan-in / fan-out
elements are reported as System (their domain is the upstream’s; the
per-edge derivation does not propagate through them yet).
Sourcepub fn output_domains(&self) -> DomainSet
pub fn output_domains(&self) -> DomainSet
The full set of memory domains this node can emit (M351), the
producer-capability half of the two-sided allocation-domain negotiation.
A source’s / element’s output_domains; fan-in / fan-out nodes report a
System singleton (their domain follows the upstream, like
output_memory).
Sourcepub fn properties(&self) -> &'static [PropertySpec]
pub fn properties(&self) -> &'static [PropertySpec]
The runtime properties this node’s element declares, whatever its shape.
The animated-property check (M882) reads it to validate a
ControlProgram against the element it targets.
Sourcepub fn input_domains(&self) -> DomainSet
pub fn input_domains(&self) -> DomainSet
The memory domains this node accepts on its input pad(s) (M354), for the
converter auto-plug and the allocation cascade. A muxer declares one set
covering every input pad; a terminal fan-out source has no input, so it
reports DomainSet::ALL (no requirement), as does a source.