ec8f2e50e9cc14b0f1f774747883efc8da20f0b2
[platform/upstream/gstreamer.git] / gst / gsturi.c
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wtay@chello.be>
4  *
5  * gsturi.c: register URI handlers
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 /**
24  * SECTION:gsturihandler
25  * @short_description: Interface to ease URI handling in plugins.
26  *
27  * The URIHandler is an interface that is implemented by Source and Sink 
28  * #GstElement to simplify then handling of URI.
29  *
30  * An application can use the following functions to quickly get an element
31  * that handles the given URI for reading or writing
32  * (gst_element_make_from_uri()).
33  *
34  * Source and Sink plugins should implement this interface when possible.
35  *
36  * Last reviewed on 2005-11-09 (0.9.4)
37  */
38
39 #ifdef HAVE_CONFIG_H
40 #  include "config.h"
41 #endif
42
43 #include "gst_private.h"
44 #include "gsturi.h"
45 #include "gstinfo.h"
46 #include "gstmarshal.h"
47 #include "gstregistry.h"
48
49 #include <string.h>
50
51 GST_DEBUG_CATEGORY_STATIC (gst_uri_handler_debug);
52 #define GST_CAT_DEFAULT gst_uri_handler_debug
53
54 static void gst_uri_handler_base_init (gpointer g_class);
55
56 GType
57 gst_uri_handler_get_type (void)
58 {
59   static GType urihandler_type = 0;
60
61   if (G_UNLIKELY (urihandler_type == 0)) {
62     static const GTypeInfo urihandler_info = {
63       sizeof (GstURIHandlerInterface),
64       gst_uri_handler_base_init,
65       NULL,
66       NULL,
67       NULL,
68       NULL,
69       0,
70       0,
71       NULL,
72       NULL
73     };
74
75     urihandler_type = g_type_register_static (G_TYPE_INTERFACE,
76         "GstURIHandler", &urihandler_info, 0);
77
78     GST_DEBUG_CATEGORY_INIT (gst_uri_handler_debug, "GST_URI", GST_DEBUG_BOLD,
79         "handling of URIs");
80   }
81   return urihandler_type;
82 }
83 static void
84 gst_uri_handler_base_init (gpointer g_class)
85 {
86   static gboolean initialized = FALSE;
87
88   if (G_UNLIKELY (!initialized)) {
89
90     /**
91      * GstURIHandler::new-uri:
92      * @handler: The #GstURIHandler which emitted the signal
93      * @uri: The new URI, or NULL if the URI was removed
94      *
95      * The URI of the given @handler has changed.
96      */
97
98     g_signal_new ("new-uri", GST_TYPE_URI_HANDLER, G_SIGNAL_RUN_LAST,
99         G_STRUCT_OFFSET (GstURIHandlerInterface, new_uri), NULL, NULL,
100         gst_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
101     initialized = TRUE;
102   }
103 }
104
105 static const guchar acceptable[96] = {  /* X0   X1   X2   X3   X4   X5   X6   X7   X8   X9   XA   XB   XC   XD   XE   XF */
106   0x00, 0x3F, 0x20, 0x20, 0x20, 0x00, 0x2C, 0x3F, 0x3F, 0x3F, 0x3F, 0x22, 0x20, 0x3F, 0x3F, 0x1C,       /* 2X  !"#$%&'()*+,-./   */
107   0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x38, 0x20, 0x20, 0x2C, 0x20, 0x2C,       /* 3X 0123456789:;<=>?   */
108   0x30, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,       /* 4X @ABCDEFGHIJKLMNO   */
109   0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x20, 0x20, 0x20, 0x20, 0x3F,       /* 5X PQRSTUVWXYZ[\]^_   */
110   0x20, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,       /* 6X `abcdefghijklmno   */
111   0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x20, 0x20, 0x20, 0x3F, 0x20        /* 7X pqrstuvwxyz{|}~DEL */
112 };
113
114 typedef enum
115 {
116   UNSAFE_ALL = 0x1,             /* Escape all unsafe characters   */
117   UNSAFE_ALLOW_PLUS = 0x2,      /* Allows '+'  */
118   UNSAFE_PATH = 0x4,            /* Allows '/' and '?' and '&' and '='  */
119   UNSAFE_DOS_PATH = 0x8,        /* Allows '/' and '?' and '&' and '=' and ':' */
120   UNSAFE_HOST = 0x10,           /* Allows '/' and ':' and '@' */
121   UNSAFE_SLASHES = 0x20         /* Allows all characters except for '/' and '%' */
122 } UnsafeCharacterSet;
123
124 #define HEX_ESCAPE '%'
125
126 /*  Escape undesirable characters using %
127  *  -------------------------------------
128  *
129  * This function takes a pointer to a string in which
130  * some characters may be unacceptable unescaped.
131  * It returns a string which has these characters
132  * represented by a '%' character followed by two hex digits.
133  *
134  * This routine returns a g_malloced string.
135  */
136
137 static const gchar hex[16] = "0123456789ABCDEF";
138
139 static gchar *
140 escape_string_internal (const gchar * string, UnsafeCharacterSet mask)
141 {
142 #define ACCEPTABLE_CHAR(a) ((a)>=32 && (a)<128 && (acceptable[(a)-32] & use_mask))
143
144   const gchar *p;
145   gchar *q;
146   gchar *result;
147   guchar c;
148   gint unacceptable;
149   UnsafeCharacterSet use_mask;
150
151   g_return_val_if_fail (mask == UNSAFE_ALL
152       || mask == UNSAFE_ALLOW_PLUS
153       || mask == UNSAFE_PATH
154       || mask == UNSAFE_DOS_PATH
155       || mask == UNSAFE_HOST || mask == UNSAFE_SLASHES, NULL);
156
157   if (string == NULL) {
158     return NULL;
159   }
160
161   unacceptable = 0;
162   use_mask = mask;
163   for (p = string; *p != '\0'; p++) {
164     c = *p;
165     if (!ACCEPTABLE_CHAR (c)) {
166       unacceptable++;
167     }
168     if ((use_mask == UNSAFE_HOST) && (unacceptable || (c == '/'))) {
169       /* when escaping a host, if we hit something that needs to be escaped, or we finally
170        * hit a path separator, revert to path mode (the host segment of the url is over).
171        */
172       use_mask = UNSAFE_PATH;
173     }
174   }
175
176   result = g_malloc (p - string + unacceptable * 2 + 1);
177
178   use_mask = mask;
179   for (q = result, p = string; *p != '\0'; p++) {
180     c = *p;
181
182     if (!ACCEPTABLE_CHAR (c)) {
183       *q++ = HEX_ESCAPE;        /* means hex coming */
184       *q++ = hex[c >> 4];
185       *q++ = hex[c & 15];
186     } else {
187       *q++ = c;
188     }
189     if ((use_mask == UNSAFE_HOST) && (!ACCEPTABLE_CHAR (c) || (c == '/'))) {
190       use_mask = UNSAFE_PATH;
191     }
192   }
193
194   *q = '\0';
195
196   return result;
197 }
198
199 /**
200  * escape_string:
201  * @string: string to be escaped
202  *
203  * Escapes @string, replacing any and all special characters
204  * with equivalent escape sequences.
205  *
206  * Return value: a newly allocated string equivalent to @string
207  * but with all special characters escaped
208  **/
209 static gchar *
210 escape_string (const gchar * string)
211 {
212   return escape_string_internal (string, UNSAFE_ALL);
213 }
214
215 static int
216 hex_to_int (gchar c)
217 {
218   return c >= '0' && c <= '9' ? c - '0'
219       : c >= 'A' && c <= 'F' ? c - 'A' + 10
220       : c >= 'a' && c <= 'f' ? c - 'a' + 10 : -1;
221 }
222
223 static int
224 unescape_character (const char *scanner)
225 {
226   int first_digit;
227   int second_digit;
228
229   first_digit = hex_to_int (*scanner++);
230   if (first_digit < 0) {
231     return -1;
232   }
233
234   second_digit = hex_to_int (*scanner++);
235   if (second_digit < 0) {
236     return -1;
237   }
238
239   return (first_digit << 4) | second_digit;
240 }
241
242 /**
243  * unescape_string:
244  * @escaped_string: an escaped URI, path, or other string
245  * @illegal_characters: a string containing a sequence of characters
246  * considered "illegal", '\0' is automatically in this list.
247  *
248  * Decodes escaped characters (i.e. PERCENTxx sequences) in @escaped_string.
249  * Characters are encoded in PERCENTxy form, where xy is the ASCII hex code
250  * for character 16x+y.
251  *
252  * Return value: a newly allocated string with the unescaped equivalents,
253  * or %NULL if @escaped_string contained one of the characters
254  * in @illegal_characters.
255  **/
256 static char *
257 unescape_string (const gchar * escaped_string, const gchar * illegal_characters)
258 {
259   const gchar *in;
260   gchar *out, *result;
261   gint character;
262
263   if (escaped_string == NULL) {
264     return NULL;
265   }
266
267   result = g_malloc (strlen (escaped_string) + 1);
268
269   out = result;
270   for (in = escaped_string; *in != '\0'; in++) {
271     character = *in;
272     if (*in == HEX_ESCAPE) {
273       character = unescape_character (in + 1);
274
275       /* Check for an illegal character. We consider '\0' illegal here. */
276       if (character <= 0
277           || (illegal_characters != NULL
278               && strchr (illegal_characters, (char) character) != NULL)) {
279         g_free (result);
280         return NULL;
281       }
282       in += 2;
283     }
284     *out++ = (char) character;
285   }
286
287   *out = '\0';
288   g_assert ((size_t) (out - result) <= strlen (escaped_string));
289   return result;
290
291 }
292
293
294 static void
295 gst_uri_protocol_check_internal (const gchar * uri, gchar ** endptr)
296 {
297   gchar *check = (gchar *) uri;
298
299   g_assert (uri != NULL);
300   g_assert (endptr != NULL);
301
302   if (g_ascii_isalpha (*check)) {
303     check++;
304     while (g_ascii_isalnum (*check))
305       check++;
306   }
307
308   *endptr = check;
309 }
310
311 /**
312  * gst_uri_protocol_is_valid:
313  * @protocol: A string
314  *
315  * Tests if the given string is a valid protocol identifier. Protocols
316  * must consist of alphanumeric characters and not start with a number.
317  *
318  * Returns: TRUE if the string is a valid protocol identifier, FALSE otherwise.
319  */
320 gboolean
321 gst_uri_protocol_is_valid (const gchar * protocol)
322 {
323   gchar *endptr;
324
325   g_return_val_if_fail (protocol != NULL, FALSE);
326
327   gst_uri_protocol_check_internal (protocol, &endptr);
328
329   return *endptr == '\0' && endptr != protocol;
330 }
331
332 /**
333  * gst_uri_is_valid:
334  * @uri: A URI string
335  *
336  * Tests if the given string is a valid URI identifier. URIs start with a valid
337  * protocol followed by "://" and maybe a string identifying the location.
338  *
339  * Returns: TRUE if the string is a valid URI
340  */
341 gboolean
342 gst_uri_is_valid (const gchar * uri)
343 {
344   gchar *endptr;
345
346   g_return_val_if_fail (uri != NULL, FALSE);
347
348   gst_uri_protocol_check_internal (uri, &endptr);
349
350   return (*endptr == ':' && *(endptr + 1) == '/' && *(endptr + 2) == '/');
351 }
352
353 /**
354  * gst_uri_get_protocol:
355  * @uri: A URI string
356  *
357  * Extracts the protocol out of a given valid URI. The returned string must be
358  * freed using g_free().
359  *
360  * Returns: The protocol for this URI.
361  */
362 gchar *
363 gst_uri_get_protocol (const gchar * uri)
364 {
365   gchar *colon;
366
367   g_return_val_if_fail (uri != NULL, NULL);
368   g_return_val_if_fail (gst_uri_is_valid (uri), NULL);
369
370   colon = strstr (uri, "://");
371
372   return g_strdown (g_strndup (uri, colon - uri));
373 }
374
375 /**
376  * gst_uri_has_protocol:
377  * @uri: an URI string
378  * @protocol: a protocol string (e.g. "http")
379  *
380  * Checks if the protocol of a given valid URI matches @protocol.
381  *
382  * Returns: %TRUE if the protocol matches.
383  *
384  * Since: 0.10.4
385  */
386 gboolean
387 gst_uri_has_protocol (const gchar * uri, const gchar * protocol)
388 {
389   gchar *colon;
390
391   g_return_val_if_fail (uri != NULL, FALSE);
392   g_return_val_if_fail (protocol != NULL, FALSE);
393   g_return_val_if_fail (gst_uri_is_valid (uri), FALSE);
394
395   colon = strstr (uri, "://");
396
397   if (colon == NULL)
398     return FALSE;
399
400   return (strncmp (uri, protocol, (size_t) (colon - uri)) == 0);
401 }
402
403 /**
404  * gst_uri_get_location:
405  * @uri: A URI string
406  *
407  * Extracts the location out of a given valid URI. So the protocol and "://"
408  * are stripped from the URI. The returned string must be freed using
409  * g_free().
410  *
411  * Returns: The location for this URI. Returns NULL if the URI isn't valid.
412  */
413 gchar *
414 gst_uri_get_location (const gchar * uri)
415 {
416   gchar *colon;
417   gchar *location, *unescaped;
418
419   g_return_val_if_fail (uri != NULL, NULL);
420   g_return_val_if_fail (gst_uri_is_valid (uri), NULL);
421
422   colon = strstr (uri, "://");
423
424   location = g_strdup (colon + 3);
425
426   unescaped = unescape_string (location, "/");
427   g_free (location);
428
429   return unescaped;
430 }
431
432 /**
433  * gst_uri_construct:
434  * @protocol: Protocol for URI
435  * @location: Location for URI
436  *
437  * Constructs a URI for a given valid protocol and location.
438  *
439  * Returns: a new string for this URI. Returns NULL if the given URI protocol
440  * is not valid, or the given location is NULL.
441  */
442 gchar *
443 gst_uri_construct (const gchar * protocol, const gchar * location)
444 {
445   char *escaped;
446   char *retval;
447
448   g_return_val_if_fail (gst_uri_protocol_is_valid (protocol), NULL);
449   g_return_val_if_fail (location != NULL, NULL);
450
451   escaped = escape_string (location);
452   retval = g_strdup_printf ("%s://%s", protocol, escaped);
453   g_free (escaped);
454
455   return retval;
456 }
457
458 typedef struct
459 {
460   GstURIType type;
461   const gchar *protocol;
462 }
463 SearchEntry;
464
465 static gboolean
466 search_by_entry (GstPluginFeature * feature, gpointer search_entry)
467 {
468   gchar **protocols;
469   GstElementFactory *factory;
470   SearchEntry *entry = (SearchEntry *) search_entry;
471
472   if (!GST_IS_ELEMENT_FACTORY (feature))
473     return FALSE;
474   factory = GST_ELEMENT_FACTORY (feature);
475
476   if (gst_element_factory_get_uri_type (factory) != entry->type)
477     return FALSE;
478
479   protocols = gst_element_factory_get_uri_protocols (factory);
480
481   if (protocols == NULL) {
482     g_warning ("Factory '%s' implements GstUriHandler interface but returned "
483         "no supported protocols!", gst_plugin_feature_get_name (feature));
484     return FALSE;
485   }
486
487   while (*protocols != NULL) {
488     if (g_ascii_strcasecmp (*protocols, entry->protocol) == 0)
489       return TRUE;
490     protocols++;
491   }
492   return FALSE;
493 }
494
495 static gint
496 sort_by_rank (gconstpointer a, gconstpointer b)
497 {
498   GstPluginFeature *first = GST_PLUGIN_FEATURE (a);
499   GstPluginFeature *second = GST_PLUGIN_FEATURE (b);
500
501   return gst_plugin_feature_get_rank (second) -
502       gst_plugin_feature_get_rank (first);
503 }
504
505 static GList *
506 get_element_factories_from_uri_protocol (const GstURIType type,
507     const gchar * protocol)
508 {
509   GList *possibilities;
510   SearchEntry entry;
511
512   g_return_val_if_fail (protocol, NULL);
513
514   entry.type = type;
515   entry.protocol = protocol;
516   possibilities = gst_registry_feature_filter (gst_registry_get_default (),
517       search_by_entry, FALSE, &entry);
518
519   return possibilities;
520 }
521
522 /**
523  * gst_uri_protocol_is_supported:
524  * @type: Whether to check for a source or a sink
525  * @protocol: Protocol that should be checked for (e.g. "http" or "smb")
526  *
527  * Checks if an element exists that supports the given URI protocol. Note
528  * that a positive return value does not imply that a subsequent call to
529  * gst_element_make_from_uri() is guaranteed to work.
530  *
531  * Returns: TRUE
532  *
533  * Since: 0.10.13
534 */
535 gboolean
536 gst_uri_protocol_is_supported (const GstURIType type, const gchar * protocol)
537 {
538   GList *possibilities;
539
540   g_return_val_if_fail (protocol, FALSE);
541
542   possibilities = get_element_factories_from_uri_protocol (type, protocol);
543
544   if (possibilities) {
545     g_list_free (possibilities);
546     return TRUE;
547   } else
548     return FALSE;
549 }
550
551 /**
552  * gst_element_make_from_uri:
553  * @type: Whether to create a source or a sink
554  * @uri: URI to create an element for
555  * @elementname: Name of created element, can be NULL.
556  *
557  * Creates an element for handling the given URI.
558  *
559  * Returns: a new element or NULL if none could be created
560  */
561 GstElement *
562 gst_element_make_from_uri (const GstURIType type, const gchar * uri,
563     const gchar * elementname)
564 {
565   GList *possibilities, *walk;
566   gchar *protocol;
567   GstElement *ret = NULL;
568
569   g_return_val_if_fail (GST_URI_TYPE_IS_VALID (type), NULL);
570   g_return_val_if_fail (gst_uri_is_valid (uri), NULL);
571
572   protocol = gst_uri_get_protocol (uri);
573   possibilities = get_element_factories_from_uri_protocol (type, protocol);
574   g_free (protocol);
575
576   if (!possibilities) {
577     GST_DEBUG ("No %s for URI '%s'", type == GST_URI_SINK ? "sink" : "source",
578         uri);
579     return NULL;
580   }
581
582   possibilities = g_list_sort (possibilities, sort_by_rank);
583   walk = possibilities;
584   while (walk) {
585     if ((ret = gst_element_factory_create (GST_ELEMENT_FACTORY (walk->data),
586                 elementname)) != NULL) {
587       GstURIHandler *handler = GST_URI_HANDLER (ret);
588
589       if (gst_uri_handler_set_uri (handler, uri))
590         break;
591       gst_object_unref (ret);
592       ret = NULL;
593     }
594     walk = walk->next;
595   }
596   gst_plugin_feature_list_free (possibilities);
597
598   GST_LOG_OBJECT (ret, "created %s for URL '%s'",
599       type == GST_URI_SINK ? "sink" : "source", uri);
600   return ret;
601 }
602
603 /**
604  * gst_uri_handler_get_uri_type:
605  * @handler: A #GstURIHandler.
606  *
607  * Gets the type of the given URI handler
608  *
609  * Returns: the #GstURIType of the URI handler.
610  * Returns #GST_URI_UNKNOWN if the @handler isn't implemented correctly.
611  */
612 guint
613 gst_uri_handler_get_uri_type (GstURIHandler * handler)
614 {
615   GstURIHandlerInterface *iface;
616   guint ret;
617
618   g_return_val_if_fail (GST_IS_URI_HANDLER (handler), GST_URI_UNKNOWN);
619
620   iface = GST_URI_HANDLER_GET_INTERFACE (handler);
621   g_return_val_if_fail (iface != NULL, GST_URI_UNKNOWN);
622   g_return_val_if_fail (iface->get_type != NULL, GST_URI_UNKNOWN);
623   ret = iface->get_type ();
624   g_return_val_if_fail (GST_URI_TYPE_IS_VALID (ret), GST_URI_UNKNOWN);
625
626   return ret;
627 }
628
629 /**
630  * gst_uri_handler_get_protocols:
631  * @handler: A #GstURIHandler.
632  *
633  * Gets the list of protocols supported by @handler. This list may not be
634  * modified.
635  *
636  * Returns: the supported protocols.
637  * Returns NULL if the @handler isn't implemented properly, or the @handler
638  * doesn't support any protocols.
639  */
640 gchar **
641 gst_uri_handler_get_protocols (GstURIHandler * handler)
642 {
643   GstURIHandlerInterface *iface;
644   gchar **ret;
645
646   g_return_val_if_fail (GST_IS_URI_HANDLER (handler), NULL);
647
648   iface = GST_URI_HANDLER_GET_INTERFACE (handler);
649   g_return_val_if_fail (iface != NULL, NULL);
650   g_return_val_if_fail (iface->get_protocols != NULL, NULL);
651   ret = iface->get_protocols ();
652   g_return_val_if_fail (ret != NULL, NULL);
653
654   return ret;
655 }
656
657 /**
658  * gst_uri_handler_get_uri:
659  * @handler: A #GstURIHandler
660  *
661  * Gets the currently handled URI.
662  *
663  * Returns: the URI currently handled by the @handler.
664  * Returns NULL if there are no URI currently handled. The returned
665  * string must not be modified or freed.
666  */
667 G_CONST_RETURN gchar *
668 gst_uri_handler_get_uri (GstURIHandler * handler)
669 {
670   GstURIHandlerInterface *iface;
671   const gchar *ret;
672
673   g_return_val_if_fail (GST_IS_URI_HANDLER (handler), NULL);
674
675   iface = GST_URI_HANDLER_GET_INTERFACE (handler);
676   g_return_val_if_fail (iface != NULL, NULL);
677   g_return_val_if_fail (iface->get_uri != NULL, NULL);
678   ret = iface->get_uri (handler);
679   if (ret != NULL)
680     g_return_val_if_fail (gst_uri_is_valid (ret), NULL);
681
682   return ret;
683 }
684
685 /**
686  * gst_uri_handler_set_uri:
687  * @handler: A #GstURIHandler
688  * @uri: URI to set
689  *
690  * Tries to set the URI of the given handler.
691  *
692  * Returns: TRUE if the URI was set successfully, else FALSE.
693  */
694 gboolean
695 gst_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri)
696 {
697   GstURIHandlerInterface *iface;
698
699   g_return_val_if_fail (GST_IS_URI_HANDLER (handler), FALSE);
700   g_return_val_if_fail (gst_uri_is_valid (uri), FALSE);
701
702   iface = GST_URI_HANDLER_GET_INTERFACE (handler);
703   g_return_val_if_fail (iface != NULL, FALSE);
704   g_return_val_if_fail (iface->set_uri != NULL, FALSE);
705   return iface->set_uri (handler, uri);
706 }
707
708 /**
709  * gst_uri_handler_new_uri:
710  * @handler: A #GstURIHandler
711  * @uri: new URI or NULL if it was unset
712  *
713  * Emits the new-uri signal for a given handler, when that handler has a new URI.
714  * This function should only be called by URI handlers themselves.
715  */
716 void
717 gst_uri_handler_new_uri (GstURIHandler * handler, const gchar * uri)
718 {
719   g_return_if_fail (GST_IS_URI_HANDLER (handler));
720
721   g_signal_emit_by_name (handler, "new-uri", uri);
722 }