mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
560d0ba1de
Original commit message from CVS: * docs/gst/tmpl/gstelementfactory.sgml: * gst/gstelement.h: * gst/gstelementfactory.c: (gst_element_factory_init), (gst_element_factory_cleanup), (gst_element_register), (__gst_element_factory_add_static_pad_template), (gst_element_factory_get_static_pad_templates), (gst_element_factory_can_src_caps), (gst_element_factory_can_sink_caps): * gst/registries/Makefile.am: * gst/registries/gstlibxmlregistry.c: (gst_xml_registry_get_type), (gst_xml_registry_class_init), (gst_xml_registry_init), (gst_xml_registry_new), (gst_xml_registry_set_property), (gst_xml_registry_get_property), (get_time), (make_dir), (gst_xml_registry_get_perms_func), (plugin_times_older_than_recurse), (plugin_times_older_than), (gst_xml_registry_open_func), (gst_xml_registry_load_func), (gst_xml_registry_save_func), (gst_xml_registry_close_func), (add_to_char_array), (read_string), (read_uint), (read_enum), (load_pad_template), (load_feature), (load_plugin), (load_paths), (gst_xml_registry_load), (gst_xml_registry_load_plugin), (gst_xml_registry_save_caps), (gst_xml_registry_save_pad_template), (gst_xml_registry_save_feature), (gst_xml_registry_save_plugin), (gst_xml_registry_save), (gst_xml_registry_rebuild_recurse), (gst_xml_registry_rebuild): * gst/registries/gstlibxmlregistry.h: * tools/gst-compprep.c: (main): * tools/gst-inspect.c: (print_pad_templates_info): * tools/gst-xmlinspect.c: (print_element_info): Use libxml2 for registry parsing, use staticpadtemplates in elementfactories. Makes gst_init() +/- 10x faster.
177 lines
2.9 KiB
Text
177 lines
2.9 KiB
Text
<!-- ##### 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>
|
|
Use gst_element_factory_new() to create a new factory which can be added to a plugin
|
|
with gst_plugin_add_feature().
|
|
</para>
|
|
<para>
|
|
gst_element_factory_add_pad_template() is used to add a padtemplate to the factory.
|
|
This function will enable the application to query for elementfactories that handle
|
|
a specific media type.
|
|
</para>
|
|
<para>
|
|
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.
|
|
</para>
|
|
<para>
|
|
The following code example shows you how to create a GstFileSrc element.
|
|
</para>
|
|
|
|
<para>
|
|
<programlisting role="C">
|
|
#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);
|
|
...
|
|
</programlisting>
|
|
</para>
|
|
<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>
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
<para>
|
|
#GstElement, #GstPlugin, #GstPluginFeature, #GstPadTemplate.
|
|
</para>
|
|
|
|
<!-- ##### STRUCT GstElementFactory ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_register ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@plugin:
|
|
@name:
|
|
@rank:
|
|
@type:
|
|
@Returns:
|
|
<!-- # Unused Parameters # -->
|
|
@elementname:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_find ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@name:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_get_element_type ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_get_longname ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_get_klass ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_get_description ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_get_author ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_get_num_pad_templates ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_get_uri_type ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_get_uri_protocols ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_create ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factory:
|
|
@name:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_element_factory_make ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@factoryname:
|
|
@name:
|
|
@Returns:
|
|
|
|
|