Skip to main content

LaunchFactory

Struct LaunchFactory 

Source
pub struct LaunchFactory { /* private fields */ }
Expand description

A named element factory for the gst-launch text parser and the gst-inspect dump (M105): a parameterless constructor plus the element’s pad templates. Unlike ElementFactory (the autoplug factory, built from the chosen output caps), this default-constructs the element so the parser can then apply key=value properties to it, the gst_element_factory_make + g_object_set model.

Implementations§

Source§

impl LaunchFactory

Source

pub fn new( name: &'static str, templates: Vec<PadTemplate>, build: fn() -> Box<dyn DynAsyncElement>, ) -> Self

Register a transform / sink by name, pad templates, and a parameterless constructor (|| Box::new(MyElement::new())).

Source

pub fn of<E: PadTemplates>( name: &'static str, build: fn() -> Box<dyn DynAsyncElement>, ) -> Self

Build from a PadTemplates type, pulling its templates from the trait so the registration site names only the type and constructor.

Source

pub fn with_usable(self, usable: fn() -> bool) -> Self

Declare a check for whether this element can run on this machine right now, beyond having been compiled in: a display sink asking whether there is a display to present on, say.

Only register_alias consults it, so an autovideosink falls through a sink with nothing to draw on while a pipeline naming that sink outright still fails and says why.

Source

pub fn with_experimental(self) -> Self

Mark this element experimental: its runtime path is host- or device-validated, not a CI promise. g2g-inspect prints it.

Source

pub fn experimental(&self) -> bool

Whether this factory declared [with_experimental].

Source

pub fn name(&self) -> &'static str

This factory’s element name.

Source

pub fn usable(&self) -> bool

Whether this element can run here, per the check it declared. true when it declared none.

Trait Implementations§

Source§

impl Debug for LaunchFactory

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ElementBound for T
where T: Send,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.