[]Struct gstreamer::Pad

pub struct Pad(_, _);

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 Pad::new_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 Pad::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::get_static_pad, the pads can be linked with Pad::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::get_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.

Pad::query and Pad::peer_query can be used to query various properties of the pad and the stream.

To send a Event on a pad, use Pad::send_event and Pad::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::get_sticky_event and Pad::sticky_events_foreach. PadExt::get_current_caps and PadExt::has_current_caps are convenience functions to query the current sticky CAPS event on a pad.

GstElements will use Pad::push and Pad::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 Pad::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. Pad::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::get_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 Pad::start_task, PadExt::pause_task and PadExt::stop_task respectively.

Implements

PadExt, GstObjectExt, glib::object::ObjectExt

Methods

impl Pad[src]

pub fn new(name: Option<&str>, direction: PadDirection) -> Pad[src]

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 new_from_template(templ: &PadTemplate, name: Option<&str>) -> Pad[src]

Creates a new pad with the given name from the given template. 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.

templ

the pad template to use

name

the name of the pad

Returns

a new Pad.

impl Pad[src]

pub fn new_from_static_template(
    templ: &StaticPadTemplate,
    name: Option<&str>
) -> Pad
[src]

Creates a new pad with the given name from the given static template. 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.

templ

the StaticPadTemplate to use

name

the name of the pad

Returns

a new Pad.

Trait Implementations

impl Clone for Pad

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for Pad

impl Ord for Pad

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Sync for Pad[src]

impl Send for Pad[src]

impl<T: ObjectType> PartialEq<T> for Pad

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<T: ObjectType> PartialOrd<T> for Pad

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Debug for Pad

impl Hash for Pad

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl IsA<Pad> for GhostPad

impl IsA<Object> for Pad

impl IsA<Pad> for ProxyPad

impl StaticType for Pad

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

fn upcast<T>(self) -> T where
    Self: IsA<T>,
    T: ObjectType
[src]

Upcasts an object to a superclass or interface T. Read more

fn upcast_ref<T>(&self) -> &T where
    Self: IsA<T>,
    T: ObjectType
[src]

Upcasts an object to a reference of its superclass or interface T. Read more

fn downcast<T>(self) -> Result<T, Self> where
    Self: CanDowncast<T>,
    T: ObjectType
[src]

Tries to downcast to a subclass or interface implementor T. Read more

fn downcast_ref<T>(&self) -> Option<&T> where
    Self: CanDowncast<T>,
    T: ObjectType
[src]

Tries to downcast to a reference of its subclass or interface implementor T. Read more

fn dynamic_cast<T>(self) -> Result<T, Self> where
    T: ObjectType
[src]

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

fn dynamic_cast_ref<T>(&self) -> Option<&T> where
    T: ObjectType
[src]

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

unsafe fn unsafe_cast<T>(self) -> T where
    T: ObjectType
[src]

Casts to T unconditionally. Read more

unsafe fn unsafe_cast_ref<T>(&self) -> &T where
    T: ObjectType
[src]

Casts to &T unconditionally. Read more

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized
[src]