From 0fd18045b1ee3be6ea4d575d3e618bf8da9253c6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 12 Oct 2005 09:02:42 +0000 Subject: [PATCH] gst/base/gstbasesink.c: No need to prerol after receiving EOS. Original commit message from CVS: * gst/base/gstbasesink.c: (gst_base_sink_handle_object), (gst_base_sink_change_state): No need to prerol after receiving EOS. * gst/elements/gstfakesink.c: (gst_fake_sink_event): * gst/elements/gstfakesrc.c: (gst_fake_src_event_handler): * gst/elements/gstidentity.c: (gst_identity_event): Print events more verbosely. --- ChangeLog | 11 +++++++++++ gst/base/gstbasesink.c | 1 + gst/elements/gstfakesink.c | 2 +- gst/elements/gstfakesrc.c | 13 +++++++++++-- gst/elements/gstidentity.c | 14 ++++++++++++-- libs/gst/base/gstbasesink.c | 1 + plugins/elements/gstfakesink.c | 2 +- plugins/elements/gstfakesrc.c | 13 +++++++++++-- plugins/elements/gstidentity.c | 14 ++++++++++++-- 9 files changed, 61 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b0d740..d08961a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2005-10-12 Wim Taymans + * gst/base/gstbasesink.c: (gst_base_sink_handle_object), + (gst_base_sink_change_state): + No need to prerol after receiving EOS. + + * gst/elements/gstfakesink.c: (gst_fake_sink_event): + * gst/elements/gstfakesrc.c: (gst_fake_src_event_handler): + * gst/elements/gstidentity.c: (gst_identity_event): + Print events more verbosely. + +2005-10-12 Wim Taymans + * check/Makefile.am: * check/states/sinks.c: (GST_START_TEST), (gst_object_suite): * check/states/sinks2.c: diff --git a/gst/base/gstbasesink.c b/gst/base/gstbasesink.c index fe02e00..9459bfc 100644 --- a/gst/base/gstbasesink.c +++ b/gst/base/gstbasesink.c @@ -1489,6 +1489,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) gboolean do_eos = !basesink->eos_queued; gst_base_sink_preroll_queue_empty (basesink, basesink->sinkpad); + basesink->need_preroll = FALSE; /* need to post EOS message here if it was not in the preroll queue we * just emptied. */ diff --git a/gst/elements/gstfakesink.c b/gst/elements/gstfakesink.c index f4aff51..3a812c1 100644 --- a/gst/elements/gstfakesink.c +++ b/gst/elements/gstfakesink.c @@ -294,9 +294,9 @@ static gboolean gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event) { GstFakeSink *sink = GST_FAKE_SINK (bsink); - const GstStructure *s; if (!sink->silent) { + const GstStructure *s; gchar *sstr; GST_LOCK (sink); diff --git a/gst/elements/gstfakesrc.c b/gst/elements/gstfakesrc.c index 86caa35..5de6741 100644 --- a/gst/elements/gstfakesrc.c +++ b/gst/elements/gstfakesrc.c @@ -351,12 +351,21 @@ gst_fake_src_event_handler (GstBaseSrc * basesrc, GstEvent * event) src = GST_FAKE_SRC (basesrc); if (!src->silent) { + const GstStructure *s; + gchar *sstr; + GST_LOCK (src); g_free (src->last_message); + if ((s = gst_event_get_structure (event))) + sstr = gst_structure_to_string (s); + else + sstr = g_strdup (""); + src->last_message = - g_strdup_printf ("event ******* E (type: %d) %p", - GST_EVENT_TYPE (event), event); + g_strdup_printf ("event ******* E (type: %d, %s) %p", + GST_EVENT_TYPE (event), sstr, event); + g_free (sstr); GST_UNLOCK (src); g_object_notify (G_OBJECT (src), "last_message"); diff --git a/gst/elements/gstidentity.c b/gst/elements/gstidentity.c index c3dd2dc..7a13a4a 100644 --- a/gst/elements/gstidentity.c +++ b/gst/elements/gstidentity.c @@ -240,12 +240,22 @@ gst_identity_event (GstBaseTransform * trans, GstEvent * event) identity = GST_IDENTITY (trans); if (!identity->silent) { + const GstStructure *s; + gchar *sstr; + GST_LOCK (identity); g_free (identity->last_message); + if ((s = gst_event_get_structure (event))) + sstr = gst_structure_to_string (s); + else + sstr = g_strdup (""); + identity->last_message = - g_strdup_printf ("chain ******* (%s:%s)E (type: %d) %p", - GST_DEBUG_PAD_NAME (trans->sinkpad), GST_EVENT_TYPE (event), event); + g_strdup_printf ("event ******* (%s:%s) E (type: %d, %s) %p", + GST_DEBUG_PAD_NAME (trans->sinkpad), GST_EVENT_TYPE (event), sstr, + event); + g_free (sstr); GST_UNLOCK (identity); g_object_notify (G_OBJECT (identity), "last_message"); diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index fe02e00..9459bfc 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -1489,6 +1489,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) gboolean do_eos = !basesink->eos_queued; gst_base_sink_preroll_queue_empty (basesink, basesink->sinkpad); + basesink->need_preroll = FALSE; /* need to post EOS message here if it was not in the preroll queue we * just emptied. */ diff --git a/plugins/elements/gstfakesink.c b/plugins/elements/gstfakesink.c index f4aff51..3a812c1 100644 --- a/plugins/elements/gstfakesink.c +++ b/plugins/elements/gstfakesink.c @@ -294,9 +294,9 @@ static gboolean gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event) { GstFakeSink *sink = GST_FAKE_SINK (bsink); - const GstStructure *s; if (!sink->silent) { + const GstStructure *s; gchar *sstr; GST_LOCK (sink); diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index 86caa35..5de6741 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -351,12 +351,21 @@ gst_fake_src_event_handler (GstBaseSrc * basesrc, GstEvent * event) src = GST_FAKE_SRC (basesrc); if (!src->silent) { + const GstStructure *s; + gchar *sstr; + GST_LOCK (src); g_free (src->last_message); + if ((s = gst_event_get_structure (event))) + sstr = gst_structure_to_string (s); + else + sstr = g_strdup (""); + src->last_message = - g_strdup_printf ("event ******* E (type: %d) %p", - GST_EVENT_TYPE (event), event); + g_strdup_printf ("event ******* E (type: %d, %s) %p", + GST_EVENT_TYPE (event), sstr, event); + g_free (sstr); GST_UNLOCK (src); g_object_notify (G_OBJECT (src), "last_message"); diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index c3dd2dc..7a13a4a 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -240,12 +240,22 @@ gst_identity_event (GstBaseTransform * trans, GstEvent * event) identity = GST_IDENTITY (trans); if (!identity->silent) { + const GstStructure *s; + gchar *sstr; + GST_LOCK (identity); g_free (identity->last_message); + if ((s = gst_event_get_structure (event))) + sstr = gst_structure_to_string (s); + else + sstr = g_strdup (""); + identity->last_message = - g_strdup_printf ("chain ******* (%s:%s)E (type: %d) %p", - GST_DEBUG_PAD_NAME (trans->sinkpad), GST_EVENT_TYPE (event), event); + g_strdup_printf ("event ******* (%s:%s) E (type: %d, %s) %p", + GST_DEBUG_PAD_NAME (trans->sinkpad), GST_EVENT_TYPE (event), sstr, + event); + g_free (sstr); GST_UNLOCK (identity); g_object_notify (G_OBJECT (identity), "last_message"); -- 2.7.4