I've no idea here...
[gtkD.git] / gtkD / srcgstreamer / gstreamer / ElementFactory.d
blobbb1d4baa9b3664ed8e1b4610deafd3748f0fbf27
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GstElementFactory.html
26 * outPack = gstreamer
27 * outFile = ElementFactory
28 * strct = GstElementFactory
29 * realStrct=
30 * ctorStrct=
31 * clss = ElementFactory
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gst_element_factory_
40 * - gst_element_
41 * - gst_
42 * omit structs:
43 * omit prefixes:
44 * omit code:
45 * imports:
46 * - glib.Str
47 * - gstreamer.Element
48 * - gstreamer.Plugin
49 * - gstreamer.Caps
50 * - glib.ListG
51 * structWrap:
52 * - GList* -> ListG
53 * - GstCaps* -> Caps
54 * - GstElement* -> Element
55 * - GstElementFactory* -> ElementFactory
56 * - GstPlugin* -> Plugin
57 * module aliases:
58 * local aliases:
61 module gstreamer.ElementFactory;
63 version(noAssert)
65 version(Tango)
67 import tango.io.Stdout; // use the tango loging?
71 private import gstreamerc.gstreamertypes;
73 private import gstreamerc.gstreamer;
76 private import glib.Str;
77 private import gstreamer.Element;
78 private import gstreamer.Plugin;
79 private import gstreamer.Caps;
80 private import glib.ListG;
85 /**
86 * Description
87 * GstElementFactory is used to create instances of elements. A
88 * GstElementfactory can be added to a GstPlugin as it is also a
89 * GstPluginFeature.
90 * Use the gst_element_factory_find() and gst_element_factory_create()
91 * functions to create element instances or use gst_element_factory_make() as a
92 * convenient shortcut.
93 * The following code example shows you how to create a GstFileSrc element.
94 * Example6.Using an element factory
95 * include <gst/gst.h>
96 * GstElement *src;
97 * GstElementFactory *srcfactory;
98 * gst_init(argc,argv);
99 * srcfactory = gst_element_factory_find("filesrc");
100 * g_return_if_fail(srcfactory != NULL);
101 * src = gst_element_factory_create(srcfactory,"src");
102 * g_return_if_fail(src != NULL);
103 * ...
104 * Last reviewed on 2005-11-23 (0.9.5)
106 private import gstreamer.PluginFeature;
107 public class ElementFactory : PluginFeature
110 /** the main Gtk struct */
111 protected GstElementFactory* gstElementFactory;
114 public GstElementFactory* getElementFactoryStruct()
116 return gstElementFactory;
120 /** the main Gtk struct as a void* */
121 protected void* getStruct()
123 return cast(void*)gstElementFactory;
127 * Sets our main struct and passes it to the parent class
129 public this (GstElementFactory* gstElementFactory)
131 version(noAssert)
133 if ( gstElementFactory is null )
135 int zero = 0;
136 version(Tango)
138 Stdout("struct gstElementFactory is null on constructor").newline;
140 else
142 printf("struct gstElementFactory is null on constructor");
144 zero = zero / zero;
147 else
149 assert(gstElementFactory !is null, "struct gstElementFactory is null on constructor");
151 super(cast(GstPluginFeature*)gstElementFactory);
152 this.gstElementFactory = gstElementFactory;
156 * Create a new element of the type defined by the given element factory.
157 * The element will receive a guaranteed unique name,
158 * consisting of the element factory name and a number.
159 * factoryname:
160 * a named factory to instantiate
161 * Returns:
162 * new GstElement or NULL if unable to create element
164 public static Element make( char[] factoryname )
166 // GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
167 return new Element( gst_element_factory_make(Str.toStringz(factoryname), null ) );
178 * Create a new elementfactory capable of instantiating objects of the
179 * type and add the factory to plugin.
180 * plugin:
181 * GstPlugin to register the element with
182 * name:
183 * name of elements of this type
184 * rank:
185 * rank of element (higher rank means more importance when autoplugging)
186 * type:
187 * GType of element to register
188 * Returns:
189 * TRUE, if the registering succeeded, FALSE on error
191 public static int register(Plugin plugin, char[] name, uint rank, GType type)
193 // gboolean gst_element_register (GstPlugin *plugin, const gchar *name, guint rank, GType type);
194 return gst_element_register((plugin is null) ? null : plugin.getPluginStruct(), Str.toStringz(name), rank, type);
198 * Search for an element factory of the given name. Refs the returned
199 * element factory; caller is responsible for unreffing.
200 * name:
201 * name of factory to find
202 * Returns:
203 * GstElementFactory if found, NULL otherwise
205 public static ElementFactory find(char[] name)
207 // GstElementFactory* gst_element_factory_find (const gchar *name);
208 return new ElementFactory( gst_element_factory_find(Str.toStringz(name)) );
212 * Get the GType for elements managed by this factory. The type can
213 * only be retrieved if the element factory is loaded, which can be
214 * assured with gst_plugin_feature_load().
215 * factory:
216 * factory to get managed GType from
217 * Returns:
218 * the GType for elements managed by this factory or 0 if
219 * the factory is not loaded.
221 public GType getElementType()
223 // GType gst_element_factory_get_element_type (GstElementFactory *factory);
224 return gst_element_factory_get_element_type(gstElementFactory);
228 * Gets the longname for this factory
229 * factory:
230 * a GstElementFactory
231 * Returns:
232 * the longname
234 public char[] getLongname()
236 // const gchar* gst_element_factory_get_longname (GstElementFactory *factory);
237 return Str.toString(gst_element_factory_get_longname(gstElementFactory) );
241 * Gets the class for this factory.
242 * factory:
243 * a GstElementFactory
244 * Returns:
245 * the class
247 public char[] getKlass()
249 // const gchar* gst_element_factory_get_klass (GstElementFactory *factory);
250 return Str.toString(gst_element_factory_get_klass(gstElementFactory) );
254 * Gets the description for this factory.
255 * factory:
256 * a GstElementFactory
257 * Returns:
258 * the description
260 public char[] getDescription()
262 // const gchar* gst_element_factory_get_description (GstElementFactory *factory);
263 return Str.toString(gst_element_factory_get_description(gstElementFactory) );
267 * Gets the author for this factory.
268 * factory:
269 * a GstElementFactory
270 * Returns:
271 * the author
273 public char[] getAuthor()
275 // const gchar* gst_element_factory_get_author (GstElementFactory *factory);
276 return Str.toString(gst_element_factory_get_author(gstElementFactory) );
280 * Gets the number of pad_templates in this factory.
281 * factory:
282 * a GstElementFactory
283 * Returns:
284 * the number of pad_templates
286 public uint getNumPadTemplates()
288 // guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
289 return gst_element_factory_get_num_pad_templates(gstElementFactory);
293 * Gets the type of URIs the element supports or GST_URI_UNKNOWN if none.
294 * factory:
295 * a GstElementFactory
296 * Returns:
297 * type of URIs this element supports
299 public int getUriType()
301 // gint gst_element_factory_get_uri_type (GstElementFactory *factory);
302 return gst_element_factory_get_uri_type(gstElementFactory);
306 * Gets a NULL-terminated array of protocols this element supports or NULL if
307 * no protocols are supported. You may not change the contents of the returned
308 * array, as it is still owned by the element factory. Use g_strdupv() to
309 * make a copy of the protocol string array if you need to.
310 * factory:
311 * a GstElementFactory
312 * Returns:
313 * the supported protocols or NULL
315 public char** getUriProtocols()
317 // gchar** gst_element_factory_get_uri_protocols (GstElementFactory *factory);
318 return gst_element_factory_get_uri_protocols(gstElementFactory);
322 * Create a new element of the type defined by the given elementfactory.
323 * It will be given the name supplied, since all elements require a name as
324 * their first argument.
325 * factory:
326 * factory to instantiate
327 * name:
328 * name of new element
329 * Returns:
330 * new GstElement or NULL if the element couldn't be created
332 public Element create(char[] name)
334 // GstElement* gst_element_factory_create (GstElementFactory *factory, const gchar *name);
335 return new Element( gst_element_factory_create(gstElementFactory, Str.toStringz(name)) );
339 * Create a new element of the type defined by the given element factory.
340 * If name is NULL, then the element will receive a guaranteed unique name,
341 * consisting of the element factory name and a number.
342 * If name is given, it will be given the name supplied.
343 * factoryname:
344 * a named factory to instantiate
345 * name:
346 * name of new element
347 * Returns:
348 * new GstElement or NULL if unable to create element
350 public static Element make(char[] factoryname, char[] name)
352 // GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
353 return new Element( gst_element_factory_make(Str.toStringz(factoryname), Str.toStringz(name)) );
357 * Checks if the factory can sink the given capability.
358 * factory:
359 * factory to query
360 * caps:
361 * the caps to check
362 * Returns:
363 * true if it can sink the capabilities
365 public int canSinkCaps(Caps caps)
367 // gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory, const GstCaps *caps);
368 return gst_element_factory_can_sink_caps(gstElementFactory, (caps is null) ? null : caps.getCapsStruct());
372 * Checks if the factory can source the given capability.
373 * factory:
374 * factory to query
375 * caps:
376 * the caps to check
377 * Returns:
378 * true if it can src the capabilities
380 public int canSrcCaps(Caps caps)
382 // gboolean gst_element_factory_can_src_caps (GstElementFactory *factory, const GstCaps *caps);
383 return gst_element_factory_can_src_caps(gstElementFactory, (caps is null) ? null : caps.getCapsStruct());
387 * Gets the GList of GstStaticPadTemplate for this factory.
388 * factory:
389 * a GstElementFactory
390 * Returns:
391 * the padtemplates
392 * See Also
393 * GstElement, GstPlugin, GstPluginFeature, GstPadTemplate.
395 public ListG getStaticPadTemplates()
397 // const GList* gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
398 return new ListG( gst_element_factory_get_static_pad_templates(gstElementFactory) );