Trait gstreamer::prelude::BinExt[][src]

pub trait BinExt {
    fn add<P: IsA<Element>>(&self, element: &P) -> Result<(), BoolError>;
fn find_unlinked_pad(&self, direction: PadDirection) -> Option<Pad>;
fn get_by_interface(&self, iface: Type) -> Option<Element>;
fn get_by_name(&self, name: &str) -> Option<Element>;
fn get_by_name_recurse_up(&self, name: &str) -> Option<Element>;
fn get_suppressed_flags(&self) -> ElementFlags;
fn recalculate_latency(&self) -> Result<(), BoolError>;
fn remove<P: IsA<Element>>(&self, element: &P) -> Result<(), BoolError>;
fn set_suppressed_flags(&self, flags: ElementFlags);
fn sync_children_states(&self) -> Result<(), BoolError>;
fn get_property_async_handling(&self) -> bool;
fn set_property_async_handling(&self, async_handling: bool);
fn get_property_message_forward(&self) -> bool;
fn set_property_message_forward(&self, message_forward: bool);
fn connect_deep_element_added<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_do_latency<F: Fn(&Self) -> bool + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_element_added<F: Fn(&Self, &Element) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_element_removed<F: Fn(&Self, &Element) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_async_handling_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_message_forward_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all Bin methods.

Implementors

Bin, Pipeline

Required Methods

Adds the given element to the bin. Sets the element's parent, and thus takes ownership of the element. An element can only be added to one bin.

If the element's pads are linked to other pads, the pads will be unlinked before the element is added to the bin.

When you add an element to an already-running pipeline, you will have to take care to set the state of the newly-added element to the desired state (usually PLAYING or PAUSED, same you set the pipeline to originally) with ElementExt::set_state, or use ElementExt::sync_state_with_parent. The bin or pipeline will not take care of this for you.

MT safe.

element

the Element to add

Returns

true if the element could be added, false if the bin does not want to accept the element.

Recursively looks for elements with an unlinked pad of the given direction within the specified bin and returns an unlinked pad if one is found, or None otherwise. If a pad is found, the caller owns a reference to it and should use GstObjectExt::unref on the pad when it is not needed any longer.

direction

whether to look for an unlinked source or sink pad

Returns

unlinked pad of the given direction, None.

Looks for an element inside the bin that implements the given interface. If such an element is found, it returns the element. You can cast this element to the given interface afterwards. If you want all elements that implement the interface, use BinExt::iterate_all_by_interface. This function recurses into child bins.

MT safe. Caller owns returned reference.

iface

the glib::Type of an interface

Returns

A Element inside the bin implementing the interface

Gets the element with the given name from a bin. This function recurses into child bins.

Returns None if no element with the given name is found in the bin.

MT safe. Caller owns returned reference.

name

the element name to search for

Returns

the Element with the given name, or None

Gets the element with the given name from this bin. If the element is not found, a recursion is performed on the parent bin.

Returns None if:

  • no element with the given name is found in the bin

MT safe. Caller owns returned reference.

name

the element name to search for

Returns

the Element with the given name, or None

Return the suppressed flags of the bin.

MT safe.

Feature: v1_10

Returns

the bin's suppressed ElementFlags.

Query self for the current latency using and reconfigures this latency to all the elements with a LATENCY event.

This method is typically called on the pipeline when a MessageType::Latency is posted on the bus.

This function simply emits the 'do-latency' signal so any custom latency calculations will be performed.

Returns

true if the latency could be queried and reconfigured.

Removes the element from the bin, unparenting it as well. Unparenting the element means that the element will be dereferenced, so if the bin holds the only reference to the element, the element will be freed in the process of removing it from the bin. If you want the element to still exist after removing, you need to call GstObjectExt::ref before removing it from the bin.

If the element's pads are linked to other pads, the pads will be unlinked before the element is removed from the bin.

MT safe.

element

the Element to remove

Returns

true if the element could be removed, false if the bin does not want to remove the element.

Suppress the given flags on the bin. ElementFlags of a child element are propagated when it is added to the bin. When suppressed flags are set, those specified flags will not be propagated to the bin.

MT safe.

Feature: v1_10

flags

the ElementFlags to suppress

Synchronizes the state of every child of self with the state of self. See also ElementExt::sync_state_with_parent.

Returns

true if syncing the state was successful for all children, otherwise false.

Will be emitted after the element was added to sub_bin.

Feature: v1_10

sub_bin

the Bin the element was added to

element

the Element that was added to sub_bin

Will be emitted after the element was removed from sub_bin.

Feature: v1_10

sub_bin

the Bin the element was removed from

element

the Element that was removed from sub_bin

Will be emitted when the bin needs to perform latency calculations. This signal is only emitted for toplevel bins or when async-handling is enabled.

Only one signal handler is invoked. If no signals are connected, the default handler is invoked, which will query and distribute the lowest possible latency to all sinks.

Connect to this signal if the default latency calculations are not sufficient, like when you need different latencies for different sinks in the same pipeline.

Will be emitted after the element was added to the bin.

element

the Element that was added to the bin

Will be emitted after the element was removed from the bin.

element

the Element that was removed from the bin

Implementors