X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstbin.h;h=5e9c38dcb17f4c9d41a0306c9ea065779c092161;hb=5470f6df00595f4ab44871e0e633bf15006abc5c;hp=19c7634a64028001dd5c1dc7770a21dc97df0d1b;hpb=99d4a57d7cb1e32cd9dbdb66f19a6c8e31985402;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstbin.h b/gst/gstbin.h index 19c7634..5e9c38d 100644 --- a/gst/gstbin.h +++ b/gst/gstbin.h @@ -16,8 +16,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ @@ -40,6 +40,11 @@ G_BEGIN_DECLS /** * GstBinFlags: + * @GST_BIN_FLAG_NO_RESYNC: don't resync a state change when elements are + * added or linked in the bin (Since 1.0.5) + * @GST_BIN_FLAG_STREAMS_AWARE: Indicates whether the bin can handle elements + * that add/remove source pads at any point in time without + * first posting a no-more-pads signal (Since 1.10) * @GST_BIN_FLAG_LAST: the last enum in the series of flags for bins. * Derived classes can use this as first value in a list of flags. * @@ -48,10 +53,23 @@ G_BEGIN_DECLS * and (un)set using GST_OBJECT_FLAG_SET () and GST_OBJECT_FLAG_UNSET (). */ typedef enum { + GST_BIN_FLAG_NO_RESYNC = (GST_ELEMENT_FLAG_LAST << 0), + GST_BIN_FLAG_STREAMS_AWARE = (GST_ELEMENT_FLAG_LAST << 1), /* padding */ GST_BIN_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 5) } GstBinFlags; +/** + * GST_BIN_IS_NO_RESYNC: + * @bin: A #GstBin + * + * Check if @bin will resync its state change when elements are added and + * removed. + * + * Since: 1.0.5 + */ +#define GST_BIN_IS_NO_RESYNC(bin) (GST_OBJECT_FLAG_IS_SET(bin,GST_BIN_FLAG_NO_RESYNC)) + typedef struct _GstBin GstBin; typedef struct _GstBinClass GstBinClass; typedef struct _GstBinPrivate GstBinPrivate; @@ -81,10 +99,10 @@ typedef struct _GstBinPrivate GstBinPrivate; /** * GstBin: * @numchildren: the number of children in this bin - * @children: the list of children in this bin + * @children: (element-type Gst.Element): the list of children in this bin * @children_cookie: updated whenever @children changes * @child_bus: internal bus for handling child messages - * @messages: queued and cached messages + * @messages: (element-type Gst.Message): queued and cached messages * @polling: the bin is currently calculating its state * @state_dirty: the bin needs to recalculate its state (deprecated) * @clock_dirty: the bin needs to select a new clock @@ -126,6 +144,10 @@ struct _GstBin { * @add_element: method to add an element to a bin * @remove_element: method to remove an element from a bin * @handle_message: method to handle a message from the children + * @deep_element_added: method called when an element was added somewhere + * in the bin hierarchy + * @deep_element_removed: method called when an element was removed somewhere + * in the bin hierarchy * * Subclasses can override the @add_element and @remove_element to * update the list of children in the bin. @@ -133,12 +155,18 @@ struct _GstBin { * The @handle_message method can be overridden to implement custom * message handling. @handle_message takes ownership of the message, just like * #gst_element_post_message. + * + * The @deep_element_added vfunc will be called when a new element has been + * added to any bin inside this bin, so it will also be called if a new child + * was added to a sub-bin of this bin. #GstBin implementations that override + * this message should chain up to the parent class implementation so the + * element-added-deep signal is emitted on all parents. */ struct _GstBinClass { GstElementClass parent_class; /*< private >*/ - GThreadPool *pool; + GThreadPool *pool; /* deprecated */ /* signals */ void (*element_added) (GstBin *bin, GstElement *child); @@ -152,37 +180,79 @@ struct _GstBinClass { void (*handle_message) (GstBin *bin, GstMessage *message); /*< private >*/ - /* signal added 0.10.22 */ + /* signal */ gboolean (*do_latency) (GstBin *bin); + /*< public >*/ + /* signal */ + void (*deep_element_added) (GstBin *bin, GstBin *sub_bin, GstElement *child); + void (*deep_element_removed) (GstBin *bin, GstBin *sub_bin, GstElement *child); + /*< private >*/ - gpointer _gst_reserved[GST_PADDING]; + gpointer _gst_reserved[GST_PADDING-2]; }; +GST_API GType gst_bin_get_type (void); + +GST_API GstElement* gst_bin_new (const gchar *name); /* add and remove elements from the bin */ + +GST_API gboolean gst_bin_add (GstBin *bin, GstElement *element); + +GST_API gboolean gst_bin_remove (GstBin *bin, GstElement *element); /* retrieve a single child */ + +GST_API GstElement* gst_bin_get_by_name (GstBin *bin, const gchar *name); + +GST_API GstElement* gst_bin_get_by_name_recurse_up (GstBin *bin, const gchar *name); + +GST_API GstElement* gst_bin_get_by_interface (GstBin *bin, GType iface); /* retrieve multiple children */ + +GST_API GstIterator* gst_bin_iterate_elements (GstBin *bin); + +GST_API GstIterator* gst_bin_iterate_sorted (GstBin *bin); + +GST_API GstIterator* gst_bin_iterate_recurse (GstBin *bin); +GST_API GstIterator* gst_bin_iterate_sinks (GstBin *bin); + +GST_API GstIterator* gst_bin_iterate_sources (GstBin *bin); + +GST_API GstIterator* gst_bin_iterate_all_by_interface (GstBin *bin, GType iface); /* latency */ + +GST_API gboolean gst_bin_recalculate_latency (GstBin * bin); +/* set and get suppressed flags */ + +GST_API +void gst_bin_set_suppressed_flags (GstBin * bin, GstElementFlags flags); + +GST_API +GstElementFlags gst_bin_get_suppressed_flags (GstBin * bin); + +#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBin, gst_object_unref) +#endif G_END_DECLS