Struct gstreamer::pad::PadBuilder

source ·
pub struct PadBuilder<T> {
    pub(crate) pad: T,
    pub(crate) needs_specific_name: bool,
}

Fields§

§pad: T§needs_specific_name: bool

Implementations§

source§

impl<T: IsA<GhostPad> + IsA<Pad>> PadBuilder<T>

source

pub fn proxy_pad_activate_function<F>(self, func: F) -> Self
where F: Fn(&ProxyPad, Option<&Object>) -> Result<(), LoggableError> + Send + Sync + 'static,

source

pub fn proxy_pad_activatemode_function<F>(self, func: F) -> Self
where F: Fn(&ProxyPad, Option<&Object>, PadMode, bool) -> Result<(), LoggableError> + Send + Sync + 'static,

source

pub fn proxy_pad_chain_function<F>(self, func: F) -> Self
where F: Fn(&ProxyPad, Option<&Object>, Buffer) -> Result<FlowSuccess, FlowError> + Send + Sync + 'static,

source

pub fn proxy_pad_chain_list_function<F>(self, func: F) -> Self
where F: Fn(&ProxyPad, Option<&Object>, BufferList) -> Result<FlowSuccess, FlowError> + Send + Sync + 'static,

source

pub fn proxy_pad_event_function<F>(self, func: F) -> Self
where F: Fn(&ProxyPad, Option<&Object>, Event) -> bool + Send + Sync + 'static,

source

pub fn proxy_pad_event_full_function<F>(self, func: F) -> Self
where F: Fn(&ProxyPad, Option<&Object>, Event) -> Result<FlowSuccess, FlowError> + Send + Sync + 'static,

source

pub fn proxy_pad_getrange_function<F>(self, func: F) -> Self

source

pub fn proxy_pad_query_function<F>(self, func: F) -> Self
where F: Fn(&ProxyPad, Option<&Object>, &mut QueryRef) -> bool + Send + Sync + 'static,

source

pub fn proxy_pad_flags(self, flags: PadFlags) -> Self

source

pub fn with_target<P: IsA<Pad> + IsA<Object>>( self, target: &P, ) -> Result<Self, BoolError>

Specifies a target Pad for the GhostPad.

If the PadBuilder was created from a PadTemplate and the PadTemplate has a specific name_template, i.e. if it’s not a wildcard-name containing %u, %s or %d, the GhostPad will automatically be named after the name_template.

If the name_template is a wildcard-name, then the target name is used, if it is compatible. Otherwise, a specific name must be provided using PadBuilder::name or PadBuilder::maybe_name.

source§

impl<T: IsA<Pad> + IsA<Object> + IsClass> PadBuilder<T>

source

pub fn new(direction: PadDirection) -> Self

Creates a PadBuilder with the specified PadDirection.

An automatically generated name will be assigned. Use PadBuilder::name or PadBuilder::maybe_name to define a specific name.

source

pub fn from_static_template(templ: &StaticPadTemplate) -> Self

Creates a PadBuilder from the specified StaticPadTemplate.

If the StaticPadTemplate has a specific name_template, i.e. if it’s not a wildcard-name containing %u, %s or %d, the Pad will automatically be named after the name_template.

Use PadBuilder::name or PadBuilder::maybe_name to specify a different name.

source

pub fn from_template(templ: &PadTemplate) -> Self

Creates a PadBuilder from the specified PadTemplate.

If the PadTemplate has a specific name_template, i.e. if it’s not a wildcard-name containing %u, %s or %d, the Pad will automatically be named after the name_template.

Use PadBuilder::name or PadBuilder::maybe_name to specify a different name.

source

pub fn name(self, name: impl IntoGStr) -> Self

Sets the name of the Pad.

source

pub fn maybe_name<N: IntoGStr>(self, name: Option<N>) -> Self

Optionally sets the name of the Pad.

This method is convenient when the name is provided as an Option. If the name is None, this has no effect.

source

pub fn activate_function<F>(self, func: F) -> Self
where F: Fn(&T, Option<&Object>) -> Result<(), LoggableError> + Send + Sync + 'static,

source

pub fn activatemode_function<F>(self, func: F) -> Self
where F: Fn(&T, Option<&Object>, PadMode, bool) -> Result<(), LoggableError> + Send + Sync + 'static,

source

pub fn chain_function<F>(self, func: F) -> Self
where F: Fn(&T, Option<&Object>, Buffer) -> Result<FlowSuccess, FlowError> + Send + Sync + 'static,

source

pub fn chain_list_function<F>(self, func: F) -> Self
where F: Fn(&T, Option<&Object>, BufferList) -> Result<FlowSuccess, FlowError> + Send + Sync + 'static,

source

pub fn event_function<F>(self, func: F) -> Self
where F: Fn(&T, Option<&Object>, Event) -> bool + Send + Sync + 'static,

source

pub fn event_full_function<F>(self, func: F) -> Self
where F: Fn(&T, Option<&Object>, Event) -> Result<FlowSuccess, FlowError> + Send + Sync + 'static,

source

pub fn getrange_function<F>(self, func: F) -> Self
where F: Fn(&T, Option<&Object>, u64, Option<&mut BufferRef>, u32) -> Result<PadGetRangeSuccess, FlowError> + Send + Sync + 'static,

source

pub fn query_function<F>(self, func: F) -> Self
where F: Fn(&T, Option<&Object>, &mut QueryRef) -> bool + Send + Sync + 'static,

source

pub fn flags(self, flags: PadFlags) -> Self

source

pub fn build(self) -> T

Builds the Pad.

§Panics

Panics if the Pad was built from a PadTemplate with a wildcard-name name_template (i.e. containing %u, %s or %d) and no specific name was provided using PadBuilder::name or PadBuilder::maybe_name, or for GhostPads, by defining a target.

Auto Trait Implementations§

§

impl<T> Freeze for PadBuilder<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for PadBuilder<T>
where T: RefUnwindSafe,

§

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

§

impl<T> Sync for PadBuilder<T>
where T: Sync,

§

impl<T> Unpin for PadBuilder<T>
where T: Unpin,

§

impl<T> UnwindSafe for PadBuilder<T>
where T: UnwindSafe,

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> 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

source§

type Error = Infallible

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.