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

This commit is contained in:
Sebastian Dröge 2012-01-27 11:01:27 +01:00
parent ad28f9fb68
commit 23ff3a8f53
3 changed files with 15 additions and 7 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);