|
1 /* GStreamer |
|
2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> |
|
3 * 2000,2004 Wim Taymans <wim@fluendo.com> |
|
4 * |
|
5 * gstelement.h: Header for GstElement |
|
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 #ifndef __GST_ELEMENT_FACTORY_H__ |
|
25 #define __GST_ELEMENT_FACTORY_H__ |
|
26 |
|
27 typedef struct _GstElementFactory GstElementFactory; |
|
28 typedef struct _GstElementFactoryClass GstElementFactoryClass; |
|
29 |
|
30 #include <gst/gstconfig.h> |
|
31 #include <gst/gstelement.h> |
|
32 #include <gst/gstobject.h> |
|
33 #include <gst/gstplugin.h> |
|
34 #include <gst/gstpluginfeature.h> |
|
35 #include <gst/gstiterator.h> |
|
36 |
|
37 G_BEGIN_DECLS |
|
38 |
|
39 typedef struct _GstElementDetails GstElementDetails; |
|
40 |
|
41 /** |
|
42 * GstElementDetails: |
|
43 * @longname: long, english name |
|
44 * @klass: string describing the type of element, as an unordered list |
|
45 * separated with slashes ('/'). See draft-klass.txt of the design docs |
|
46 * for more details and common types |
|
47 * @description: what the element is about |
|
48 * @author: who wrote this thing? |
|
49 * |
|
50 * This struct defines the public information about a #GstElement. It contains |
|
51 * meta-data about the element that is mostly for the benefit of editors. |
|
52 * |
|
53 * The @klass member can be used by applications to filter elements based |
|
54 * on functionality. |
|
55 */ |
|
56 /* FIXME: need translatable stuff in here (how handle in registry)? |
|
57 * can't we use _N("long name") in element implementations and use _(longname) |
|
58 * in gst_element_factory_get_longname() |
|
59 */ |
|
60 struct _GstElementDetails |
|
61 { |
|
62 /*< public > */ |
|
63 gchar *longname; |
|
64 gchar *klass; |
|
65 gchar *description; |
|
66 gchar *author; |
|
67 |
|
68 /*< private > */ |
|
69 gpointer _gst_reserved[GST_PADDING]; |
|
70 }; |
|
71 |
|
72 /** |
|
73 * GST_ELEMENT_DETAILS: |
|
74 * @longname: long, english name |
|
75 * @klass: string describing the type of element, as an unordered list |
|
76 * separated with slashes ('/'). See draft-klass.txt of the design docs |
|
77 * for more details and common types |
|
78 * @description: what the element is about |
|
79 * @author: who wrote this element |
|
80 * |
|
81 * Macro to initialize #GstElementDetails. |
|
82 */ |
|
83 #define GST_ELEMENT_DETAILS(longname,klass,description,author) \ |
|
84 { longname, klass, description, author, {NULL} } |
|
85 |
|
86 /** |
|
87 * GST_IS_ELEMENT_DETAILS: |
|
88 * @details: the #GstElementDetails to check |
|
89 * |
|
90 * Tests if element details are initialized. |
|
91 */ |
|
92 /* FIXME: what about adding '&& (*__gst_reserved==NULL)' */ |
|
93 #define GST_IS_ELEMENT_DETAILS(details) ( \ |
|
94 (details) && ((details)->longname != NULL) && ((details)->klass != NULL) \ |
|
95 && ((details)->description != NULL) && ((details)->author != NULL)) |
|
96 |
|
97 #define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type()) |
|
98 #define GST_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\ |
|
99 GstElementFactory)) |
|
100 #define GST_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT_FACTORY,\ |
|
101 GstElementFactoryClass)) |
|
102 #define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY)) |
|
103 #define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY)) |
|
104 #define GST_ELEMENT_FACTORY_CAST(obj) ((GstElementFactory *)(obj)) |
|
105 |
|
106 /** |
|
107 * GstElementFactory: |
|
108 * |
|
109 * The opaque #GstElementFactory data structure. |
|
110 */ |
|
111 struct _GstElementFactory { |
|
112 GstPluginFeature parent; |
|
113 |
|
114 GType type; /* unique GType of element or 0 if not loaded */ |
|
115 |
|
116 GstElementDetails details; |
|
117 |
|
118 GList * staticpadtemplates; |
|
119 guint numpadtemplates; |
|
120 |
|
121 /* URI interface stuff */ |
|
122 guint uri_type; |
|
123 gchar ** uri_protocols; |
|
124 |
|
125 GList * interfaces; /* interfaces this element implements */ |
|
126 |
|
127 gpointer _gst_reserved[GST_PADDING]; |
|
128 }; |
|
129 |
|
130 struct _GstElementFactoryClass { |
|
131 GstPluginFeatureClass parent_class; |
|
132 |
|
133 gpointer _gst_reserved[GST_PADDING]; |
|
134 }; |
|
135 #ifdef __SYMBIAN32__ |
|
136 IMPORT_C |
|
137 #endif |
|
138 |
|
139 |
|
140 GType gst_element_factory_get_type (void); |
|
141 #ifdef __SYMBIAN32__ |
|
142 IMPORT_C |
|
143 #endif |
|
144 |
|
145 |
|
146 GstElementFactory * gst_element_factory_find (const gchar *name); |
|
147 #ifdef __SYMBIAN32__ |
|
148 IMPORT_C |
|
149 #endif |
|
150 |
|
151 |
|
152 GType gst_element_factory_get_element_type (GstElementFactory *factory); |
|
153 #ifdef __SYMBIAN32__ |
|
154 IMPORT_C |
|
155 #endif |
|
156 |
|
157 G_CONST_RETURN gchar * gst_element_factory_get_longname (GstElementFactory *factory); |
|
158 #ifdef __SYMBIAN32__ |
|
159 IMPORT_C |
|
160 #endif |
|
161 |
|
162 G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factory); |
|
163 #ifdef __SYMBIAN32__ |
|
164 IMPORT_C |
|
165 #endif |
|
166 |
|
167 G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory); |
|
168 #ifdef __SYMBIAN32__ |
|
169 IMPORT_C |
|
170 #endif |
|
171 |
|
172 G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory); |
|
173 #ifdef __SYMBIAN32__ |
|
174 IMPORT_C |
|
175 #endif |
|
176 |
|
177 guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory); |
|
178 #ifdef __SYMBIAN32__ |
|
179 IMPORT_C |
|
180 #endif |
|
181 |
|
182 G_CONST_RETURN GList * gst_element_factory_get_static_pad_templates (GstElementFactory *factory); |
|
183 #ifdef __SYMBIAN32__ |
|
184 IMPORT_C |
|
185 #endif |
|
186 |
|
187 gint gst_element_factory_get_uri_type (GstElementFactory *factory); |
|
188 #ifdef __SYMBIAN32__ |
|
189 IMPORT_C |
|
190 #endif |
|
191 |
|
192 gchar ** gst_element_factory_get_uri_protocols (GstElementFactory *factory); |
|
193 #ifdef __SYMBIAN32__ |
|
194 IMPORT_C |
|
195 #endif |
|
196 |
|
197 gboolean gst_element_factory_has_interface (GstElementFactory *factory, |
|
198 const gchar *interfacename); |
|
199 #ifdef __SYMBIAN32__ |
|
200 IMPORT_C |
|
201 #endif |
|
202 |
|
203 |
|
204 GstElement* gst_element_factory_create (GstElementFactory *factory, |
|
205 const gchar *name); |
|
206 #ifdef __SYMBIAN32__ |
|
207 IMPORT_C |
|
208 #endif |
|
209 |
|
210 GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name); |
|
211 |
|
212 /* FIXME 0.11: move these two into our private headers */ |
|
213 #ifdef __SYMBIAN32__ |
|
214 IMPORT_C |
|
215 #endif |
|
216 |
|
217 void __gst_element_factory_add_static_pad_template (GstElementFactory *elementfactory, |
|
218 GstStaticPadTemplate *templ); |
|
219 #ifdef __SYMBIAN32__ |
|
220 IMPORT_C |
|
221 #endif |
|
222 |
|
223 void __gst_element_factory_add_interface (GstElementFactory *elementfactory, |
|
224 const gchar *interfacename); |
|
225 #ifdef __SYMBIAN32__ |
|
226 IMPORT_C |
|
227 #endif |
|
228 |
|
229 gboolean gst_element_register (GstPlugin *plugin, const gchar *name, |
|
230 guint rank, GType type); |
|
231 |
|
232 |
|
233 |
|
234 G_END_DECLS |
|
235 |
|
236 #endif /* __GST_ELEMENT_FACTORY_H__ */ |