mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 09:42:19 +00:00
fakesink: Print sink-message events like a message and the GstMessage structure
This commit is contained in:
parent
16ce2d4ea4
commit
d2d42082c3
1 changed files with 19 additions and 7 deletions
|
@ -402,14 +402,26 @@ gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event)
|
||||||
GST_OBJECT_LOCK (sink);
|
GST_OBJECT_LOCK (sink);
|
||||||
g_free (sink->last_message);
|
g_free (sink->last_message);
|
||||||
|
|
||||||
if ((s = gst_event_get_structure (event)))
|
if (GST_EVENT_TYPE (event) == GST_EVENT_SINK_MESSAGE) {
|
||||||
sstr = gst_structure_to_string (s);
|
GstMessage *msg;
|
||||||
else
|
|
||||||
sstr = g_strdup ("");
|
|
||||||
|
|
||||||
sink->last_message =
|
gst_event_parse_sink_message (event, &msg);
|
||||||
g_strdup_printf ("event ******* E (type: %d, %s) %p",
|
sstr = gst_structure_to_string (msg->structure);
|
||||||
GST_EVENT_TYPE (event), sstr, event);
|
sink->last_message =
|
||||||
|
g_strdup_printf ("message ******* M (type: %d, %s) %p",
|
||||||
|
GST_MESSAGE_TYPE (msg), sstr, msg);
|
||||||
|
gst_message_unref (msg);
|
||||||
|
} else {
|
||||||
|
if ((s = gst_event_get_structure (event))) {
|
||||||
|
sstr = gst_structure_to_string (s);
|
||||||
|
} else {
|
||||||
|
sstr = g_strdup ("");
|
||||||
|
}
|
||||||
|
|
||||||
|
sink->last_message =
|
||||||
|
g_strdup_printf ("event ******* E (type: %d, %s) %p",
|
||||||
|
GST_EVENT_TYPE (event), sstr, event);
|
||||||
|
}
|
||||||
g_free (sstr);
|
g_free (sstr);
|
||||||
GST_OBJECT_UNLOCK (sink);
|
GST_OBJECT_UNLOCK (sink);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue