## GstBin GstBin |

## Functions

GstElement * | gst_bin_new ()
gboolean | gst_bin_add ()
gboolean | gst_bin_remove ()
GstElement * | gst_bin_get_by_name ()
GstElement * | gst_bin_get_by_name_recurse_up ()
GstElement * | gst_bin_get_by_interface ()
GstIterator * | gst_bin_iterate_elements ()
GstIterator * | gst_bin_iterate_recurse ()
GstIterator * | gst_bin_iterate_sinks ()
GstIterator * | gst_bin_iterate_sorted ()
GstIterator * | gst_bin_iterate_sources ()
GstIterator * | gst_bin_iterate_all_by_interface ()
gboolean | gst_bin_recalculate_latency ()
void | gst_bin_add_many ()
void | gst_bin_remove_many ()
GstPad * | gst_bin_find_unlinked_pad ()
gboolean | gst_bin_sync_children_states ()
#define | GST_BIN_IS_NO_RESYNC()
#define | GST_BIN_CHILDREN()
#define | GST_BIN_CHILDREN_COOKIE()
#define | GST_BIN_NUMCHILDREN()

## Properties

gboolean | async-handling | Read / Write
gboolean | message-forward | Read / Write

## Signals

void | deep-element-added | Run First
void | deep-element-removed | Run First
gboolean | do-latency | Run Last
void | element-added | Run First
void | element-removed | Run First

## Types and Values

struct | GstBin
struct | GstBinClass
enum | GstBinFlags

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBin
                        ╰── GstPipeline

## Implemented Interfaces

GstBin implements GstChildProxy.

## Includes

    #include <gst/gst.h>

## Description

## Functions

### gst_bin_new ()

    GstElement *
    gst_bin_new (const gchar *name);

### gst_bin_add ()

    gboolean
    gst_bin_add (GstBin *bin,
                 GstElement *element);

### gst_bin_remove ()

    gboolean
    gst_bin_remove (GstBin *bin,
                    GstElement *element);

### gst_bin_get_by_name ()

    GstElement *
    gst_bin_get_by_name (GstBin *bin,
                         const gchar *name);

### gst_bin_get_by_name_recurse_up ()

    GstElement *
    gst_bin_get_by_name_recurse_up (GstBin *bin,
                                    const gchar *name);

### gst_bin_get_by_interface ()

    GstElement *
    gst_bin_get_by_interface (GstBin *bin,
                              GType iface);

### gst_bin_iterate_elements ()

    GstIterator *
    gst_bin_iterate_elements (GstBin *bin);

### gst_bin_iterate_recurse ()

    GstIterator *
    gst_bin_iterate_recurse (GstBin *bin);

### gst_bin_iterate_sinks ()

    GstIterator *
    gst_bin_iterate_sinks (GstBin *bin);

### gst_bin_iterate_sorted ()

    GstIterator *
    gst_bin_iterate_sorted (GstBin *bin);

### gst_bin_iterate_sources ()

    GstIterator *
    gst_bin_iterate_sources (GstBin *bin);

### gst_bin_iterate_all_by_interface ()

    GstIterator *
    gst_bin_iterate_all_by_interface (GstBin *bin,
                                      GType iface);

### gst_bin_recalculate_latency ()

    gboolean
    gst_bin_recalculate_latency (GstBin *bin);

### gst_bin_add_many ()

    void
    gst_bin_add_many (GstBin *bin,
                      GstElement *element_1,
                      ...);

### gst_bin_remove_many ()

    void
    gst_bin_remove_many (GstBin *bin,
                         GstElement *element_1,
                         ...);

### gst_bin_find_unlinked_pad ()

    GstPad *
    gst_bin_find_unlinked_pad (GstBin *bin,
                               GstPadDirection direction);

### gst_bin_sync_children_states ()

    gboolean
    gst_bin_sync_children_states (GstBin *bin);

### GST_BIN_IS_NO_RESYNC()

    #define GST_BIN_IS_NO_RESYNC(bin)        (GST_OBJECT_FLAG_IS_SET(bin,GST_BIN_FLAG_NO_RESYNC))

### GST_BIN_CHILDREN()

    #define GST_BIN_CHILDREN(bin)		(GST_BIN_CAST(bin)->children)

### GST_BIN_CHILDREN_COOKIE()

    #define GST_BIN_CHILDREN_COOKIE(bin) (GST_BIN_CAST(bin)->children_cookie)

### GST_BIN_NUMCHILDREN()

    #define GST_BIN_NUMCHILDREN(bin) (GST_BIN_CAST(bin)->numchildren)

## Types and Values

### struct GstBin

    struct GstBin {
      /* our children, subclass are supposed to update these
       * fields to reflect their state with _iterate_*() */
      gint		 numchildren;
      GList		*children;
      guint32	 children_cookie;

      GstBus        *child_bus;
      GList         *messages;

      gboolean	 polling;
      gboolean       state_dirty;

      gboolean       clock_dirty;
      GstClock *provided_clock;
      GstElement    *clock_provider;
    };

### struct GstBinClass

    struct GstBinClass {
      GstElementClass parent_class;

      /* virtual methods for subclasses */
      gboolean (*add_element)		(GstBin *bin, GstElement *element);
      gboolean (*remove_element) (GstBin *bin, GstElement *element);

      void		(*handle_message) (GstBin *bin, GstMessage *message);

      /* signal */
      void          (*deep_element_added)   (GstBin *bin, GstBin *sub_bin, GstElement *child);
      void          (*deep_element_removed) (GstBin *bin, GstBin *sub_bin, GstElement *child);
    };

### enum GstBinFlags

#### Members

GST_BIN_FLAG_NO_RESYNC |  |
GST_BIN_FLAG_LAST |  |

## Property Details

### The `“async-handling”` property

      “async-handling”           gboolean

The bin will handle Asynchronous state changes.

Flags: Read / Write

Default value: FALSE

### The `“message-forward”` property

      “message-forward”          gboolean

Forwards all children messages.

Flags: Read / Write

Default value: FALSE

## Signal Details

### The `“deep-element-added”` signal

    void
    user_function (GstBin     *gstbin,
                   GstBin     *arg1,
                   GstElement *arg2,
                   gpointer    user_data)

Flags: Run First

### The `“deep-element-removed”` signal

    void
    user_function (GstBin     *gstbin,
                   GstBin     *arg1,
                   GstElement *arg2,
                   gpointer    user_data)

Flags: Run First

### The `“do-latency”` signal

    gboolean
    user_function (GstBin  *gstbin,
                   gpointer user_data)

Flags: Run Last

### The `“element-added”` signal

    void
    user_function (GstBin     *gstbin,
                   GstElement *arg1,
                   gpointer    user_data)

Flags: Run First

### The `“element-removed”` signal

    void
    user_function (GstBin     *gstbin,
                   GstElement *arg1,
                   gpointer    user_data)

Flags: Run First