Next: GstElement, Previous: gstconfig, Up: Top
Create GstElements from a factory
<gst-element-factory> is used to create instances of elements. A
GstElementfactory can be added to a <gst-plugin> as it is also a
<gst-plugin-feature>.
Use the gst-element-factory-find and gst-element-factory-create
functions to create element instances or use gst-element-factory-make as
a convenient shortcut.
The following code example shows you how to create a GstFileSrc element.
#include <gst/gst.h>
GstElement *src;
GstElementFactory *srcfactory;
gst_init(&argc,&argv);
srcfactory = gst_element_factory_find("filesrc");
g_return_if_fail(srcfactory != NULL);
src = gst_element_factory_create(srcfactory,"src");
g_return_if_fail(src != NULL);
...
Last reviewed on 2005-11-23 (0.9.5)
This
<gobject>class defines no properties, other than those defined by its superclasses.
<gst-plugin>) (name mchars) (rank unsigned-int) (type <gtype>) (ret bool)Create a new elementfactory capable of instantiating objects of the type and add the factory to plugin.
- plugin
<gst-plugin>to register the element with- name
- name of elements of this type
- rank
- rank of element (higher rank means more importance when autoplugging)
- type
- GType of element to register
- ret
- TRUE, if the registering succeeded, FALSE on error
mchars) (ret <gst-element-factory>)Search for an element factory of the given name. Refs the returned element factory; caller is responsible for unreffing.
- name
- name of factory to find
- ret
<gst-element-factory>if found, NULL otherwise
<gst-element-factory>) (ret mchars)Gets the longname for this factory
- factory
- a
<gst-element-factory>- ret
- the longname
<gst-element-factory>) (ret mchars)Gets the class for this factory.
- factory
- a
<gst-element-factory>- ret
- the class
<gst-element-factory>) (ret mchars)Gets the description for this factory.
- factory
- a
<gst-element-factory>- ret
- the description
<gst-element-factory>) (ret mchars)Gets the author for this factory.
- factory
- a
<gst-element-factory>- ret
- the author
<gst-element-factory>) (ret int)Gets the type of URIs the element supports or GST_URI_UNKNOWN if none.
- factory
- a
<gst-element-factory>- ret
- type of URIs this element supports
<gst-element-factory>) (name mchars) (ret <gst-element>)Create a new element of the type defined by the given elementfactory. It will be given the name supplied, since all elements require a name as their first argument.
- factory
- factory to instantiate
- name
- name of new element
- ret
- new
<gst-element>or NULL if the element couldn't be created
mchars) (name mchars) (ret <gst-element>)Create a new element of the type defined by the given element factory. If name is NULL, then the element will receive a guaranteed unique name, consisting of the element factory name and a number. If name is given, it will be given the name supplied.
- factoryname
- a named factory to instantiate
- name
- name of new element
- ret
- new
<gst-element>or NULL if unable to create element