bin->children = g_list_prepend (bin->children, element);
bin->numchildren++;
bin->children_cookie++;
- bin->priv->structure_cookie++;
+ if (!GST_BIN_IS_NO_RESYNC (bin))
+ bin->priv->structure_cookie++;
/* distribute the bus */
gst_element_set_bus (element, bin->child_bus);
* so that others can detect a change in the children list. */
bin->numchildren--;
bin->children_cookie++;
- bin->priv->structure_cookie++;
+ if (!GST_BIN_IS_NO_RESYNC (bin))
+ bin->priv->structure_cookie++;
if (is_sink && !othersink) {
/* we're not a sink anymore */
* need to resync by updating the structure_cookie. */
bin_remove_messages (bin, GST_MESSAGE_SRC (message),
GST_MESSAGE_STRUCTURE_CHANGE);
- bin->priv->structure_cookie++;
+ if (!GST_BIN_IS_NO_RESYNC (bin))
+ bin->priv->structure_cookie++;
}
GST_OBJECT_UNLOCK (bin);
/**
* GstBinFlags:
+ * @GST_BIN_FLAG_NO_RESYNC: don't resync a state change when elements are
+ * added or linked in the bin.
* @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.
*
* 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),
/* 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.1.1
+ */
+#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;