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
38 #define GST_URI_TYPE_IS_VALID(type) ((type) == GST_URI_SRC || (type) == GST_URI_SINK)
40 /* uri handler functions */
41 #define GST_TYPE_URI_HANDLER (gst_uri_handler_get_type ())
42 #define GST_URI_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_URI_HANDLER, GstURIHandler))
43 #define GST_IS_URI_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_URI_HANDLER))
44 #define GST_URI_HANDLER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_URI_HANDLER, GstURIHandlerInterface))
45 #define GST_URI_HANDLER_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GST_TYPE_URI_HANDLER, GstURIHandler))
47 typedef struct _GstURIHandler GstURIHandler;
48 typedef struct _GstURIHandlerInterface GstURIHandlerInterface;
50 struct _GstURIHandlerInterface
52 GTypeInterface parent;
55 void (*new_uri) (GstURIHandler * handler, const gchar * uri);
56 /* idea for the future ?
57 gboolean (* require_password) (GstURIHandler * handler,
64 /* querying capabilities */
65 GstURIType (*get_type) (void);
66 gchar **(*get_protocols) (void);
68 /* using the interface */
69 G_CONST_RETURN gchar *(*get_uri) (GstURIHandler * handler);
70 gboolean (*set_uri) (GstURIHandler * handler, const gchar * uri);
72 /* we might want to add functions here to query features, someone with gnome-vfs knowledge go ahead */
74 gpointer _gst_reserved[GST_PADDING];
77 /* general URI functions */
79 gboolean gst_uri_protocol_is_valid (const gchar * protocol);
80 gboolean gst_uri_is_valid (const gchar * uri);
81 gchar *gst_uri_get_protocol (const gchar * uri);
82 gchar *gst_uri_get_location (const gchar * uri);
83 gchar *gst_uri_construct (const gchar * protocol, const gchar * location);
85 GstElement *gst_element_make_from_uri (const GstURIType type,
86 const gchar * uri, const gchar * elementname);
88 /* accessing the interface */
89 GType gst_uri_handler_get_type (void);
91 guint gst_uri_handler_get_uri_type (GstURIHandler * handler);
92 gchar **gst_uri_handler_get_protocols (GstURIHandler * handler);
93 G_CONST_RETURN gchar *gst_uri_handler_get_uri (GstURIHandler * handler);
94 gboolean gst_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri);
95 void gst_uri_handler_new_uri (GstURIHandler * handler, const gchar * uri);
98 #endif /* __GST_URI_H__ */