pub struct PyAggregator { /* private fields */ }Expand description
A gst-python-ml batched element hosted as a first-class g2g aggregator.
Implementations§
Source§impl PyAggregator
impl PyAggregator
Sourcepub fn new(
module: impl Into<String>,
class: impl Into<String>,
inputs: usize,
) -> Self
pub fn new( module: impl Into<String>, class: impl Into<String>, inputs: usize, ) -> Self
Host class from Python module as an inputs-way batching aggregator.
Sourcepub fn with_accept(self, caps: Caps) -> Self
pub fn with_accept(self, caps: Caps) -> Self
Override the accepted input caps.
Sourcepub fn with_produce(self, caps: Caps) -> Self
pub fn with_produce(self, caps: Caps) -> Self
Emit caps downstream instead of the negotiated input caps, for a hosted
element that changes media type.
Sourcepub fn with_draw_label(self, on: bool) -> Self
pub fn with_draw_label(self, on: bool) -> Self
Set the draw-label flag forwarded to the Python element.
Sourcepub fn with_cuda_frames(self, on: bool) -> Self
pub fn with_cuda_frames(self, on: bool) -> Self
Batch GPU-resident CUDA frames: they reach the hosted element as
__cuda_array_interface__ planes through g2g_process_cuda_batch, and the
anchor flows on still device-resident. Also drives what this element asks
each input branch to allocate
(see MultiInputElement::propose_allocation_for_input).
Sourcepub fn emitted_count(&self) -> u64
pub fn emitted_count(&self) -> u64
Count of frames emitted downstream, which is one per batch unless the hosted element emits several buffers from one. Useful in tests.
Trait Implementations§
Source§impl Debug for PyAggregator
impl Debug for PyAggregator
Source§impl MultiInputElement for PyAggregator
impl MultiInputElement for PyAggregator
Source§fn propose_allocation_for_input(
&self,
_input: usize,
caps: &Caps,
) -> Option<AllocationParams>
fn propose_allocation_for_input( &self, _input: usize, caps: &Caps, ) -> Option<AllocationParams>
Ask every input’s branch to allocate in the domain the hosted code reads,
so a decoder that can do either keeps its frames device-resident for a
cuda-frames batch (the per-pad form of what PyTransform proposes). Only
the domain and the frame size are constrained: this element allocates
nothing of its own.
type ProcessFuture<'a> = Pin<Box<dyn Future<Output = Result<(), G2gError>> + 'a>> where Self: 'a
fn input_count(&self) -> usize
Source§fn intercept_caps(
&self,
_input: usize,
upstream_caps: &Caps,
) -> Result<Caps, G2gError>
fn intercept_caps( &self, _input: usize, upstream_caps: &Caps, ) -> Result<Caps, G2gError>
Source§fn configure_pipeline(
&mut self,
_input: usize,
absolute_caps: &Caps,
) -> Result<ConfigureOutcome, G2gError>
fn configure_pipeline( &mut self, _input: usize, absolute_caps: &Caps, ) -> Result<ConfigureOutcome, G2gError>
Source§fn output_caps(&self) -> Result<Caps, G2gError>
fn output_caps(&self) -> Result<Caps, G2gError>
Source§fn process<'a>(
&'a mut self,
input: usize,
packet: PipelinePacket,
out: &'a mut dyn OutputSink,
) -> Self::ProcessFuture<'a>
fn process<'a>( &'a mut self, input: usize, packet: PipelinePacket, out: &'a mut dyn OutputSink, ) -> Self::ProcessFuture<'a>
input into the merged output. Read moreSource§fn properties(&self) -> &'static [PropertySpec]
fn properties(&self) -> &'static [PropertySpec]
AsyncElement::properties. Default:
none. A muxer overrides this (with set_property / get_property) to be
settable by name from a gst-launch line, the same as a transform.Source§fn set_property(
&mut self,
name: &str,
value: PropValue,
) -> Result<(), PropError>
fn set_property( &mut self, name: &str, value: PropValue, ) -> Result<(), PropError>
Source§fn get_property(&self, name: &str) -> Option<PropValue>
fn get_property(&self, name: &str) -> Option<PropValue>
None.Source§fn input_pts_ordered(&self) -> bool
fn input_pts_ordered(&self) -> bool
false (arrival-order round-robin,
the historical behavior). When true, the runner merges the per-input
streams by DataFrame PTS, releasing the globally-earliest only once every
still-open input has one queued, so process(pad, DataFrame(..)) arrives in
non-decreasing PTS across all pads. Read moreSource§fn tick_interval_ns(&self) -> Option<u64>
fn tick_interval_ns(&self) -> Option<u64>
None (the default) for no ticks. Read moreSource§fn reverse_channel(&self, _input: usize) -> Option<ReverseChannel>
fn reverse_channel(&self, _input: usize) -> Option<ReverseChannel>
ReverseChannel for input pad input, if this session routes reverse
signals (WebRTC PLI / BWE) back to individual upstream sources. The runner
clones it before running and polls it after each push from that source,
surfacing any pending signal as a PushOutcome. Default None: no
per-input reverse channel (a plain muxer imposes none).Source§fn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
Graph::add_fanin_sink); a merging muxer without a downstream stays a
parse error, since its output would be silently dropped. Default false.Source§fn output_follows_input(&self) -> Option<usize>
fn output_follows_input(&self) -> Option<usize>
Some(pad), the merged output’s caps are the negotiated caps of input
pad pad (an identity-passthrough mux: an overlay / watermark / alpha
mixer that decorates a primary stream with a sidecar one). The solver then
derives the output edge from that input edge instead of from
caps_constraint_for_output, so the
element need not know the output caps up front. Default None: the output
is independent (a container interleave, a fixed-size compositor), declared
by caps_constraint_for_output.Source§fn input_pad_index(&self, req: &PadRequest, ordinal: usize) -> Option<usize>
fn input_pad_index(&self, req: &PadRequest, ordinal: usize) -> Option<usize>
gst-launch line can reference request pads by name
(... ! mux.audio_0, ... ! o.text) instead of relying on the order the
branches are written. The transpose of the demuxer’s output-pad selection
(M476): req.kind is Video / Audio / Text / Any with an ordinal. Read moreSource§fn accepts_runtime_input(&self, _pad: usize, _caps: &Caps) -> bool
fn accepts_runtime_input(&self, _pad: usize, _caps: &Caps) -> bool
DynamicFaninHandle::add_input
is attached to pad, with the caps that source would arrive with. The
runner has already checked pad against the declared
input_count and the pad’s own
caps_constraint_as_input; this is the
element’s veto for what neither expresses: a session with no spare pad of
that media kind, a container that cannot carry a second video track.
Refusing fails that one add (G2gError::InputRefused reaches the
caller), and the run continues on the inputs it already has. Read moreSource§fn caps_constraint_as_input(&self, input: usize) -> CapsConstraint<'_>where
Self: Sized,
fn caps_constraint_as_input(&self, input: usize) -> CapsConstraint<'_>where
Self: Sized,
intercept_caps(input, ...) as a
LegacySink (per-pad legacy bridge). Migrated muxers override
to return native variants (typically AcceptsAny for
per-frame-tagged interleave muxers, or Accepts(set) for
per-input format-restricted muxers). Read moreSource§fn caps_constraint_for_output(&self) -> Result<CapsConstraint<'_>, G2gError>where
Self: Sized,
fn caps_constraint_for_output(&self) -> Result<CapsConstraint<'_>, G2gError>where
Self: Sized,
output_caps() and wraps as
LegacySource. Migrated muxers with static or input-derived
output may override with Produces(set) or DerivedOutput(fn). Read moreSource§fn propose_allocation_for_output(
&self,
_caps: &Caps,
) -> Option<AllocationParams>
fn propose_allocation_for_output( &self, _caps: &Caps, ) -> Option<AllocationParams>
None: a container muxer’s byte output has no
memory-domain tie to its inputs, so it imposes nothing downstream. A muxer
whose output pool is derived from its inputs overrides it (a device-resident
interleave writing into a surface sized by its video pads). Read moreSource§fn configure_allocation_for_output(&mut self, _params: &AllocationParams)
fn configure_allocation_for_output(&mut self, _params: &AllocationParams)
Source§fn input_domains(&self) -> DomainSet
fn input_domains(&self) -> DomainSet
AsyncElement::input_domains.
Default DomainSet::ALL (no requirement). A muxer that reads host
memory narrows it to System, and the allocation cascade turns that into
a download demand on each GPU producer feeding a pad. Per-pad domains are
not expressible: a fan-in whose pads differ declares the union it can take
on any pad and rejects the rest at
configure_pipeline.Source§fn set_instance_name(&mut self, _name: String)
fn set_instance_name(&mut self, _name: String)
AsyncElement::set_instance_name
/ set_log_category. Default:
ignore. A muxer that logs about itself stores them in a
LogName.Source§fn set_log_category(&mut self, _category: String)
fn set_log_category(&mut self, _category: String)
set_instance_name.Source§fn metadata(&self) -> ElementMetadata
fn metadata(&self) -> ElementMetadata
gst-inspect
“Factory Details” (long-name / classification / description / author),
mirroring AsyncElement::metadata.
Default: empty. A muxer overrides it with a const ElementMetadata.Auto Trait Implementations§
impl !RefUnwindSafe for PyAggregator
impl !UnwindSafe for PyAggregator
impl Freeze for PyAggregator
impl Send for PyAggregator
impl Sync for PyAggregator
impl Unpin for PyAggregator
impl UnsafeUnpin for PyAggregator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> DynMultiInputElement for Twhere
T: MultiInputElement,
impl<T> DynMultiInputElement for Twhere
T: MultiInputElement,
fn input_count(&self) -> usize
Source§fn input_pts_ordered(&self) -> bool
fn input_pts_ordered(&self) -> bool
MultiInputElement::input_pts_ordered: whether the
runner delivers inputs in global PTS order rather than arrival order.Source§fn output_follows_input(&self) -> Option<usize>
fn output_follows_input(&self) -> Option<usize>
MultiInputElement::output_follows_input: the input
pad whose caps the merged output follows (identity-passthrough mux), if any.Source§fn tick_interval_ns(&self) -> Option<u64>
fn tick_interval_ns(&self) -> Option<u64>
MultiInputElement::tick_interval_ns: the deadline
tick period this element wants, if any.Source§fn input_pad_index(&self, req: &PadRequest, ordinal: usize) -> Option<usize>
fn input_pad_index(&self, req: &PadRequest, ordinal: usize) -> Option<usize>
MultiInputElement::input_pad_index (M481): map a
named request pad to the concrete input index, for the launch parser.fn caps_constraint_as_input(&self, input: usize) -> CapsConstraint<'_>
fn caps_constraint_for_output(&self) -> Result<CapsConstraint<'_>, G2gError>
Source§fn input_domains(&self) -> DomainSet
fn input_domains(&self) -> DomainSet
MultiInputElement::input_domains. Default
DomainSet::ALL.Source§fn propose_allocation_for_input(
&self,
input: usize,
caps: &Caps,
) -> Option<AllocationParams>
fn propose_allocation_for_input( &self, input: usize, caps: &Caps, ) -> Option<AllocationParams>
MultiInputElement::propose_allocation_for_input.Source§fn propose_allocation_for_output(&self, caps: &Caps) -> Option<AllocationParams>
fn propose_allocation_for_output(&self, caps: &Caps) -> Option<AllocationParams>
MultiInputElement::propose_allocation_for_output.Source§fn configure_allocation_for_output(&mut self, params: &AllocationParams)
fn configure_allocation_for_output(&mut self, params: &AllocationParams)
MultiInputElement::configure_allocation_for_output.Source§fn output_caps(&self) -> Result<Caps, G2gError>
fn output_caps(&self) -> Result<Caps, G2gError>
MultiInputElement::output_caps.fn configure_pipeline( &mut self, input: usize, absolute_caps: &Caps, ) -> Result<ConfigureOutcome, G2gError>
fn process<'a>( &'a mut self, input: usize, packet: PipelinePacket, out: &'a mut dyn OutputSink, ) -> Pin<Box<dyn Future<Output = Result<(), G2gError>> + 'a>>
fn properties(&self) -> &'static [PropertySpec]
fn set_property( &mut self, name: &str, value: PropValue, ) -> Result<(), PropError>
fn get_property(&self, name: &str) -> Option<PropValue>
Source§fn metadata(&self) -> ElementMetadata
fn metadata(&self) -> ElementMetadata
MultiInputElement::metadata, for the gst-inspect
“Factory Details” of an erased fan-in muxer.Source§fn reverse_channel(&self, input: usize) -> Option<ReverseChannel>
fn reverse_channel(&self, input: usize) -> Option<ReverseChannel>
MultiInputElement::reverse_channel, so a terminal
fan-in node’s arm can route a per-input reverse signal (WebRTC PLI / BWE)
back to the upstream feeding that pad. Default None.Source§fn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
MultiInputElement::is_terminal.Source§fn accepts_runtime_input(&self, pad: usize, caps: &Caps) -> bool
fn accepts_runtime_input(&self, pad: usize, caps: &Caps) -> bool
MultiInputElement::accepts_runtime_input: whether
this element takes an input added at runtime on pad with caps.Source§fn set_instance_name(&mut self, name: String)
fn set_instance_name(&mut self, name: String)
MultiInputElement::set_instance_name, so the runner
can name an erased muxer instance for logging.Source§fn set_log_category(&mut self, category: String)
fn set_log_category(&mut self, category: String)
MultiInputElement::set_log_category.