2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
5 * gsturi.h: Header for uri to element mappings
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.
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.
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.
28 #include <gst/gstelement.h>
29 #include <gst/gstpluginfeature.h>
31 G_BEGIN_DECLS typedef enum
39 #define GST_URI_TYPE_IS_VALID(type) ((type) == GST_URI_SRC || (type) == GST_URI_SINK)
41 /* uri handler functions */
42 #define GST_TYPE_URI_HANDLER (gst_uri_handler_get_type ())
43 #define GST_URI_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_URI_HANDLER, GstURIHandler))
44 #define GST_IS_URI_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_URI_HANDLER))
45 #define GST_URI_HANDLER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_URI_HANDLER, GstURIHandlerInterface))
46 #define GST_URI_HANDLER_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GST_TYPE_URI_HANDLER, GstURIHandler))
48 typedef struct _GstURIHandler GstURIHandler;
49 typedef struct _GstURIHandlerInterface GstURIHandlerInterface;
51 struct _GstURIHandlerInterface
53 GTypeInterface parent;
56 void (*new_uri) (GstURIHandler * handler, const gchar * uri);
57 /* idea for the future ?
58 gboolean (* require_password) (GstURIHandler * handler,
65 /* querying capabilities */
66 GstURIType (*get_type) (void);
67 gchar **(*get_protocols) (void);
69 /* using the interface */
70 G_CONST_RETURN gchar *(*get_uri) (GstURIHandler * handler);
71 gboolean (*set_uri) (GstURIHandler * handler, const gchar * uri);
73 /* we might want to add functions here to query features, someone with gnome-vfs knowledge go ahead */
75 gpointer _gst_reserved[GST_PADDING];
78 /* general URI functions */
80 gboolean gst_uri_protocol_is_valid (const gchar * protocol);
81 gboolean gst_uri_is_valid (const gchar * uri);
82 gchar *gst_uri_get_protocol (const gchar * uri);
83 gchar *gst_uri_get_location (const gchar * uri);
84 gchar *gst_uri_construct (const gchar * protocol, const gchar * location);
86 GstElement *gst_element_make_from_uri (const GstURIType type,
87 const gchar * uri, const gchar * elementname);
89 /* accessing the interface */
90 GType gst_uri_handler_get_type (void);
92 guint gst_uri_handler_get_uri_type (GstURIHandler * handler);
93 gchar **gst_uri_handler_get_protocols (GstURIHandler * handler);
94 G_CONST_RETURN gchar *gst_uri_handler_get_uri (GstURIHandler * handler);
95 gboolean gst_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri);
96 void gst_uri_handler_new_uri (GstURIHandler * handler, const gchar * uri);
99 #endif /* __GST_URI_H__ */