Struct gstreamer::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>
impl<T: IsA<GhostPad> + IsA<Pad>> PadBuilder<T>
pub fn proxy_pad_activate_function<F>(self, func: F) -> Self
pub fn proxy_pad_activatemode_function<F>(self, func: F) -> Self
pub fn proxy_pad_chain_function<F>(self, func: F) -> Self
pub fn proxy_pad_chain_list_function<F>(self, func: F) -> Selfwhere
F: Fn(&ProxyPad, Option<&Object>, BufferList) -> Result<FlowSuccess, FlowError> + Send + Sync + 'static,
pub fn proxy_pad_event_function<F>(self, func: F) -> Self
pub fn proxy_pad_event_full_function<F>(self, func: F) -> Self
pub fn proxy_pad_getrange_function<F>(self, func: F) -> Self
pub fn proxy_pad_iterate_internal_links_function<F>(self, func: F) -> Self
pub fn proxy_pad_link_function<F>(self, func: F) -> Selfwhere
F: Fn(&ProxyPad, Option<&Object>, &Pad) -> Result<PadLinkSuccess, PadLinkError> + Send + Sync + 'static,
pub fn proxy_pad_query_function<F>(self, func: F) -> Self
pub fn proxy_pad_unlink_function<F>(self, func: F) -> Self
pub fn proxy_pad_flags(self, flags: PadFlags) -> Self
sourcepub fn with_target<P: IsA<Pad> + IsA<Object>>(
self,
target: &P,
) -> Result<Self, BoolError>
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>
impl<T: IsA<Pad> + IsA<Object> + IsClass> PadBuilder<T>
sourcepub fn new(direction: PadDirection) -> Self
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.
sourcepub fn from_static_template(templ: &StaticPadTemplate) -> Self
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.
sourcepub fn from_template(templ: &PadTemplate) -> Self
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.
sourcepub fn maybe_name<N: IntoGStr>(self, name: Option<N>) -> Self
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.
pub fn activate_function<F>(self, func: F) -> Self
pub fn activatemode_function<F>(self, func: F) -> Self
pub fn chain_function<F>(self, func: F) -> Self
pub fn chain_list_function<F>(self, func: F) -> Selfwhere
F: Fn(&T, Option<&Object>, BufferList) -> Result<FlowSuccess, FlowError> + Send + Sync + 'static,
pub fn event_function<F>(self, func: F) -> Self
pub fn event_full_function<F>(self, func: F) -> Self
pub fn getrange_function<F>(self, func: F) -> Self
pub fn iterate_internal_links_function<F>(self, func: F) -> Self
pub fn link_function<F>(self, func: F) -> Selfwhere
F: Fn(&T, Option<&Object>, &Pad) -> Result<PadLinkSuccess, PadLinkError> + Send + Sync + 'static,
pub fn query_function<F>(self, func: F) -> Self
pub fn unlink_function<F>(self, func: F) -> Self
pub fn flags(self, flags: PadFlags) -> Self
sourcepub fn build(self) -> T
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 GhostPad
s,
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> 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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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