From: Tim-Philipp Müller Date: Sun, 13 Nov 2011 23:25:23 +0000 (+0000) Subject: plugins, tools: update for get_protocols() return value change X-Git-Tag: RELEASE-0.11.2~447 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=f5988567652d91005f91a9e3247dab7bced00a89;p=platform%2Fupstream%2Fgstreamer.git plugins, tools: update for get_protocols() return value change --- diff --git a/plugins/elements/gstfdsink.c b/plugins/elements/gstfdsink.c index 4441d96..6e0036c 100644 --- a/plugins/elements/gstfdsink.c +++ b/plugins/elements/gstfdsink.c @@ -591,10 +591,10 @@ gst_fd_sink_uri_get_type (GType type) return GST_URI_SINK; } -static gchar ** +static const gchar *const * gst_fd_sink_uri_get_protocols (GType type) { - static gchar *protocols[] = { (char *) "fd", NULL }; + static const gchar *protocols[] = { "fd", NULL }; return protocols; } diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index a54582a..f059ee0 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -605,10 +605,10 @@ gst_fd_src_uri_get_type (GType type) return GST_URI_SRC; } -static gchar ** +static const gchar *const * gst_fd_src_uri_get_protocols (GType type) { - static gchar *protocols[] = { (char *) "fd", NULL }; + static const gchar *protocols[] = { "fd", NULL }; return protocols; } diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index 76a807d..c3c9fdd 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -689,10 +689,10 @@ gst_file_sink_uri_get_type (GType type) return GST_URI_SINK; } -static gchar ** +static const gchar *const * gst_file_sink_uri_get_protocols (GType type) { - static gchar *protocols[] = { (char *) "file", NULL }; + static const gchar *protocols[] = { "file", NULL }; return protocols; } diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 02bd3f4..165031a 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -582,10 +582,10 @@ gst_file_src_uri_get_type (GType type) return GST_URI_SRC; } -static gchar ** +static const gchar *const * gst_file_src_uri_get_protocols (GType type) { - static gchar *protocols[] = { (char *) "file", NULL }; + static const gchar *protocols[] = { "file", NULL }; return protocols; } diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index bc4c618..fc173a8 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -690,8 +690,8 @@ static void print_uri_handler_info (GstElement * element) { if (GST_IS_URI_HANDLER (element)) { + const gchar *const *uri_protocols; const gchar *uri_type; - gchar **uri_protocols; if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element)) == GST_URI_SRC) uri_type = "source"; @@ -1090,8 +1090,9 @@ print_all_uri_handlers (void) } if (GST_IS_URI_HANDLER (element)) { + const gchar *const *uri_protocols; const gchar *dir; - gchar **uri_protocols, *joined; + gchar *joined; switch (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element))) { case GST_URI_SRC: @@ -1107,7 +1108,7 @@ print_all_uri_handlers (void) uri_protocols = gst_uri_handler_get_protocols (GST_URI_HANDLER (element)); - joined = g_strjoinv (", ", uri_protocols); + joined = g_strjoinv (", ", (gchar **) uri_protocols); g_print ("%s (%s, rank %u): %s\n", gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)), dir, @@ -1392,23 +1393,26 @@ print_plugin_automatic_install_info_codecs (GstElementFactory * factory) static void print_plugin_automatic_install_info_protocols (GstElementFactory * factory) { - gchar **protocols, **p; + const gchar *const *protocols; protocols = gst_element_factory_get_uri_protocols (factory); if (protocols != NULL && *protocols != NULL) { switch (gst_element_factory_get_uri_type (factory)) { case GST_URI_SINK: - for (p = protocols; *p != NULL; ++p) - g_print ("urisink-%s\n", *p); + while (*protocols != NULL) { + g_print ("urisink-%s\n", *protocols); + ++protocols; + } break; case GST_URI_SRC: - for (p = protocols; *p != NULL; ++p) - g_print ("urisource-%s\n", *p); + while (*protocols != NULL) { + g_print ("urisource-%s\n", *protocols); + ++protocols; + } break; default: break; } - g_strfreev (protocols); } }