[0.11] gstreamer: identity/fake{src, sink}: Include event type name in the debug output

Sebastian Dröge slomo at kemper.freedesktop.org
Fri Jan 27 02:02:30 PST 2012


Module: gstreamer
Branch: 0.11
Commit: 23ff3a8f53765a5fbdb8a94a74811dfbe44a97c0
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=23ff3a8f53765a5fbdb8a94a74811dfbe44a97c0

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Fri Jan 27 11:01:27 2012 +0100

identity/fake{src,sink}: Include event type name in the debug output

---

 plugins/elements/gstfakesink.c |    7 +++++--
 plugins/elements/gstfakesrc.c  |    7 +++++--
 plugins/elements/gstidentity.c |    8 +++++---
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/plugins/elements/gstfakesink.c b/plugins/elements/gstfakesink.c
index e2faef8..b3ad39b 100644
--- a/plugins/elements/gstfakesink.c
+++ b/plugins/elements/gstfakesink.c
@@ -371,6 +371,7 @@ gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event)
 
   if (!sink->silent) {
     const GstStructure *s;
+    const gchar *tstr;
     gchar *sstr;
 
     GST_OBJECT_LOCK (sink);
@@ -389,6 +390,8 @@ gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event)
           GST_MESSAGE_TYPE (msg), sstr, msg);
       gst_message_unref (msg);
     } else {
+      tstr = gst_event_type_get_name (GST_EVENT_TYPE (event));
+
       if ((s = gst_event_get_structure (event))) {
         sstr = gst_structure_to_string (s);
       } else {
@@ -396,9 +399,9 @@ gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event)
       }
 
       sink->last_message =
-          g_strdup_printf ("event   ******* (%s:%s) E (type: %d, %s) %p",
+          g_strdup_printf ("event   ******* (%s:%s) E (type: %s (%d), %s) %p",
           GST_DEBUG_PAD_NAME (GST_BASE_SINK_CAST (sink)->sinkpad),
-          GST_EVENT_TYPE (event), sstr, event);
+          tstr, GST_EVENT_TYPE (event), sstr, event);
     }
     g_free (sstr);
     GST_OBJECT_UNLOCK (sink);
diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c
index c3dc817..a289394 100644
--- a/plugins/elements/gstfakesrc.c
+++ b/plugins/elements/gstfakesrc.c
@@ -429,20 +429,23 @@ gst_fake_src_event_handler (GstBaseSrc * basesrc, GstEvent * event)
 
   if (!src->silent) {
     const GstStructure *s;
+    const gchar *tstr;
     gchar *sstr;
 
     GST_OBJECT_LOCK (src);
     g_free (src->last_message);
 
+    tstr = gst_event_type_get_name (GST_EVENT_TYPE (event));
+
     if ((s = gst_event_get_structure (event)))
       sstr = gst_structure_to_string (s);
     else
       sstr = g_strdup ("");
 
     src->last_message =
-        g_strdup_printf ("event   ******* (%s:%s) E (type: %d, %s) %p",
+        g_strdup_printf ("event   ******* (%s:%s) E (type: %s (%d), %s) %p",
         GST_DEBUG_PAD_NAME (GST_BASE_SRC_CAST (src)->srcpad),
-        GST_EVENT_TYPE (event), sstr, event);
+        tstr, GST_EVENT_TYPE (event), sstr, event);
     g_free (sstr);
     GST_OBJECT_UNLOCK (src);
 
diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c
index d45a592..a7268b1 100644
--- a/plugins/elements/gstidentity.c
+++ b/plugins/elements/gstidentity.c
@@ -313,20 +313,22 @@ gst_identity_sink_event (GstBaseTransform * trans, GstEvent * event)
 
   if (!identity->silent) {
     const GstStructure *s;
+    const gchar *tstr;
     gchar *sstr;
 
     GST_OBJECT_LOCK (identity);
     g_free (identity->last_message);
 
+    tstr = gst_event_type_get_name (GST_EVENT_TYPE (event));
     if ((s = gst_event_get_structure (event)))
       sstr = gst_structure_to_string (s);
     else
       sstr = g_strdup ("");
 
     identity->last_message =
-        g_strdup_printf ("event   ******* (%s:%s) E (type: %d, %s) %p",
-        GST_DEBUG_PAD_NAME (trans->sinkpad), GST_EVENT_TYPE (event), sstr,
-        event);
+        g_strdup_printf ("event   ******* (%s:%s) E (type: %s (%d), %s) %p",
+        GST_DEBUG_PAD_NAME (trans->sinkpad), tstr, GST_EVENT_TYPE (event),
+        sstr, event);
     g_free (sstr);
     GST_OBJECT_UNLOCK (identity);
 



More information about the gstreamer-commits mailing list