GstBin
Name
GstBin -- Base container element
Synopsis
#include <gst/gst.h>
enum GstBinFlags;
struct GstBin;
void (*GstBinPrePostIterateFunction) (GstBin *bin,
gpointer data);
GstElement* gst_bin_new (const gchar *name);
#define gst_bin_destroy (bin)
void gst_bin_add (GstBin *bin,
GstElement *element);
void gst_bin_add_many (GstBin *bin,
GstElement *element_1,
...);
void gst_bin_remove (GstBin *bin,
GstElement *element);
GstElement* gst_bin_get_by_name (GstBin *bin,
const gchar *name);
GstElement* gst_bin_get_by_name_recurse_up (GstBin *bin,
const gchar *name);
const GList* gst_bin_get_list (GstBin *bin);
gboolean gst_bin_iterate (GstBin *bin);
void gst_bin_set_post_iterate_function
(GstBin *bin,
GstBinPrePostIterateFunction func,
gpointer func_data);
void gst_bin_set_pre_iterate_function
(GstBin *bin,
GstBinPrePostIterateFunction func,
gpointer func_data);
void gst_bin_child_state_change (GstBin *bin,
GstElementState oldstate,
GstElementState newstate,
GstElement *child);
void gst_bin_auto_clock (GstBin *bin);
GstClock* gst_bin_get_clock (GstBin *bin);
void gst_bin_use_clock (GstBin *bin,
GstClock *clock);
|
Description
GstBin is the simplest of the container elements, allowing elements to
become children of itself. Pads from the child elements can be ghosted to
the bin, making the bin itself look transparently like any other element,
allowing for deep nesting of predefined sub-pipelines.
A new GstBin is created with gst_bin_new(). Use a GstPipeline instead if you want
to create a toplevel bin because a normal bin doesn't have a scheduler of its
own.
After the bin has been created you will typically add elements to it with
gst_bin_add(). You can remove elements with gst_bin_remove().
An element can be retrieved from a bin with gst_bin_get_by_name(), using the
elements name. gst_bin_get_by_name_recurse_up() is mainly used for internal
purposes and will query the parent bins when the element is not found in the
current bin.
The list of elements in a bin can be retrieved with gst_bin_get_list().
After the bin has been set to the PLAYING state (with gst_element_set_state()),
gst_bin_iterate() is used to process the elements in the bin.
The "object_added" signal is fired whenever a new object is added to the bin.
gst_bin_destroy() is used to destroy the bin.
To control the selection of the clock in a bin, you can use the following methods:
gst_bin_auto_clock() to let the bin select a clock automatically, gst_bin_get_clock() to
get the current clock of the bin and gst_bin_use_clock() to specify a clock explicitly.
Details
enum GstBinFlags
typedef enum {
/* this bin is a manager of child elements, i.e. a pipeline or thread */
GST_BIN_FLAG_MANAGER = GST_ELEMENT_FLAG_LAST,
/* this bin iterates itself */
GST_BIN_SELF_SCHEDULABLE,
/* we prefer to have cothreads when its an option, over chain-based */
GST_BIN_FLAG_PREFER_COTHREADS,
GST_BIN_FLAG_FIXED_CLOCK,
/* padding */
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5
} GstBinFlags; |
Flags for a bin.
gst_bin_new ()
Create a new bin with given name.
gst_bin_destroy()
#define gst_bin_destroy(bin) gst_object_destroy(GST_OBJECT(bin)) |
Free the memory allocated by this bin
gst_bin_add ()
Add the given element to the bin. Set the elements parent, and thus
add a reference.
gst_bin_add_many ()
Add a list of elements to a bin. Uses gst_bin_add.
gst_bin_remove ()
Remove the element from its associated bin, unparenting as well.
The element will also be unreferenced so there's no need to call
gst_object_unref on it.
If you want the element to still exist after removing, you need to call
gst_object_ref before removing it from the bin.
gst_bin_get_by_name ()
Get the element with the given name from this bin.
gst_bin_get_by_name_recurse_up ()
Get the element with the given name from this bin. If the
element is not found, a recursion is performed on the parent bin.
gst_bin_get_list ()
const GList* gst_bin_get_list (GstBin *bin); |
Get the list of elements in this bin.
gst_bin_iterate ()
gboolean gst_bin_iterate (GstBin *bin); |
Iterates over the elements in this bin.
gst_bin_set_post_iterate_function ()
Attaches a callback which will be run after every iteration of the bin
gst_bin_set_pre_iterate_function ()
Attaches a callback which will be run before every iteration of the bin
gst_bin_child_state_change ()
An internal function to inform the parent bin about a state change
of a child.
gst_bin_auto_clock ()
void gst_bin_auto_clock (GstBin *bin); |
Let the bin select a clock automatically.
gst_bin_get_clock ()
Gets the current clock of the (scheduler of the) bin.
gst_bin_use_clock ()
Force the bin to use the given clock. Use NULL to
force it to use no clock at all.
Signals
The "object-added" signal
void user_function (GstBin *gstbin,
gpointer arg1,
gpointer user_data); |
is signaled whenever a new GstElement is added to the GstBin