Changed the way state is dealt with when a child is added to the bin. The note states that the COMPLETE state should...

Original commit message from CVS:
Changed the way state is dealt with when a child is added to the bin.  The
note states that the COMPLETE state should probably reflect nothing more
than whether or not there is a child in the bin, not whether or not all
children are COMPLETE.  I need to write out a few scenarios for complex
pipeline manipulations to figure out how all the states should interact.
The idea is to maintain the ability to dynamically recofigure the
pipeline.
This commit is contained in:
Erik Walthinsen 2000-02-12 23:08:06 +00:00
parent d6d5df1f9d
commit 1f05e5a957

View file

@ -147,11 +147,17 @@ void gst_bin_add(GstBin *bin,GstElement *element) {
bin->numchildren++; bin->numchildren++;
gst_object_set_parent(GST_OBJECT(element),GST_OBJECT(bin)); gst_object_set_parent(GST_OBJECT(element),GST_OBJECT(bin));
if (GST_STATE_IS_SET(element,GST_STATE_COMPLETE)) { /* FIXME: this isn't right, the bin should be complete whether or not
if (!GST_STATE_IS_SET(bin,GST_STATE_COMPLETE)) the children are, I think. */
// if (GST_STATE_IS_SET(element,GST_STATE_COMPLETE)) {
if (!GST_STATE_IS_SET(bin,GST_STATE_COMPLETE)) {
g_print("GstBin: adding complete element - ");
gst_bin_change_state_norecurse(GST_ELEMENT(bin),GST_STATE_COMPLETE); gst_bin_change_state_norecurse(GST_ELEMENT(bin),GST_STATE_COMPLETE);
} else }
gst_bin_change_state_norecurse(GST_ELEMENT(bin),~GST_STATE_COMPLETE); // } else {
// g_print("GstBin: adding element - ");
// gst_bin_change_state_norecurse(GST_ELEMENT(bin),~GST_STATE_COMPLETE);
// }
gtk_signal_emit(GTK_OBJECT(bin),gst_bin_signals[OBJECT_ADDED],element); gtk_signal_emit(GTK_OBJECT(bin),gst_bin_signals[OBJECT_ADDED],element);
} }