Struct gstreamer::Pad [−][src]
pub struct Pad(_);
Expand description
A Element
is linked to other elements via “pads”, which are extremely
light-weight generic link points.
Pads have a PadDirection
, source pads produce data, sink pads consume
data.
Pads are typically created from a PadTemplate
with
from_template()
and are then added to a Element
. This usually
happens when the element is created but it can also happen dynamically based
on the data that the element is processing or based on the pads that the
application requests.
Pads without pad templates can be created with new()
,
which takes a direction and a name as an argument. If the name is None
,
then a guaranteed unique name will be assigned to it.
A Element
creating a pad will typically use the various
gst_pad_set_*_function() calls to register callbacks for events, queries or
dataflow on the pads.
gst_pad_get_parent()
will retrieve the Element
that owns the pad.
After two pads are retrieved from an element by ElementExt::static_pad()
,
the pads can be linked with PadExt::link()
. (For quick links,
you can also use ElementExt::link()
, which will make the obvious
link for you if it’s straightforward.). Pads can be unlinked again with
PadExt::unlink()
. PadExt::peer()
can be used to check what the pad is
linked to.
Before dataflow is possible on the pads, they need to be activated with
PadExt::set_active()
.
PadExtManual::query()
and PadExtManual::peer_query()
can be used to query various
properties of the pad and the stream.
To send a Event
on a pad, use PadExtManual::send_event()
and
PadExtManual::push_event()
. Some events will be sticky on the pad, meaning that
after they pass on the pad they can be queried later with
PadExt::sticky_event()
and PadExtManual::sticky_events_foreach()
.
PadExt::current_caps()
and PadExt::has_current_caps()
are convenience
functions to query the current sticky CAPS event on a pad.
GstElements will use PadExtManual::push()
and PadExtManual::pull_range()
to push out
or pull in a buffer.
The dataflow, events and queries that happen on a pad can be monitored with
probes that can be installed with PadExtManual::add_probe()
. PadExt::is_blocked()
can be used to check if a block probe is installed on the pad.
PadExt::is_blocking()
checks if the blocking probe is currently blocking the
pad. PadExtManual::remove_probe()
is used to remove a previously installed probe
and unblock blocking probes if any.
Pad have an offset that can be retrieved with PadExt::offset()
. This
offset will be applied to the running_time of all data passing over the pad.
PadExt::set_offset()
can be used to change the offset.
Convenience functions exist to start, pause and stop the task on a pad with
PadExtManual::start_task()
, PadExt::pause_task()
and PadExt::stop_task()
respectively.
Implements
Implementations
Creates a new pad with the given name in the given direction.
If name is None
, a guaranteed unique name (across all pads)
will be assigned.
This function makes a copy of the name so you can safely free the name.
name
the name of the new pad.
direction
the PadDirection
of the pad.
Returns
a new Pad
.
MT safe.
pub fn builder_with_static_template(
templ: &StaticPadTemplate,
name: Option<&str>
) -> PadBuilder<Self>
[src]Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
Upcasts an object to a superclass or interface T
. Read more
Upcasts an object to a reference of its superclass or interface T
. Read more
Tries to downcast to a subclass or interface implementor T
. Read more
Tries to downcast to a reference of its subclass or interface implementor T
. Read more
Tries to cast to an object of type T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read more
Tries to cast to reference to an object of type T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read more
Casts to T
unconditionally. Read more
Casts to &T
unconditionally. Read more
Returns true
if the object is an instance of (can be cast to) T
.
pub fn set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
[src]pub fn set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
[src]pub fn set_property<'a, N, V>(
&self,
property_name: N,
value: V
) -> Result<(), BoolError> where
V: ToValue,
N: Into<&'a str>,
[src]pub fn set_property_from_value<'a, N>(
&self,
property_name: N,
value: &Value
) -> Result<(), BoolError> where
N: Into<&'a str>,
[src]pub fn property<'a, N>(&self, property_name: N) -> Result<Value, BoolError> where
N: Into<&'a str>,
[src]Safety Read more
Safety Read more
Safety Read more
Safety Read more
pub fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
[src]pub fn connect_notify_local<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec),
[src]pub unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
[src]pub fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>,
[src]pub fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>,
[src]pub fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
[src]Same as connect
but takes a SignalId
instead of a signal name.
pub fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
[src]Same as connect_local
but takes a SignalId
instead of a signal name.
pub unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
[src]Same as connect_unsafe
but takes a SignalId
instead of a signal name.
Emit signal by signal id.
Emit signal with details by signal id.
Emit signal by it’s name.
pub fn bind_property<'a, O, N, M>(
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
N: Into<&'a str>,
M: Into<&'a str>,
[src]Same as emit
but takes Value
for the arguments.
Same as emit_by_name
but takes Value
for the arguments.
Returns a SendValue
clone of self
.
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,
[src]