From: Wim T. <wt...@us...> - 2001-10-24 21:44:51
|
Update of /cvsroot/gstreamer/gstreamer/docs/gst/tmpl In directory usw-pr-cvs1:/tmp/cvs-serv1183/tmpl Modified Files: gstautoplug.sgml gstelement.sgml gstpad.sgml gstreamer-unused.sgml gsttypefactory.sgml Added Files: gstautoplugfactory.sgml gstelementfactory.sgml gstpadtemplate.sgml Log Message: Split out the padtemplate, autoplugfactoy and elementfactory into different pages to be able to show more examples and the object hierarchy. --- NEW FILE: gstautoplugfactory.sgml --- <!-- ##### SECTION Title ##### --> GstAutoplugFactory <!-- ##### SECTION Short_Description ##### --> Create autopluggers from a factory. <!-- ##### SECTION Long_Description ##### --> <para> An autoplugfactory is used to create instances of an autoplugger. It can be added to a #GstPlugin as it extends #GstPluginFeature. </para> <para> Use gst_autoplugfactory_new() to create a new autoplugger which can be registered to a plugin with gst_plugin_add_feature(). </para> <para> Use gst_autoplugfactory_find() to find the named autoplugfactory. or use gst_autoplugfactory_get_list() to get a list of all available autopluggers. </para> <para> Once an autoplugfactory has been obtained use gst_autoplugfactory_create() to instantiate a real autopugger. Optionally gst_autoplugfactory_make() to create and autoplugger from the named factory. </para> <para> Use gst_autoplugfactory_destroy() to remove the factory from the global list. </para> <!-- ##### SECTION See_Also ##### --> <para> #GstAutoplug, #GstPlugin, #GstPluginFeature. </para> <!-- ##### STRUCT GstAutoplugFactory ##### --> <para> </para> <!-- ##### FUNCTION gst_autoplugfactory_new ##### --> <para> </para> @name: @longdesc: @type: @Returns: <!-- ##### FUNCTION gst_autoplugfactory_destroy ##### --> <para> </para> @factory: <!-- ##### FUNCTION gst_autoplugfactory_find ##### --> <para> </para> @name: @Returns: <!-- ##### FUNCTION gst_autoplugfactory_get_list ##### --> <para> </para> @Returns: <!-- ##### FUNCTION gst_autoplugfactory_create ##### --> <para> </para> @factory: @Returns: <!-- ##### FUNCTION gst_autoplugfactory_make ##### --> <para> </para> @name: @Returns: --- NEW FILE: gstelementfactory.sgml --- <!-- ##### 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_elementfactory_new() to create a new factory which can be added to a plugin with gst_plugin_add_feature(). </para> <para> gst_elementfactory_get_list() is used to get a list of all available factories in the plugin repository. </para> <para> gst_elementfactory_add_padtemplate() 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_elementfactory_find() and gst_elementfactory_create() functions to create element instances or use gst_elementfactory_make() as a convenient shortcut. </para> <para> The following code example shows you how to create a GstDiskSrc element. </para> <para> <programlisting role="C"> #include <gst/gst.h> GstElement *src; GstElementFactory *srcfactory; gst_init(&argc,&argv); srcfactory = gst_elementfactory_find("disksrc"); g_return_if_fail(srcfactory != NULL); src = gst_elementfactory_create(srcfactory,"src"); g_return_if_fail(src != NULL); ... </programlisting> </para> <!-- ##### 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: @description: @version: @author: @copyright: <!-- ##### FUNCTION gst_elementfactory_new ##### --> <para> </para> @name: @type: @details: @Returns: <!-- ##### FUNCTION gst_elementfactory_find ##### --> <para> </para> @name: @Returns: <!-- ##### FUNCTION gst_elementfactory_get_list ##### --> <para> </para> @Returns: <!-- ##### FUNCTION gst_elementfactory_add_padtemplate ##### --> <para> </para> @elementfactory: @templ: <!-- # Unused Parameters # --> @temp: @pad: <!-- ##### FUNCTION gst_elementfactory_can_src_caps ##### --> <para> </para> @factory: @caps: @Returns: <!-- ##### FUNCTION gst_elementfactory_can_sink_caps ##### --> <para> </para> @factory: @caps: @Returns: <!-- ##### FUNCTION gst_elementfactory_create ##### --> <para> </para> @factory: @name: @Returns: <!-- ##### FUNCTION gst_elementfactory_make ##### --> <para> </para> @factoryname: @name: @Returns: --- NEW FILE: gstpadtemplate.sgml --- <!-- ##### SECTION Title ##### --> GstPadTemplate <!-- ##### SECTION Short_Description ##### --> Describe the media type of a pad. <!-- ##### SECTION Long_Description ##### --> <para> Padtemplates describe the possible media types a pad or an elementfactory can handle. </para> <para> Pad and PadTemplates have #GstCaps attached to it to describe the media type they are capable of dealing with. gst_padtemplate_get_caps() is used to get the caps of a padtemplate. It's not possible to modify the caps of a padtemplate after creation. </para> <para> Padtemplates can be created with gst_padtemplate_new() or with the convenient GST_PADTEMPLATE_FACTORY() macro. A padtemplate can be used to create a pad or to add to an elementfactory. </para> <para> The following code example shows the code to create a pad from a padtemplate. <programlisting> GST_PADTEMPLATE_FACTORY (my_template_factory, "sink", /* the name of the pad */ GST_PAD_SINK, /* the direction of the pad */ GST_PAD_ALWAYS, /* when this pad will be present */ GST_CAPS_NEW ( /* the capabilities of the padtemplate */ "my_caps", "audio/raw", "format", GST_PROPS_STRING ("int"), "channels", GST_PROPS_INT_RANGE (1, 6) ) ) void my_method (void) { GstPad *pad; pad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (my_template_factory), "sink"); ... } </programlisting> </para> <para> The following example shows you how to add the padtemplate to an elementfactory: <programlisting> gboolean my_factory_init (GstPlugin *plugin) { GstElementFactory *factory; factory = gst_elementfactory_new ("my_factory", GST_TYPE_MYFACTORY, &gst_myfactory_details); g_return_val_if_fail (factory != NULL, FALSE); gst_elementfactory_add_padtemplate (factory, GST_PADTEMPLATE_GET (my_template_factory)); gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); return TRUE; } </programlisting> </para> <!-- ##### SECTION See_Also ##### --> <para> #GstPad, #GstElementFactory </para> <!-- ##### ENUM GstPadPresence ##### --> <para> Indicates when this pad will become available. </para> @GST_PAD_ALWAYS: the pad is always available @GST_PAD_SOMETIMES: the pad will become available depending on the media stream @GST_PAD_REQUEST: th pad is only available on request with gst_element_request_pad_by_name() or gst_element_request_compatible_pad(). <!-- ##### STRUCT GstPadTemplate ##### --> <para> </para> <!-- ##### MACRO GST_PADTEMPLATE_CAPS ##### --> <para> Get a handle to the padtemplate #GstCaps </para> @templ: the template to query <!-- ##### MACRO GST_PADTEMPLATE_DIRECTION ##### --> <para> Get the direction of the padtemplate. </para> @templ: the template to query <!-- ##### MACRO GST_PADTEMPLATE_NAME_TEMPLATE ##### --> <para> Get the nametemplate of the padtemplate. </para> @templ: the template to query <!-- ##### MACRO GST_PADTEMPLATE_PRESENCE ##### --> <para> Get the presence of the padtemplate. </para> @templ: the template to query <!-- ##### MACRO GST_PADTEMPLATE_NEW ##### --> <para> Create a new padtemplate. </para> @padname: the nametemplate for the pads that will be created with this template @dir: the direction of the pads. @pres: the presence of the pads. @a...: the capabilities of this padtemplate usually created with GST_CAPS_NEW() <!-- ##### MACRO GST_PADTEMPLATE_FACTORY ##### --> <para> Create a factory for a padtemplate. This can be used if you only want one instance of the padtemplate. Use GST_PADTEMPLATE_GET() to get the unique padtemplate. </para> @name: th name of the factory @padname: the nametemplate of the pads @dir: the direction of the pads. @pres: the presence of the pads. @a...: the capabilities of this padtemplate, usually created with GST_CAPS_NEW() <!-- ##### MACRO GST_PADTEMPLATE_GET ##### --> <para> Get the padtemplate of the factory created with GST_PADTEMPLATE_FACTORY() </para> @fact: the factory name to get the padtemplate from. <!-- ##### FUNCTION gst_padtemplate_new ##### --> <para> </para> @name_template: @direction: @presence: @caps: @Varargs: @Returns: <!-- ##### FUNCTION gst_padtemplate_load_thyself ##### --> <para> </para> @parent: @Returns: <!-- ##### FUNCTION gst_padtemplate_save_thyself ##### --> <para> </para> @templ: @parent: @Returns: <!-- ##### FUNCTION gst_padtemplate_get_caps ##### --> <para> </para> @templ: @Returns: <!-- ##### FUNCTION gst_padtemplate_get_caps_by_name ##### --> <para> </para> @templ: @name: @Returns: <!-- ##### SIGNAL GstPadTemplate::pad-created ##### --> <para> </para> @gstpadtemplate: the object which received the signal. @arg1: Index: gstautoplug.sgml =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/docs/gst/tmpl/gstautoplug.sgml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- gstautoplug.sgml 2001/10/24 19:55:12 1.9 +++ gstautoplug.sgml 2001/10/24 21:44:48 1.10 @@ -13,14 +13,12 @@ </para> <para> -You first need to create a suitable autoplugger with gst_autoplugfactory_make(). +You first need to create a suitable autoplugger with gst_autoplugfactory_make() +(see #GstAutoplugFactory). The name of the autoplugger must be one of the registered autopluggers (see #GstStaticAutoplug and #GstStaticAutoplugRender). </para> <para> -A list of all available autopluggers can be obtained with gst_autoplugfactory_get_list(). -</para> -<para> If the autoplugger supports the RENDERER API, use gst_autoplug_to_renderers() call to create a bin that connectes the src caps to the specified rendrer elements. You can then add the bin to a pipeline and run it. @@ -83,7 +81,7 @@ <para> Optionally you can get a notification when a new object is added to the created -pipeline with a gtk_signal_connect to the "new_object" signal. +pipeline with a g_signal_connect to the "new_object" signal. </para> <para> @@ -110,12 +108,6 @@ @GST_AUTOPLUG_TO_RENDERER: @GST_AUTOPLUG_FLAG_LAST: -<!-- ##### STRUCT GstAutoplugFactory ##### --> -<para> - -</para> - - <!-- ##### FUNCTION gst_autoplug_signal_new_object ##### --> <para> @@ -146,60 +138,6 @@ @srccaps: @target: @Varargs: -@Returns: - - -<!-- ##### FUNCTION gst_autoplugfactory_new ##### --> -<para> - -</para> - -@name: -@longdesc: -@type: -@Returns: - - -<!-- ##### FUNCTION gst_autoplugfactory_destroy ##### --> -<para> - -</para> - -@factory: - - -<!-- ##### FUNCTION gst_autoplugfactory_find ##### --> -<para> - -</para> - -@name: -@Returns: - - -<!-- ##### FUNCTION gst_autoplugfactory_get_list ##### --> -<para> - -</para> - -@Returns: - - -<!-- ##### FUNCTION gst_autoplugfactory_create ##### --> -<para> - -</para> - -@factory: -@Returns: - - -<!-- ##### FUNCTION gst_autoplugfactory_make ##### --> -<para> - -</para> - -@name: @Returns: Index: gstelement.sgml =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/docs/gst/tmpl/gstelement.sgml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- gstelement.sgml 2001/10/24 19:55:12 1.29 +++ gstelement.sgml 2001/10/24 21:44:48 1.30 @@ -25,7 +25,7 @@ <!-- ##### SECTION See_Also ##### --> <para> - +#GstElementFactory </para> <!-- ##### ENUM GstElementState ##### --> @@ -205,27 +205,6 @@ </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: -@description: -@version: -@author: -@copyright: - -<!-- ##### STRUCT GstElementFactory ##### --> -<para> -This factory is used when registering the element, and contains the name -of the element, the GtkType value for it, as well as a pointer to the -GstElementDetails struct for the element. -</para> - - <!-- ##### USER_FUNCTION GstElementLoopFunction ##### --> <para> This function type is used to specify a loop function for the element. It @@ -499,86 +478,6 @@ @self: @parent: -@Returns: - - -<!-- ##### FUNCTION gst_elementfactory_new ##### --> -<para> - -</para> - -@name: -@type: -@details: -@Returns: - - -<!-- ##### FUNCTION gst_elementfactory_add_padtemplate ##### --> -<para> - -</para> - -@elementfactory: -@templ: -<!-- # Unused Parameters # --> -@temp: -@pad: - - -<!-- ##### FUNCTION gst_elementfactory_find ##### --> -<para> - -</para> - -@name: -@Returns: - - -<!-- ##### FUNCTION gst_elementfactory_get_list ##### --> -<para> - -</para> - -@Returns: - - -<!-- ##### FUNCTION gst_elementfactory_can_src_caps ##### --> -<para> - -</para> - -@factory: -@caps: -@Returns: - - -<!-- ##### FUNCTION gst_elementfactory_can_sink_caps ##### --> -<para> - -</para> - -@factory: -@caps: -@Returns: - - -<!-- ##### FUNCTION gst_elementfactory_create ##### --> -<para> - -</para> - -@factory: -@name: -@Returns: - - -<!-- ##### FUNCTION gst_elementfactory_make ##### --> -<para> - -</para> - -@factoryname: -@name: @Returns: Index: gstpad.sgml =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/docs/gst/tmpl/gstpad.sgml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- gstpad.sgml 2001/10/21 15:47:23 1.29 +++ gstpad.sgml 2001/10/24 21:44:48 1.30 @@ -11,38 +11,12 @@ can be connected with gst_pad_connect(). </para> <para> -PedTemplates are use to describe the runtime behaviour of an element and what pads it -will have during its lifetime. Pads are typically created from a padtemplate with -GST_PADTEMPLATE_NEW() or with the factory macro GST_PADTEMPLATE_FACTORY(). +Pads are typically created from a #GstPadTemplate with gst_pad_new_from_template(). </para> <para> -Pad and PadTemplates have #GstCaps attached to it to describe the media type they +Pad have #GstCaps attached to it to describe the media type they are capable of dealing with. gst_pad_get_caps() and gst_pad_set_caps() are used to -manipulate the caps of the pads. gst_padtemplate_get_caps() is used to get the -caps of a padtemplate. It's not possible to modify the caps of a padtemplate after -creation. The following code example shows the code to create a pad from a padtemplate. -<programlisting> -GST_PADTEMPLATE_FACTORY (my_factory, - "sink", /* the name of the pad */ - GST_PAD_SINK, /* the direction of the pad */ - GST_PAD_ALWAYS, /* when this pad will be present */ - GST_CAPS_NEW ( /* the capabilities of the padtemplate */ - "my_caps", - "audio/raw", - "format", GST_PROPS_STRING ("int"), - "channels", GST_PROPS_INT_RANGE (1, 6) - ) -) - -void -my_method (void) -{ - GstPad *pad; - - pad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (my_factory), "sink"); - ... -} -</programlisting> +manipulate the caps of the pads. Pads created from a padtemplate cannot set capabilities that are incompatible with the padtemplates capabilities. </para> @@ -51,7 +25,7 @@ a name as an argument. </para> <para> -gst_pad_get_parent() will retrieve the GstElement that owns the pad. +gst_pad_get_parent() will retrieve the #GstElement that owns the pad. </para> <para> GstElements creating a pad will typicilally use the various gst_pad_set_*_function() calls @@ -61,7 +35,7 @@ GstElements will use gst_pad_push() and gst_pad_pull() to push out or pull a buffer in. The gst_pad_pullregion() function can be used to request for a buffer with a specific offset (in time or in bytes). gst_pad_select() and gst_pad_selectv() are use by plugins to wait on a set -of pads for a new GstBuffer or GstEvent. +of pads for a new #GstBuffer or #GstEvent. </para> <para> To send an event on a pad, use gst_pad_send_event(). @@ -69,7 +43,7 @@ <!-- ##### SECTION See_Also ##### --> <para> -#GstCaps, #GstElement, #GstEvent +#GstPadTemplate, #GstElement, #GstEvent </para> <!-- ##### MACRO GST_PAD_NAME ##### --> @@ -908,142 +882,6 @@ @name: @pad: -@Returns: - - -<!-- ##### ENUM GstPadPresence ##### --> -<para> -Indicates when this pad will become available. -</para> - -@GST_PAD_ALWAYS: the pad is always available -@GST_PAD_SOMETIMES: the pad will become available depending on the media stream -@GST_PAD_REQUEST: th pad is only available on request with -gst_element_request_pad_by_name() or gst_element_request_compatible_pad(). - -<!-- ##### STRUCT GstPadTemplate ##### --> -<para> - -</para> - -@object: -@name_template: -@direction: -@presence: -@caps: - -<!-- ##### MACRO GST_PADTEMPLATE_CAPS ##### --> -<para> -Get a handle to the padtemplate #GstCaps -</para> - -@templ: the template to query - - -<!-- ##### MACRO GST_PADTEMPLATE_DIRECTION ##### --> -<para> -Get the direction of the padtemplate. -</para> - -@templ: the template to query - - -<!-- ##### MACRO GST_PADTEMPLATE_NAME_TEMPLATE ##### --> -<para> -Get the nametemplate of the padtemplate. -</para> - -@templ: the template to query - - -<!-- ##### MACRO GST_PADTEMPLATE_PRESENCE ##### --> -<para> -Get the presence of the padtemplate. -</para> - -@templ: the template to query - - -<!-- ##### MACRO GST_PADTEMPLATE_NEW ##### --> -<para> -Create a new padtemplate. -</para> - -@padname: the nametemplate for the pads that will be created with this template -@dir: the direction of the pads. -@pres: the presence of the pads. -@a...: the capabilities of this padtemplate usually created with GST_CAPS_NEW() - - -<!-- ##### MACRO GST_PADTEMPLATE_FACTORY ##### --> -<para> -Create a factory for a padtemplate. This can be used if you only want one instance -of the padtemplate. Use GST_PADTEMPLATE_GET() to get the unique padtemplate. -</para> - -@name: th name of the factory -@padname: the nametemplate of the pads -@dir: the direction of the pads. -@pres: the presence of the pads. -@a...: the capabilities of this padtemplate, usually created with GST_CAPS_NEW() - - -<!-- ##### MACRO GST_PADTEMPLATE_GET ##### --> -<para> -Get the padtemplate of the factory created with GST_PADTEMPLATE_FACTORY() -</para> - -@fact: the factory name to get the padtemplate from. - - -<!-- ##### FUNCTION gst_padtemplate_new ##### --> -<para> - -</para> - -@name_template: -@direction: -@presence: -@caps: -@Varargs: -@Returns: - - -<!-- ##### FUNCTION gst_padtemplate_load_thyself ##### --> -<para> - -</para> - -@parent: -@Returns: - - -<!-- ##### FUNCTION gst_padtemplate_save_thyself ##### --> -<para> - -</para> - -@templ: -@parent: -@Returns: - - -<!-- ##### FUNCTION gst_padtemplate_get_caps ##### --> -<para> - -</para> - -@templ: -@Returns: - - -<!-- ##### FUNCTION gst_padtemplate_get_caps_by_name ##### --> -<para> - -</para> - -@templ: -@name: @Returns: Index: gstreamer-unused.sgml =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/docs/gst/tmpl/gstreamer-unused.sgml,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- gstreamer-unused.sgml 2001/10/24 18:41:49 1.50 +++ gstreamer-unused.sgml 2001/10/24 21:44:48 1.51 @@ -2423,6 +2423,14 @@ </para> +<!-- ##### STRUCT GstElementFactory ##### --> +<para> +This factory is used when registering the element, and contains the name +of the element, the GtkType value for it, as well as a pointer to the +GstElementDetails struct for the element. +</para> + + <!-- ##### STRUCT GstEsdSink ##### --> <para> Index: gsttypefactory.sgml =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/docs/gst/tmpl/gsttypefactory.sgml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gsttypefactory.sgml 2001/10/24 19:55:12 1.3 +++ gsttypefactory.sgml 2001/10/24 21:44:48 1.4 @@ -20,8 +20,8 @@ { gchar *data = GST_BUFFER_DATA (buf); - if (strncmp (&data[0], "RIFF", 4)) return NULL; - if (strncmp (&data[8], "AVI ", 4)) return NULL; + if (strncmp (&data[0], "RIFF", 4)) return NULL; + if (strncmp (&data[8], "AVI ", 4)) return NULL; return gst_caps_new ("avi_typefind","video/avi", NULL); } @@ -94,6 +94,14 @@ </para> @name: +@Returns: + + +<!-- ##### FUNCTION gst_typefactory_get_list ##### --> +<para> + +</para> + @Returns: |