- Added _LOCKED_STATE element flag

Original commit message from CVS:
- Added _LOCKED_STATE element flag
- parent bin does not perform state changes on _LOCKED_STATE elements
This commit is contained in:
Wim Taymans 2003-03-25 19:39:18 +00:00
parent 5b91593b0e
commit 1123103926
2 changed files with 19 additions and 11 deletions

View file

@ -431,6 +431,12 @@ gst_bin_add_func (GstBin *bin, GstElement *element)
GstElementState state;
GstScheduler *sched;
/* the element must not already have a parent */
g_return_if_fail (GST_ELEMENT_PARENT (element) == NULL);
/* must be not be in PLAYING state in order to modify bin */
g_return_if_fail (GST_STATE (bin) != GST_STATE_PLAYING);
/* then check to see if the element's name is already taken in the bin */
if (gst_object_check_uniqueness (bin->children,
GST_ELEMENT_NAME (element)) == FALSE)
@ -485,12 +491,6 @@ gst_bin_add (GstBin *bin, GstElement *element)
GST_DEBUG (GST_CAT_PARENTAGE, "adding element \"%s\" to bin \"%s\"",
GST_ELEMENT_NAME (element), GST_ELEMENT_NAME (bin));
/* the element must not already have a parent */
g_return_if_fail (GST_ELEMENT_PARENT (element) == NULL);
/* must be not be in PLAYING state in order to modify bin */
g_return_if_fail (GST_STATE (bin) != GST_STATE_PLAYING);
bclass = GST_BIN_GET_CLASS (bin);
if (bclass->add_element) {
@ -694,6 +694,9 @@ gst_bin_change_state (GstElement * element)
child = GST_ELEMENT (children->data);
children = g_list_next (children);
if (GST_FLAG_IS_SET (child, GST_ELEMENT_LOCKED_STATE))
continue;
old_child_state = GST_STATE (child);
switch (gst_element_set_state (child, pending)) {

View file

@ -108,6 +108,9 @@ typedef enum {
GST_ELEMENT_SCHEDULER_PRIVATE1,
GST_ELEMENT_SCHEDULER_PRIVATE2,
/* ignore state changes from parent */
GST_ELEMENT_LOCKED_STATE,
/* use some padding for future expansion */
GST_ELEMENT_FLAG_LAST = GST_OBJECT_FLAG_LAST + 16
} GstElementFlags;
@ -292,18 +295,20 @@ GList* gst_element_get_pad_template_list (GstElement *element);
GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);
gboolean gst_element_link (GstElement *src, GstElement *dest);
gboolean gst_element_link_many (GstElement *element_1, GstElement *element_2, ...);
gboolean gst_element_link_many (GstElement *element_1,
GstElement *element_2, ...);
gboolean gst_element_link_filtered (GstElement *src, GstElement *dest,
GstCaps *filtercaps);
void gst_element_unlink (GstElement *src, GstElement *dest);
void gst_element_unlink_many (GstElement *element_1, GstElement *element_2, ...);
void gst_element_unlink_many (GstElement *element_1,
GstElement *element_2, ...);
gboolean gst_element_link_pads (GstElement *src, const gchar *srcpadname,
gboolean gst_element_link_pads (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname);
gboolean gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
gboolean gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname,
GstCaps *filtercaps);
void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname,
void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname);
const GstEventMask* gst_element_get_event_masks (GstElement *element);