Skip to main content

Module element

Module element 

Source

Structs§

Context
Everything a crate::pipeline::ChainBuilder/crate::elements::Tee needs to wire itself into a crate::pipeline::Pipeline — bundled into one Arc instead of threading bus/pipeline_id/graph/the wall and playback clocks through separately. Built once per source by crate::pipeline::PipelineBuilder::add_source (what crate::pipeline::Pipeline::new itself calls, for its own single-source case) and handed to that source’s own wire closure; a crate::elements::Tee keeps its own clone while it is alive, and its crate::elements::TeeHandle accesses that clone weakly so retaining the handle cannot keep the pipeline’s Bus open after the Tee itself is gone.

Enums§

ElementType
Which kind of element posted a crate::bus::BusEvent — cheap to compare/match, unlike the accompanying name: Arc<str> (an instance-level identifier chosen by whoever constructed it, needed alongside this to tell apart e.g. two Queues in the same pipeline; see Element::element_type).

Traits§

Element
A node in the pipeline graph with a name. Plain identity only — says nothing about whether the node has an input, an output, both, or neither.
Filter
An element with both an input and an output — decoder, encoder, filter, thumbnail extractor, … Just a name for “has a Sink to receive and a Source to push what it produces into”; nothing new to implement beyond those two.
Sink
Anything that can receive a buffer pushed from upstream — the input side of an element, or a plain terminal sink. Every Sink is named (via Element) so bus events (e.g. EOS) can identify which one they came from.
Source
An element with one or more output ports. It sends data downstream by pushing into its own src_pads() (e.g. self.src_pads()[0].push(buf)) — it’s never handed a downstream argument from the outside. See SrcPad.
SourceElement
A pure source: has output but no input. Its run method drives the production loop and pushes buffers into its own src pad(s) until EOS or an error. crate::pipeline::Pipeline::run normally invokes that loop on the pipeline’s background source thread; a caller may also invoke a concrete implementation directly. Sources typically wrap blocking I/O reads (demuxer, file/network source).

Functions§

element_pp_log
Builds the PpLog every element constructs for its own Element::pp_log field, and that crate::pipeline::ChainBuilder/crate::pipeline::Pipeline rebuild once they know which pipeline an element belongs to. Keeps the element type, instance name, and pipeline id as separate fields, so a log reader does not need to parse a combined display string. The pipeline id is None for an element that isn’t wired into a Pipeline at all (e.g. most of this crate’s own tests). Public so a custom Element implemented outside this crate (see ElementType::Other) can build its own pp_log field the same way.