tools/gst-inspect.c: Print the URI protocols and the URI type supported by the element.
authorSebastian Dröge <slomo@circular-chaos.org>
Sun, 20 Apr 2008 09:55:25 +0000 (09:55 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Sun, 20 Apr 2008 09:55:25 +0000 (09:55 +0000)
Original commit message from CVS:
* tools/gst-inspect.c: (print_uri_handler_info),
(print_element_info):
Print the URI protocols and the URI type supported by the element.

ChangeLog
tools/gst-inspect.c

index feb3538..ec0534d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-20  Sebastian Dröge  <slomo@circular-chaos.org>
+
+       * tools/gst-inspect.c: (print_uri_handler_info),
+       (print_element_info):
+       Print the URI protocols and the URI type supported by the element.
+
 2008-04-19  Sebastian Dröge  <slomo@circular-chaos.org>
 
        * gst/gsttaglist.c: (gst_tag_merge_strings_with_comma):
index a5db596..a9cb4bb 100644 (file)
@@ -718,6 +718,39 @@ print_index_info (GstElement * element)
 #endif
 
 static void
+print_uri_handler_info (GstElement * element)
+{
+  if (GST_IS_URI_HANDLER (element)) {
+    const gchar *uri_type;
+    gchar **uri_protocols;
+
+    if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element)) == GST_URI_SRC)
+      uri_type = "source";
+    else if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element)) ==
+        GST_URI_SINK)
+      uri_type = "sink";
+    else
+      uri_type = "unknown";
+
+    uri_protocols = gst_uri_handler_get_protocols (GST_URI_HANDLER (element));
+
+    n_print ("\n");
+    n_print ("URI handling capabilities:\n");
+    n_print ("  Element can act as %s.\n", uri_type);
+
+    if (uri_protocols && *uri_protocols) {
+      n_print ("  Supported URI protocols:\n");
+      for (; *uri_protocols != NULL; uri_protocols++)
+        n_print ("    %s\n", *uri_protocols);
+    } else {
+      n_print ("  No supported URI protocols\n");
+    }
+  } else {
+    n_print ("Element has no URI handling capabilities.\n");
+  }
+}
+
+static void
 print_pad_info (GstElement * element)
 {
   const GList *pads;
@@ -1159,6 +1192,7 @@ print_element_info (GstElementFactory * factory, gboolean print_names)
   print_implementation_info (element);
   print_clocking_info (element);
   print_index_info (element);
+  print_uri_handler_info (element);
   print_pad_info (element);
   print_element_properties_info (element);
   print_signal_info (element);