Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / gst / gstinfo.c
index 5062239..ca4c003 100644 (file)
@@ -158,7 +158,6 @@ GstDebugCategory *GST_CAT_PLUGIN_LOADING = NULL;
 GstDebugCategory *GST_CAT_PLUGIN_INFO = NULL;
 GstDebugCategory *GST_CAT_PROPERTIES = NULL;
 GstDebugCategory *GST_CAT_TYPES = NULL;
-GstDebugCategory *GST_CAT_XML = NULL;
 GstDebugCategory *GST_CAT_NEGOTIATION = NULL;
 GstDebugCategory *GST_CAT_REFCOUNTING = NULL;
 GstDebugCategory *GST_CAT_ERROR_SYSTEM = NULL;
@@ -394,8 +393,6 @@ _gst_debug_init (void)
       GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_BLUE, NULL);
   GST_CAT_TYPES = _gst_debug_category_new ("GST_TYPES",
       GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, NULL);
-  GST_CAT_XML = _gst_debug_category_new ("GST_XML",
-      GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, NULL);
   GST_CAT_NEGOTIATION = _gst_debug_category_new ("GST_NEGOTIATION",
       GST_DEBUG_BOLD | GST_DEBUG_FG_BLUE, NULL);
   GST_CAT_REFCOUNTING = _gst_debug_category_new ("GST_REFCOUNTING",
@@ -596,7 +593,7 @@ structure_to_pretty_string (const GstStructure * s)
 }
 
 static inline gchar *
-gst_info_structure_to_string (GstStructure * s)
+gst_info_structure_to_string (const GstStructure * s)
 {
   if (G_UNLIKELY (pretty_tags && s->name == GST_QUARK (TAGLIST)))
     return structure_to_pretty_string (s);
@@ -627,10 +624,10 @@ gst_debug_print_object (gpointer ptr)
     return g_strdup ("(NULL)");
   }
   if (*(GType *) ptr == GST_TYPE_CAPS) {
-    return gst_caps_to_string ((GstCaps *) ptr);
+    return gst_caps_to_string ((const GstCaps *) ptr);
   }
   if (*(GType *) ptr == GST_TYPE_STRUCTURE) {
-    return gst_info_structure_to_string ((GstStructure *) ptr);
+    return gst_info_structure_to_string ((const GstStructure *) ptr);
   }
 #ifdef USE_POISONING
   if (*(guint32 *) ptr == 0xffffffff) {
@@ -649,9 +646,12 @@ gst_debug_print_object (gpointer ptr)
   if (GST_IS_MESSAGE (object)) {
     GstMessage *msg = GST_MESSAGE_CAST (object);
     gchar *s, *ret;
+    const GstStructure *structure;
+
+    structure = gst_message_get_structure (msg);
 
-    if (msg->structure) {
-      s = gst_info_structure_to_string (msg->structure);
+    if (structure) {
+      s = gst_info_structure_to_string (structure);
     } else {
       s = g_strdup ("(NULL)");
     }
@@ -664,9 +664,12 @@ gst_debug_print_object (gpointer ptr)
   }
   if (GST_IS_QUERY (object)) {
     GstQuery *query = GST_QUERY_CAST (object);
+    const GstStructure *structure;
+
+    structure = gst_query_get_structure (query);
 
-    if (query->structure) {
-      return gst_info_structure_to_string (query->structure);
+    if (structure) {
+      return gst_info_structure_to_string (structure);
     } else {
       const gchar *query_type_name;
 
@@ -681,18 +684,18 @@ gst_debug_print_object (gpointer ptr)
   if (GST_IS_EVENT (object)) {
     GstEvent *event = GST_EVENT_CAST (object);
     gchar *s, *ret;
+    GstStructure *structure;
 
-    if (event->structure) {
-      s = gst_info_structure_to_string (event->structure);
+    structure = (GstStructure *) gst_event_get_structure (event);
+    if (structure) {
+      s = gst_info_structure_to_string (structure);
     } else {
       s = g_strdup ("(NULL)");
     }
 
-    ret = g_strdup_printf ("%s event from '%s' at time %"
+    ret = g_strdup_printf ("%s event at time %"
         GST_TIME_FORMAT ": %s",
-        GST_EVENT_TYPE_NAME (event), (event->src != NULL) ?
-        GST_OBJECT_NAME (event->src) : "(NULL)",
-        GST_TIME_ARGS (event->timestamp), s);
+        GST_EVENT_TYPE_NAME (event), GST_TIME_ARGS (event->timestamp), s);
     g_free (s);
     return ret;
   }
@@ -718,13 +721,11 @@ gst_debug_print_segment (gpointer ptr)
     }
     case GST_FORMAT_TIME:{
       return g_strdup_printf ("time segment start=%" GST_TIME_FORMAT
-          ", stop=%" GST_TIME_FORMAT ", last_stop=%" GST_TIME_FORMAT
-          ", duration=%" GST_TIME_FORMAT ", rate=%f, applied_rate=%f"
-          ", flags=0x%02x, time=%" GST_TIME_FORMAT ", accum=%" GST_TIME_FORMAT,
+          ", stop=%" GST_TIME_FORMAT ", rate=%f, applied_rate=%f"
+          ", flags=0x%02x, time=%" GST_TIME_FORMAT ", base=%" GST_TIME_FORMAT,
           GST_TIME_ARGS (segment->start), GST_TIME_ARGS (segment->stop),
-          GST_TIME_ARGS (segment->last_stop), GST_TIME_ARGS (segment->duration),
           segment->rate, segment->applied_rate, (guint) segment->flags,
-          GST_TIME_ARGS (segment->time), GST_TIME_ARGS (segment->accum));
+          GST_TIME_ARGS (segment->time), GST_TIME_ARGS (segment->base));
     }
     default:{
       const gchar *format_name;
@@ -733,13 +734,11 @@ gst_debug_print_segment (gpointer ptr)
       if (G_UNLIKELY (format_name == NULL))
         format_name = "(UNKNOWN FORMAT)";
       return g_strdup_printf ("%s segment start=%" G_GINT64_FORMAT
-          ", stop=%" G_GINT64_FORMAT ", last_stop=%" G_GINT64_FORMAT
-          ", duration=%" G_GINT64_FORMAT ", rate=%f, applied_rate=%f"
-          ", flags=0x%02x, time=%" GST_TIME_FORMAT ", accum=%" GST_TIME_FORMAT,
-          format_name, segment->start, segment->stop, segment->last_stop,
-          segment->duration, segment->rate, segment->applied_rate,
-          (guint) segment->flags, GST_TIME_ARGS (segment->time),
-          GST_TIME_ARGS (segment->accum));
+          ", stop=%" G_GINT64_FORMAT ", rate=%f, applied_rate=%f"
+          ", flags=0x%02x, time=%" GST_TIME_FORMAT ", base=%" GST_TIME_FORMAT,
+          format_name, segment->start, segment->stop, segment->rate,
+          segment->applied_rate, (guint) segment->flags,
+          GST_TIME_ARGS (segment->time), GST_TIME_ARGS (segment->base));
     }
   }
 }