pub struct CapabilityDescriptor {
pub output_memory: MemoryDomainKind,
pub acceleration: Acceleration,
pub rank: i16,
}Expand description
What an element offers the auto-plug search beyond its pad templates: the signals used to choose among several elements that satisfy the same caps.
This generalizes a bare output-memory tag, the principled alternative to a
flat global rank. A single integer cannot express that the best element is
context-dependent (a hardware decoder that keeps frames on the GPU beats a
faster one that forces a PCIe download when the consumer is GPU-resident), so
score ranks a candidate against a SelectionContext; the
numeric rank is only the deterministic tiebreaker among
otherwise-equal candidates (the explicit-override knob GStreamer’s rank gets
right). All-default descriptors score equally, so registration order decides,
leaving a plain pipeline’s selection unchanged.
Fields§
§output_memory: MemoryDomainKindThe memory feature the source pad emits (a decodebin caps feature,
GStreamer’s memory:CUDAMemory analog). Caps geometry / format is in the
pad templates; the memory domain is not, so it rides here. Matching the
consumer’s domain avoids a copy / download (e.g. pick NvDec -> Cuda).
acceleration: AccelerationHardware vs software path.
rank: i16Deterministic tiebreaker among candidates of equal score (higher wins); default 0. Use it to order otherwise-equivalent backends (e.g. two ffmpeg codecs), or as an operator override, not as the primary selector.
Implementations§
Source§impl CapabilityDescriptor
impl CapabilityDescriptor
Sourcepub fn score(&self, ctx: &SelectionContext) -> i32
pub fn score(&self, ctx: &SelectionContext) -> i32
Score this candidate against what the search wants; higher is tried first.
Memory-domain match dominates (it removes a download, the structural win),
then a hardware preference, then the explicit rank.
Trait Implementations§
Source§impl Clone for CapabilityDescriptor
impl Clone for CapabilityDescriptor
Source§fn clone(&self) -> CapabilityDescriptor
fn clone(&self) -> CapabilityDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more