gst_plugins_base/ext/gnomevfs/gstgnomevfsuri.c
branchRCL_3
changeset 30 7e817e7e631c
parent 0 0e761a78d257
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
       
     1 /* GStreamer
       
     2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
       
     3  *                    2000 Wim Taymans <wtay@chello.be>
       
     4  *                    2001 Bastien Nocera <hadess@hadess.net>
       
     5  *                    2003 Colin Walters <walters@verbum.org>
       
     6  *
       
     7  * gstgnomevfssink.c: 
       
     8  *
       
     9  * This library is free software; you can redistribute it and/or
       
    10  * modify it under the terms of the GNU Library General Public
       
    11  * License as published by the Free Software Foundation; either
       
    12  * version 2 of the License, or (at your option) any later version.
       
    13  *
       
    14  * This library is distributed in the hope that it will be useful,
       
    15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    17  * Library General Public License for more details.
       
    18  *
       
    19  * You should have received a copy of the GNU Library General Public
       
    20  * License along with this library; if not, write to the
       
    21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
       
    22  * Boston, MA 02111-1307, USA.
       
    23  */
       
    24 
       
    25 
       
    26 #ifdef HAVE_CONFIG_H
       
    27 #include "config.h"
       
    28 #endif
       
    29 
       
    30 #include <libgnomevfs/gnome-vfs.h>
       
    31 #include "gstgnomevfsuri.h"
       
    32 
       
    33 #include <gst/gst.h>
       
    34 
       
    35 gchar **
       
    36 gst_gnomevfs_get_supported_uris (void)
       
    37 {
       
    38   /* no dav/davs in the list, because they don't appear to be reliable enough */
       
    39   const gchar *uris[] = {
       
    40     "http://localhost/bla",
       
    41     "https://localhost/bla",
       
    42     "file:///bla",
       
    43     "smb://localhost/bla",
       
    44     "ftp://localhost/bla",
       
    45     "sftp://localhost/bla",
       
    46     "nfs://localhost/bla",
       
    47     "ssh://localhost/bla",
       
    48     "burn://"
       
    49   };
       
    50   GnomeVFSURI *uri;
       
    51   gchar **result;
       
    52   gint n, r = 0;
       
    53 
       
    54   result = g_new0 (gchar *, G_N_ELEMENTS (uris) + 1);
       
    55   for (n = 0; n < G_N_ELEMENTS (uris); n++) {
       
    56     uri = gnome_vfs_uri_new (uris[n]);
       
    57     if (uri != NULL) {
       
    58       gchar *protocol = g_strdup (uris[n]);
       
    59       gint n;
       
    60 
       
    61       gnome_vfs_uri_unref (uri);
       
    62       for (n = 0; protocol[n] != '\0'; n++) {
       
    63         if (protocol[n] == ':') {
       
    64           protocol[n] = '\0';
       
    65           break;
       
    66         }
       
    67       }
       
    68 
       
    69       GST_DEBUG ("adding protocol '%s'", protocol);
       
    70       result[r++] = protocol;
       
    71     } else {
       
    72       GST_DEBUG ("could not create GnomeVfsUri from '%s'", uris[n]);
       
    73     }
       
    74   }
       
    75   result[r] = NULL;
       
    76 
       
    77   return result;
       
    78 }