factory->uri_type = iface->get_type (factory->type);
if (!GST_URI_TYPE_IS_VALID (factory->uri_type))
goto urierror;
- if (iface->get_protocols)
- factory->uri_protocols = iface->get_protocols (factory->type);
+ if (iface->get_protocols) {
+ const gchar *const *protocols;
+
+ protocols = iface->get_protocols (factory->type);
+ factory->uri_protocols = g_strdupv ((gchar **) protocols);
+ }
if (!factory->uri_protocols)
goto urierror;
}
* Returns: (transfer none) (array zero-terminated=1): the supported protocols
* or NULL
*/
-gchar **
+const gchar *const *
gst_element_factory_get_uri_protocols (GstElementFactory * factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
- return factory->uri_protocols;
+ return (const gchar * const *) factory->uri_protocols;
}
/**
const GList * gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
GstURIType gst_element_factory_get_uri_type (GstElementFactory *factory);
-gchar ** gst_element_factory_get_uri_protocols (GstElementFactory *factory);
+const gchar * const * gst_element_factory_get_uri_protocols (GstElementFactory *factory);
gboolean gst_element_factory_has_interface (GstElementFactory *factory,
const gchar *interfacename);
static gboolean
search_by_entry (GstPluginFeature * feature, gpointer search_entry)
{
- gchar **protocols;
+ const gchar *const *protocols;
GstElementFactory *factory;
SearchEntry *entry = (SearchEntry *) search_entry;
* supported protocols. Returns NULL if the @handler isn't implemented
* properly, or the @handler doesn't support any protocols.
*/
-gchar **
+const gchar *const *
gst_uri_handler_get_protocols (GstURIHandler * handler)
{
GstURIHandlerInterface *iface;
- gchar **ret;
+ const gchar *const *ret;
g_return_val_if_fail (GST_IS_URI_HANDLER (handler), NULL);
*
* Gets the currently handled URI.
*
- * Returns: (transfer none): the URI currently handled by the @handler.
+ * Returns: (transfer full): the URI currently handled by the @handler.
* Returns NULL if there are no URI currently handled. The
- * returned string must not be modified or freed.
+ * returned string must be freed with g_free() when no longer needed.
*/
gchar *
gst_uri_handler_get_uri (GstURIHandler * handler)
protocol = gst_uri_get_protocol (uri);
if (iface->get_protocols) {
- gchar **p, **protocols;
+ const gchar *const *protocols;
+ const gchar *const *p;
gboolean found_protocol = FALSE;
protocols = iface->get_protocols (G_OBJECT_TYPE (handler));
/*< public >*/
/* querying capabilities */
GstURIType (* get_type) (GType type);
- gchar ** (* get_protocols) (GType type);
+ const gchar * const * (* get_protocols) (GType type);
/* using the interface */
gchar * (* get_uri) (GstURIHandler * handler);
GType gst_uri_handler_get_type (void);
GstURIType gst_uri_handler_get_uri_type (GstURIHandler * handler);
-gchar ** gst_uri_handler_get_protocols (GstURIHandler * handler);
+const gchar * const * gst_uri_handler_get_protocols (GstURIHandler * handler);
gchar * gst_uri_handler_get_uri (GstURIHandler * handler);
gboolean gst_uri_handler_set_uri (GstURIHandler * handler,
const gchar * uri,