mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
gnl: Rely on the GstElement to properly handle their seqnums
Actually it is not exactly thread safe to tweak them ourself at the GNL level. Co-Authored by: Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
This commit is contained in:
parent
114d63003e
commit
48ed8c6d0e
4 changed files with 0 additions and 55 deletions
|
@ -973,9 +973,6 @@ ghost_event_probe_handler (GstPad * ghostpad G_GNUC_UNUSED,
|
|||
event2 = gst_event_new_segment (©);
|
||||
GST_EVENT_SEQNUM (event2) = GST_EVENT_SEQNUM (event);
|
||||
|
||||
if (GNL_OBJECT (comp)->seqnum == 0)
|
||||
GNL_OBJECT (comp)->seqnum = GST_EVENT_SEQNUM (event);
|
||||
|
||||
GST_PAD_PROBE_INFO_DATA (info) = event2;
|
||||
gst_event_unref (event);
|
||||
}
|
||||
|
@ -2450,10 +2447,6 @@ static void
|
|||
_relink_new_stack (GnlComposition * comp, GNode * stack,
|
||||
GstEvent * toplevel_seek)
|
||||
{
|
||||
GST_INFO_OBJECT (comp, "Reseting seqnum to %i",
|
||||
gst_event_get_seqnum (toplevel_seek));
|
||||
GNL_OBJECT (comp)->wanted_seqnum = gst_event_get_seqnum (toplevel_seek);
|
||||
|
||||
_relink_single_node (comp, stack, toplevel_seek);
|
||||
|
||||
gst_event_unref (toplevel_seek);
|
||||
|
|
|
@ -299,12 +299,6 @@ translate_incoming_segment (GnlObject * object, GstEvent * event)
|
|||
GST_EVENT_SEQNUM (event2) = seqnum;
|
||||
gst_event_unref (event);
|
||||
|
||||
if (object->seqnum) {
|
||||
GST_INFO_OBJECT (object, "Tweaking SEGMENT seqnum from %i to %i",
|
||||
gst_event_get_seqnum (event2), object->seqnum);
|
||||
gst_event_set_seqnum (event2, object->seqnum);
|
||||
}
|
||||
|
||||
return event2;
|
||||
}
|
||||
|
||||
|
@ -328,25 +322,10 @@ internalpad_event_function (GstPad * internal, GstObject * parent,
|
|||
switch (priv->dir) {
|
||||
case GST_PAD_SRC:{
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEEK:
|
||||
object->wanted_seqnum = gst_event_get_seqnum (event);
|
||||
object->seqnum = 0;
|
||||
GST_DEBUG_OBJECT (object, "Setting wanted_seqnum to %i",
|
||||
object->wanted_seqnum);
|
||||
break;
|
||||
case GST_EVENT_SEGMENT:
|
||||
event = translate_outgoing_segment (object, event);
|
||||
if (object->wanted_seqnum == gst_event_get_seqnum (event)) {
|
||||
object->seqnum = object->wanted_seqnum;
|
||||
object->wanted_seqnum = 0;
|
||||
}
|
||||
break;
|
||||
case GST_EVENT_EOS:
|
||||
if (object->seqnum) {
|
||||
GST_INFO_OBJECT (object, "Tweaking EOS seqnum from %i to %i",
|
||||
gst_event_get_seqnum (event), object->seqnum);
|
||||
gst_event_set_seqnum (event, object->seqnum);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -516,8 +495,6 @@ ghostpad_event_function (GstPad * ghostpad, GstObject * parent,
|
|||
GstPad *target;
|
||||
|
||||
event = gnl_object_translate_incoming_seek (object, event);
|
||||
object->wanted_seqnum = gst_event_get_seqnum (event);
|
||||
object->seqnum = 0;
|
||||
if (!(target = gst_ghost_pad_get_target (GST_GHOST_PAD (ghostpad)))) {
|
||||
g_assert ("Seeked a pad with not target SHOULD NOT HAPPEND");
|
||||
ret = FALSE;
|
||||
|
|
|
@ -98,20 +98,6 @@ static gboolean gnl_object_commit_func (GnlObject * object, gboolean recurse);
|
|||
|
||||
static GstStateChangeReturn gnl_object_prepare (GnlObject * object);
|
||||
|
||||
|
||||
static gboolean
|
||||
gnl_object_send_event (GstElement * element, GstEvent * event)
|
||||
{
|
||||
if (GST_EVENT_TYPE (event) == GST_EVENT_SEEK) {
|
||||
GNL_OBJECT (element)->wanted_seqnum = gst_event_get_seqnum (event);
|
||||
GST_DEBUG_OBJECT (element, "Remember seqnum! %i",
|
||||
GNL_OBJECT (element)->wanted_seqnum);
|
||||
}
|
||||
|
||||
|
||||
return GST_ELEMENT_CLASS (parent_class)->send_event (element, event);
|
||||
}
|
||||
|
||||
static void
|
||||
gnl_object_class_init (GnlObjectClass * klass)
|
||||
{
|
||||
|
@ -131,7 +117,6 @@ gnl_object_class_init (GnlObjectClass * klass)
|
|||
gobject_class->dispose = GST_DEBUG_FUNCPTR (gnl_object_dispose);
|
||||
|
||||
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gnl_object_change_state);
|
||||
gstelement_class->send_event = GST_DEBUG_FUNCPTR (gnl_object_send_event);
|
||||
|
||||
gnlobject_class->prepare = GST_DEBUG_FUNCPTR (gnl_object_prepare_func);
|
||||
gnlobject_class->cleanup = GST_DEBUG_FUNCPTR (gnl_object_cleanup_func);
|
||||
|
@ -425,8 +410,6 @@ gnl_object_cleanup (GnlObject * object)
|
|||
|
||||
GST_DEBUG_OBJECT (object, "cleaning-up");
|
||||
|
||||
object->seqnum = 0;
|
||||
object->wanted_seqnum = 0;
|
||||
if (!(GNL_OBJECT_GET_CLASS (object)->cleanup (object)))
|
||||
ret = GST_STATE_CHANGE_FAILURE;
|
||||
|
||||
|
@ -663,8 +646,6 @@ gnl_object_reset (GnlObject * object)
|
|||
{
|
||||
GST_INFO_OBJECT (object, "Resetting child timing values to default");
|
||||
|
||||
object->seqnum = 0;
|
||||
object->wanted_seqnum = 0;
|
||||
object->start = 0;
|
||||
object->duration = 0;
|
||||
object->stop = 0;
|
||||
|
|
|
@ -126,12 +126,6 @@ struct _GnlObject
|
|||
gint64 segment_stop;
|
||||
|
||||
gboolean in_composition;
|
||||
|
||||
/* the seqnum we want, will be conciderd as real one right after
|
||||
* a new segment */
|
||||
gint wanted_seqnum;
|
||||
/* The seqnum that we are working with, 0 if not set */
|
||||
gint seqnum;
|
||||
};
|
||||
|
||||
struct _GnlObjectClass
|
||||
|
|
Loading…
Reference in a new issue