Index: gst/gsturi.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gsturi.c,v
retrieving revision 1.31
diff -u -p -r1.31 gsturi.c
--- gst/gsturi.c	27 Jan 2006 22:34:51 -0000	1.31
+++ gst/gsturi.c	7 Mar 2006 18:39:05 -0000
@@ -373,6 +373,32 @@ gst_uri_get_protocol (const gchar * uri)
 }
 
 /**
+ * gst_uri_has_protocol:
+ * @uri: an URI string
+ * @protocol: a protocol string (e.g. "http")
+ *
+ * Returns TRUE if the protocol of a given valid URI matches @protocol.
+ *
+ * Since: 0.10.4
+ */
+gboolean
+gst_uri_has_protocol (const gchar * uri, const gchar * protocol)
+{
+  gchar *colon;
+
+  g_return_val_if_fail (uri != NULL, FALSE);
+  g_return_val_if_fail (protocol != NULL, FALSE);
+  g_return_val_if_fail (gst_uri_is_valid (uri), FALSE);
+
+  colon = strstr (uri, "://");
+
+  if (colon == NULL)
+    return FALSE;
+
+  return (strncmp (uri, protocol, (size_t) (colon - uri)) == 0);
+}
+
+/**
  * gst_uri_get_location:
  * @uri: A URI string
  *
Index: gst/gsturi.h
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gsturi.h,v
retrieving revision 1.15
diff -u -p -r1.15 gsturi.h
--- gst/gsturi.h	24 Nov 2005 09:44:06 -0000	1.15
+++ gst/gsturi.h	7 Mar 2006 18:39:05 -0000
@@ -115,6 +115,8 @@ struct _GstURIHandlerInterface {
 gboolean	gst_uri_protocol_is_valid	(const gchar * protocol);
 gboolean	gst_uri_is_valid		(const gchar * uri);
 gchar *		gst_uri_get_protocol		(const gchar * uri);
+gboolean        gst_uri_has_protocol            (const gchar * uri,
+                                                 const gchar * protocol);
 gchar *		gst_uri_get_location		(const gchar * uri);
 gchar *		gst_uri_construct		(const gchar * protocol,
 						 const gchar * location);
