mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
composition: Remove useless code
Co-Authored by: Thibault Saunier <tsaunier@gnome.org>
This commit is contained in:
parent
5efd167bf2
commit
c99642fe66
1 changed files with 2 additions and 140 deletions
|
@ -222,10 +222,6 @@ static void _relink_single_node (GnlComposition * comp, GNode * node,
|
|||
GstEvent * toplevel_seek);
|
||||
static gboolean update_pipeline_func (GnlComposition * comp);
|
||||
static gboolean _commit_func (GnlComposition * comp);
|
||||
static gboolean lock_child_state (GValue * item, GValue * ret,
|
||||
gpointer udata G_GNUC_UNUSED);
|
||||
static gboolean
|
||||
set_child_caps (GValue * item, GValue * ret G_GNUC_UNUSED, GnlObject * comp);
|
||||
static GstEvent *get_new_seek_event (GnlComposition * comp, gboolean initial,
|
||||
gboolean updatestoponly);
|
||||
static gboolean
|
||||
|
@ -302,12 +298,6 @@ struct _GnlCompositionEntry
|
|||
{
|
||||
GnlObject *object;
|
||||
GnlComposition *comp;
|
||||
|
||||
/* handler id for block probe */
|
||||
gulong probeid;
|
||||
gulong dataprobeid;
|
||||
|
||||
gboolean seeked;
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -784,20 +774,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);
|
||||
}
|
||||
|
||||
|
@ -971,42 +947,6 @@ signal_duration_change (GnlComposition * comp)
|
|||
gst_message_new_duration_changed (GST_OBJECT_CAST (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)
|
||||
{
|
||||
|
@ -1016,9 +956,6 @@ reset_child (GValue * item, GValue * ret G_GNUC_UNUSED, gpointer user_data)
|
|||
GnlObject *object;
|
||||
GstPad *srcpad, *peerpad;
|
||||
|
||||
GST_DEBUG_OBJECT (child, "unlocking state");
|
||||
gst_element_set_locked_state (child, FALSE);
|
||||
|
||||
entry = COMP_ENTRY (comp, child);
|
||||
object = entry->object;
|
||||
srcpad = object->srcpad;
|
||||
|
@ -1031,18 +968,6 @@ reset_child (GValue * item, GValue * ret G_GNUC_UNUSED, gpointer user_data)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
lock_child_state (GValue * item, GValue * ret G_GNUC_UNUSED,
|
||||
gpointer udata G_GNUC_UNUSED)
|
||||
{
|
||||
GstElement *child = g_value_get_object (item);
|
||||
|
||||
GST_DEBUG_OBJECT (child, "locking state");
|
||||
gst_element_set_locked_state (child, TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
reset_children (GnlComposition * comp)
|
||||
{
|
||||
|
@ -2039,18 +1964,6 @@ get_clean_toplevel_stack (GnlComposition * comp, GstClockTime * timestamp,
|
|||
return stack;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
set_child_caps (GValue * item, GValue * ret G_GNUC_UNUSED, GnlObject * comp)
|
||||
{
|
||||
GstElement *child = g_value_get_object (item);
|
||||
|
||||
gnl_object_set_caps ((GnlObject *) child, comp->caps);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Must be called with OBJECTS_LOCK and PENDING_IO_LOCK taken */
|
||||
/* Must be called with OBJECTS_LOCK taken */
|
||||
static void
|
||||
_process_pending_entries (GnlComposition * comp)
|
||||
|
@ -2094,7 +2007,6 @@ _commit_func (GnlComposition * comp)
|
|||
GST_ERROR_OBJECT (object, "Commiting state");
|
||||
COMP_OBJECTS_LOCK (comp);
|
||||
|
||||
_process_pending_entries (comp);
|
||||
for (tmp = priv->objects_start; tmp; tmp = tmp->next) {
|
||||
if (gnl_object_commit (tmp->data, TRUE))
|
||||
commited = TRUE;
|
||||
|
@ -2104,6 +2016,7 @@ _commit_func (GnlComposition * comp)
|
|||
if (commited == FALSE &&
|
||||
(GNL_OBJECT_CLASS (parent_class)->commit (object, TRUE) == FALSE)) {
|
||||
|
||||
_process_pending_entries (comp);
|
||||
COMP_OBJECTS_UNLOCK (comp);
|
||||
GST_ERROR_OBJECT (object, "Nothing to commit, leaving");
|
||||
g_signal_emit (comp, _signals[COMMITED_SIGNAL], 0, FALSE);
|
||||
|
@ -2190,7 +2103,6 @@ _set_all_children_state (GnlComposition * comp, GstState state)
|
|||
static GstStateChangeReturn
|
||||
gnl_composition_change_state (GstElement * element, GstStateChange transition)
|
||||
{
|
||||
GstIterator *children;
|
||||
GnlComposition *comp = (GnlComposition *) element;
|
||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||
|
||||
|
@ -2201,32 +2113,6 @@ gnl_composition_change_state (GstElement * element, GstStateChange transition)
|
|||
switch (transition) {
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
gnl_composition_reset (comp);
|
||||
|
||||
/* state-lock all elements */
|
||||
GST_DEBUG_OBJECT (comp,
|
||||
"Setting all children to READY and locking their state");
|
||||
|
||||
children = gst_bin_iterate_elements (GST_BIN (comp->priv->current_bin));
|
||||
|
||||
while (G_UNLIKELY (gst_iterator_fold (children,
|
||||
(GstIteratorFoldFunction) lock_child_state, NULL,
|
||||
NULL) == GST_ITERATOR_RESYNC)) {
|
||||
gst_iterator_resync (children);
|
||||
}
|
||||
gst_iterator_free (children);
|
||||
|
||||
/* Set caps on all objects */
|
||||
if (G_UNLIKELY (!gst_caps_is_any (GNL_OBJECT (comp)->caps))) {
|
||||
children = gst_bin_iterate_elements (GST_BIN (comp->priv->current_bin));
|
||||
|
||||
while (G_UNLIKELY (gst_iterator_fold (children,
|
||||
(GstIteratorFoldFunction) set_child_caps, NULL,
|
||||
comp) == GST_ITERATOR_RESYNC)) {
|
||||
gst_iterator_resync (children);
|
||||
}
|
||||
gst_iterator_free (children);
|
||||
}
|
||||
|
||||
_add_initialize_stack_gsource (comp);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
|
@ -2246,15 +2132,6 @@ gnl_composition_change_state (GstElement * element, GstStateChange 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;
|
||||
}
|
||||
|
||||
|
@ -2567,21 +2444,6 @@ _relink_new_stack (GnlComposition * comp, GNode * stack,
|
|||
gst_element_sync_state_with_parent (comp->priv->current_bin);
|
||||
}
|
||||
|
||||
static void
|
||||
unlock_activate_stack (GnlComposition * comp, GNode * node, GstState state)
|
||||
{
|
||||
GNode *child;
|
||||
|
||||
GST_LOG_OBJECT (comp, "object:%s",
|
||||
GST_ELEMENT_NAME ((GstElement *) (node->data)));
|
||||
|
||||
gst_element_set_locked_state ((GstElement *) (node->data), FALSE);
|
||||
gst_element_set_state (GST_ELEMENT (node->data), state);
|
||||
|
||||
for (child = node->children; child; child = child->next)
|
||||
unlock_activate_stack (comp, child, state);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
are_same_stacks (GNode * stack1, GNode * stack2)
|
||||
{
|
||||
|
@ -2860,6 +2722,7 @@ _gnl_composition_add_entry (GnlComposition * comp, GnlObject * object)
|
|||
goto chiringuito;
|
||||
}
|
||||
|
||||
gnl_object_set_caps (object, GNL_OBJECT (comp)->caps);
|
||||
gnl_object_set_commit_needed (GNL_OBJECT (comp));
|
||||
|
||||
if (!ret) {
|
||||
|
@ -2869,7 +2732,6 @@ _gnl_composition_add_entry (GnlComposition * comp, GnlObject * object)
|
|||
|
||||
/* lock state of child ! */
|
||||
GST_LOG_OBJECT (comp, "Locking state of %s", GST_ELEMENT_NAME (object));
|
||||
gst_element_set_locked_state (GST_ELEMENT (object), TRUE);
|
||||
|
||||
/* wrap new element in a GnlCompositionEntry ... */
|
||||
entry = g_slice_new0 (GnlCompositionEntry);
|
||||
|
|
Loading…
Reference in a new issue