Bin
Object Hierarchy:
Description:
Subclasses can override the add_element and remove_element to update the list of children in the bin. The
handle_message method can be overridden to implement custom message handling. handle_message takes ownership of
the message, just like post_message.
Namespace: Gst
Package: gstreamer-0.10
Content:
Properties:
-
public bool async_handling { set; get; }
If set to true, the bin will handle asynchronous state changes. This should be used only
if the bin subclass is modifying the state of its children on its own.
-
public bool message_forward { set; get; }
Forward all children messages, even those that would normally be filtered by the bin. This can be
interesting when one wants to be notified of the EOS state of individual elements, for example. The messages are converted to an
ELEMENT message with the bin as the source. The structure of the message is named 'GstBinForwarded' and contains a field named
'message' of type GST_TYPE_MESSAGE that contains the original forwarded message.
Creation methods:
Methods:
-
public bool add (owned Element element)
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.
-
public virtual bool add_element (Element element)
-
public void add_many (owned Element[] elements)
Adds a NULL-terminated list of elements to a bin. This function is equivalent to calling
add for each member of the list. The return value of each
add is ignored.
-
public Pad? find_unconnected_pad (PadDirection direction)
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 NULL otherwise. If a pad is found, the caller owns a reference to it and should use
unref on the pad when it is not needed any longer.
-
public Pad? find_unlinked_pad (PadDirection direction)
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 NULL otherwise. If a pad is found, the caller owns a reference to it and should use
unref on the pad when it is not needed any longer.
-
public Element? get_by_interface (Type iface)
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 iterate_all_by_interface. This function recurses
into child bins. MT safe. Caller owns returned reference.
-
public Element? get_by_name (string name)
Gets the element with the given name from a bin. This function recurses into child bins. Returns NULL
if no element with the given name is found in the bin. MT safe. Caller owns returned reference.
-
public Element? get_by_name_recurse_up (string name)
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 NULL if: - no element with the given name is found in the bin MT safe. Caller owns returned
reference.
-
public virtual void handle_message (Message message)
-
public Iterator<Element> iterate_all_by_interface (Type iface)
Looks for all elements inside the bin that implements the given interface. You can safely cast all
returned elements to the given interface. The function recurses inside child bins. The iterator will yield a series of
Element that should be unreffed after use. Each element yielded by the
iterator will have its refcount increased, so unref after use. MT safe. Caller owns returned value. in the bin implementing the
given interface, or NULL
-
public Iterator<Element> iterate_elements ()
Gets an iterator for the elements in this bin. Each element yielded by the iterator will have its
refcount increased, so unref after use. MT safe. Caller owns returned value.
-
public Iterator<Element> iterate_recurse ()
Gets an iterator for the elements in this bin. This iterator recurses into GstBin children. Each
element yielded by the iterator will have its refcount increased, so unref after use. MT safe. Caller owns returned value.
-
public Iterator<Element> iterate_sinks ()
Gets an iterator for all elements in the bin that have the
IS_SINK flag set. Each element yielded by the iterator will have its
refcount increased, so unref after use. MT safe. Caller owns returned value.
-
public Iterator<Element> iterate_sorted ()
Gets an iterator for the elements in this bin in topologically sorted order. This means that the
elements are returned from the most downstream elements (sinks) to the sources. This function is used internally to perform the
state changes of the bin elements and for clock selection. Each element yielded by the iterator will have its refcount increased, so
unref after use. MT safe. Caller owns returned value.
-
public Iterator<Element> iterate_sources ()
Gets an iterator for all elements in the bin that have the
IS_SOURCE flag set. Each element yielded by the iterator will have
its refcount increased, so unref after use. MT safe. Caller owns returned value.
-
public bool recalculate_latency ()
Query bin 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
LATENCY is posted on the bus. This function simply emits the
'do-latency' signal so any custom latency calculations will be performed.
-
public bool remove (Element element)
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
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. the bin does not want to remove the element.
-
public virtual bool remove_element (Element element)
-
public void remove_many (Element[] elements)
Remove a list of elements from a bin. This function is equivalent to calling
remove with each member of the list.
Signals:
-
public virtual bool do_latency ()
Will be emitted when the bin needs to perform latency calculations. This signal is only emited 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.
-
public virtual void element_added (Element child)
Will be emitted after the element was added to the bin.
-
public virtual void element_removed (Element child)
Will be emitted after the element was removed from the bin.
Fields: