gst_decode_bin_remove_groups (GstDecodeBin * dbin)
{
GList *tmp;
+ GstIterator *it;
+ gpointer point;
+ gboolean done;
+ GstIteratorResult res;
GST_DEBUG_OBJECT (dbin, "cleaning up");
}
g_list_free (dbin->oldgroups);
dbin->oldgroups = NULL;
+
+ GST_DEBUG_OBJECT (dbin, "removing last elements");
+
+ /* remove all remaining elements */
+ it = gst_bin_iterate_elements (GST_BIN_CAST (dbin));
+restart:
+ done = FALSE;
+ while (!done) {
+ res = gst_iterator_next (it, &point);
+ switch (res) {
+ case GST_ITERATOR_DONE:
+ done = TRUE;
+ break;
+ case GST_ITERATOR_RESYNC:
+ gst_iterator_resync (it);
+ goto restart;
+ case GST_ITERATOR_ERROR:
+ GST_WARNING_OBJECT (dbin,
+ "Had an error while iterating bin %s", GST_ELEMENT_NAME (dbin));
+ done = TRUE;
+ break;
+ case GST_ITERATOR_OK:
+ {
+ GstElement *elem = GST_ELEMENT_CAST (point);
+
+ /* don't remove the typefind element */
+ if (elem != dbin->typefind) {
+ GST_DEBUG_OBJECT (dbin, "remove element %s", GST_ELEMENT_NAME (elem));
+ gst_bin_remove (GST_BIN_CAST (dbin), elem);
+ gst_element_set_state (elem, GST_STATE_NULL);
+ }
+ gst_object_unref (elem);
+ break;
+ }
+ default:
+ break;
+ }
+ }
}
static void