2002-01-15 00:41:22 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GstElementFactory
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
|
|
Create GstElements from a factory
|
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
|
|
|
GstElementFactory is used to create instances of elements. A GstElementfactory
|
|
|
|
can be added to a #GstPlugin as it is also a #GstPluginFeature.
|
|
|
|
</para>
|
|
|
|
<para>
|
2002-04-11 20:35:18 +00:00
|
|
|
Use gst_element_factory_new() to create a new factory which can be added to a plugin
|
2002-01-15 00:41:22 +00:00
|
|
|
with gst_plugin_add_feature().
|
|
|
|
</para>
|
|
|
|
<para>
|
2002-04-11 20:35:18 +00:00
|
|
|
gst_element_factory_add_pad_template() is used to add a padtemplate to the factory.
|
2002-01-15 00:41:22 +00:00
|
|
|
This function will enable the application to query for elementfactories that handle
|
|
|
|
a specific media type.
|
|
|
|
</para>
|
|
|
|
<para>
|
2002-04-11 20:35:18 +00:00
|
|
|
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
|
2002-01-15 00:41:22 +00:00
|
|
|
shortcut.
|
|
|
|
</para>
|
|
|
|
<para>
|
2002-07-12 23:21:20 +00:00
|
|
|
The following code example shows you how to create a GstFileSrc element.
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<programlisting role="C">
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
GstElement *src;
|
|
|
|
GstElementFactory *srcfactory;
|
|
|
|
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
srcfactory = gst_element_factory_find("filesrc");
|
2002-01-15 00:41:22 +00:00
|
|
|
g_return_if_fail(srcfactory != NULL);
|
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
src = gst_element_factory_create(srcfactory,"src");
|
2002-01-15 00:41:22 +00:00
|
|
|
g_return_if_fail(src != NULL);
|
|
|
|
...
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
2002-06-12 22:27:18 +00:00
|
|
|
<para>
|
|
|
|
An elementfactory can be assigned a rank with gst_element_factory_set_rank()
|
|
|
|
so that the autopluggers can select a plugin more appropriatly
|
|
|
|
</para>
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
#GstElement, #GstPlugin, #GstPluginFeature, #GstPadTemplate.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GstElementDetails ##### -->
|
|
|
|
<para>
|
|
|
|
This struct is used to define public information about the element. It
|
|
|
|
describes the element, mostly for the benefit of editors.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@longname:
|
|
|
|
@klass:
|
2002-12-08 14:39:38 +00:00
|
|
|
@license:
|
2002-01-15 00:41:22 +00:00
|
|
|
@description:
|
|
|
|
@version:
|
|
|
|
@author:
|
|
|
|
@copyright:
|
|
|
|
|
2002-06-12 22:27:18 +00:00
|
|
|
<!-- ##### FUNCTION gst_element_factory_new ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@name:
|
|
|
|
@type:
|
|
|
|
@details:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_find ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@name:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_add_pad_template ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@elementfactory:
|
|
|
|
@templ:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_can_src_caps ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factory:
|
|
|
|
@caps:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_can_sink_caps ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factory:
|
|
|
|
@caps:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_create ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factory:
|
|
|
|
@name:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_make ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factoryname:
|
|
|
|
@name:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2002-12-14 13:02:16 +00:00
|
|
|
<!-- ##### FUNCTION gst_element_factory_make_or_warn ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factoryname:
|
|
|
|
@name:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2002-06-12 22:27:18 +00:00
|
|
|
<!-- ##### FUNCTION gst_element_factory_set_rank ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factory:
|
|
|
|
@rank:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_ELEMENT_RANK_MARGINAL ##### -->
|
|
|
|
<para>
|
2002-07-12 23:21:20 +00:00
|
|
|
The element is only marginally usefull for autoplugging
|
2002-06-12 22:27:18 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_ELEMENT_RANK_NONE ##### -->
|
|
|
|
<para>
|
2002-07-12 23:21:20 +00:00
|
|
|
The plugin may not be used in autoplugging
|
2002-06-12 22:27:18 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_ELEMENT_RANK_PRIMARY ##### -->
|
|
|
|
<para>
|
2002-07-12 23:21:20 +00:00
|
|
|
The plugin is well suited for autoplugging
|
2002-06-12 22:27:18 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_ELEMENT_RANK_SECONDARY ##### -->
|
|
|
|
<para>
|
2002-07-12 23:21:20 +00:00
|
|
|
The plugin is suited for autoplugging but only as a second
|
|
|
|
candidate.
|
2002-06-12 22:27:18 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|