From caa916e509a06effcb198a6bacaf56628f50dfc1 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Mon, 14 Jul 2014 15:50:58 +0200 Subject: [PATCH] composition: cleanup GnlCompositionEntry before its actual removal. Co-Authored by: Thibault Saunier --- gnl/gnlcomposition.c | 75 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 73 deletions(-) diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c index 9ccea29..86d7293 100644 --- a/gnl/gnlcomposition.c +++ b/gnl/gnlcomposition.c @@ -175,7 +175,7 @@ struct _GnlCompositionPrivate /* While we do not get a buffer on our srcpad, * we are not commited */ gulong commited_probeid; - /* 0 means that we already received the right segment */ + /* 0 means that we already received the right caps or segment */ gint awaited_caps_seqnum; }; @@ -294,12 +294,6 @@ struct _GnlCompositionEntry { GnlObject *object; GnlComposition *comp; - - /* handler id for block probe */ - gulong probeid; - gulong dataprobeid; - - gboolean seeked; }; static void @@ -754,20 +748,6 @@ gnl_composition_class_init (GnlCompositionClass * klass) static void hash_value_destroy (GnlCompositionEntry * entry) { - GstPad *srcpad; - GstElement *element = GST_ELEMENT (entry->object); - - srcpad = GNL_OBJECT_SRC (element); - if (entry->probeid) { - gst_pad_remove_probe (srcpad, entry->probeid); - entry->probeid = 0; - } - - if (entry->dataprobeid) { - gst_pad_remove_probe (srcpad, entry->dataprobeid); - entry->dataprobeid = 0; - } - g_slice_free (GnlCompositionEntry, entry); } @@ -897,42 +877,6 @@ signal_duration_change (GnlComposition * comp) } static gboolean -unblock_child_pads (GValue * item, GValue * ret G_GNUC_UNUSED, - GnlComposition * comp) -{ - GstPad *pad; - GstElement *child = g_value_get_object (item); - GnlCompositionEntry *entry = COMP_ENTRY (comp, child); - - GST_DEBUG_OBJECT (child, "unblocking pads"); - - pad = GNL_OBJECT_SRC (child); - if (entry->probeid) { - gst_pad_remove_probe (pad, entry->probeid); - entry->probeid = 0; - } - return TRUE; -} - -static void -unblock_children (GnlComposition * comp) -{ - GstIterator *children; - - children = gst_bin_iterate_elements (GST_BIN (comp->priv->current_bin)); - -retry: - if (G_UNLIKELY (gst_iterator_fold (children, - (GstIteratorFoldFunction) unblock_child_pads, NULL, - comp) == GST_ITERATOR_RESYNC)) { - gst_iterator_resync (children); - goto retry; - } - gst_iterator_free (children); -} - - -static gboolean reset_child (GValue * item, GValue * ret G_GNUC_UNUSED, gpointer user_data) { GnlCompositionEntry *entry; @@ -2316,7 +2260,6 @@ gnl_composition_change_state (GstElement * element, GstStateChange transition) { GstIterator *children; GnlComposition *comp = (GnlComposition *) element; - GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GST_DEBUG_OBJECT (comp, "%s => %s", gst_element_state_get_name (GST_STATE_TRANSITION_CURRENT (transition)), @@ -2370,21 +2313,7 @@ gnl_composition_change_state (GstElement * element, GstStateChange transition) break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - - if (ret == GST_STATE_CHANGE_FAILURE) - return ret; - - switch (transition) { - case GST_STATE_CHANGE_PAUSED_TO_READY: - case GST_STATE_CHANGE_READY_TO_NULL: - unblock_children (comp); - break; - default: - break; - } - - return ret; + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); } static gint -- 2.7.4