Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. diff --git a/plugins/elements/gstfakesink.c b/plugins/elements/gstfakesink.c
  2. index d480f92..3ecbf38 100644
  3. --- a/plugins/elements/gstfakesink.c
  4. +++ b/plugins/elements/gstfakesink.c
  5. @@ -398,18 +398,35 @@ gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event)
  6. if (!sink->silent) {
  7. const GstStructure *s;
  8. gchar *sstr;
  9. + const gchar *str_name;
  10.  
  11. GST_OBJECT_LOCK (sink);
  12. g_free (sink->last_message);
  13.  
  14. - if ((s = gst_event_get_structure (event)))
  15. + if ((s = gst_event_get_structure (event))) {
  16. sstr = gst_structure_to_string (s);
  17. - else
  18. + str_name = gst_structure_get_name (s);
  19. + } else {
  20. sstr = g_strdup ("");
  21. + str_name = "";
  22. + }
  23.  
  24. - sink->last_message =
  25. - g_strdup_printf ("event ******* E (type: %d, %s) %p",
  26. - GST_EVENT_TYPE (event), sstr, event);
  27. + if (!g_strcmp0 ("sink-message", str_name)) {
  28. + GstMessage *msg;
  29. + gchar *mstr;
  30. +
  31. + mstr = gst_structure_to_string (msg->structure);
  32. + gst_event_parse_sink_message (event, &msg);
  33. + sink->last_message =
  34. + g_strdup_printf ("message ******* M (type: %d, %s) %p",
  35. + GST_MESSAGE_TYPE (msg), mstr, msg);
  36. + gst_message_unref (msg);
  37. + g_free (mstr);
  38. + } else {
  39. + sink->last_message =
  40. + g_strdup_printf ("event ******* E (type: %d, %s) %p",
  41. + GST_EVENT_TYPE (event), sstr, event);
  42. + }
  43. g_free (sstr);
  44. GST_OBJECT_UNLOCK (sink);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement