From: Wim Taymans Date: Wed, 24 Oct 2001 21:44:48 +0000 (+0000) Subject: Split out the padtemplate, autoplugfactoy and elementfactory into different pages... X-Git-Tag: BRANCH-BUILD1-ROOT~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bb01afa843fb2923ff0d932d07fdcf681c77d78;p=platform%2Fupstream%2Fgstreamer.git Split out the padtemplate, autoplugfactoy and elementfactory into different pages to be able to show more examples an... Original commit message from CVS: Split out the padtemplate, autoplugfactoy and elementfactory into different pages to be able to show more examples and the object hierarchy. --- diff --git a/docs/gst/gstreamer-docs.sgml b/docs/gst/gstreamer-docs.sgml index fb3c81e..8e6f224 100644 --- a/docs/gst/gstreamer-docs.sgml +++ b/docs/gst/gstreamer-docs.sgml @@ -1,6 +1,8 @@ + + @@ -9,12 +11,13 @@ + - - + + @@ -65,6 +68,7 @@ with some more specialized elements. &Gst; &GstAutoplug; + &GstAutoplugFactory; &GstBin; &GstBuffer; &GstBufferPool; @@ -73,10 +77,12 @@ with some more specialized elements. &GstCpu; &GstData; &GstElement; + &GstElementFactory; &GstEvent; &GstInfo; &GstObject; &GstPad; + &GstPadTemplate; &GstParse; &GstPipeline; &GstPlugin; @@ -100,32 +106,8 @@ with some more specialized elements. libgstelements.la provide some basic elements like a disk source - and sink. The use of these elements is strictly though the gtk_object_get() and - gtk_object_set() functions and the GStreamer Core Library functions. - - - Use the gst_elementfactory_find() and gst_elementfactory_create() functions - to create these elements. - - - The following code example shows you how to create a GstDiskSrc element. - - - - - #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); - ... - + and sink. The use of these elements is strictly though the g_object_get() and + g_object_set() functions and the GStreamer Core Library functions. &GstAggregator; diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index b410b8c..1be9bf4 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -485,8 +485,6 @@ GST_ELEMENT_PADS GST_ELEMENT_SCHED GST_ELEMENT_MANAGER GstElement -GstElementDetails -GstElementFactory GstElementLoopFunction gst_element_class_add_padtemplate gst_element_destroy @@ -516,14 +514,6 @@ gst_element_error gst_element_get_factory gst_element_signal_eos gst_element_restore_thyself -gst_elementfactory_new -gst_elementfactory_add_padtemplate -gst_elementfactory_find -gst_elementfactory_get_list -gst_elementfactory_can_src_caps -gst_elementfactory_can_sink_caps -gst_elementfactory_create -gst_elementfactory_make GstElementClass GST_TYPE_ELEMENT @@ -534,12 +524,27 @@ GST_ELEMENT_CLASS_FAST GST_IS_ELEMENT GST_IS_ELEMENT_CLASS gst_element_get_type -gst_elementfactory_get_type -GstElementFactoryClass -GST_TYPE_ELEMENTFACTORY + + +
+gstelementfactory +GstElementFactory +GstElementDetails +gst_elementfactory_new +gst_elementfactory_find +gst_elementfactory_get_list +gst_elementfactory_add_padtemplate +gst_elementfactory_can_src_caps +gst_elementfactory_can_sink_caps +gst_elementfactory_create +gst_elementfactory_make + +GstElementFactory GST_ELEMENTFACTORY -GST_ELEMENTFACTORY_CLASS GST_IS_ELEMENTFACTORY +GST_TYPE_ELEMENTFACTORY +gst_elementfactory_get_type +GST_ELEMENTFACTORY_CLASS GST_IS_ELEMENTFACTORY_CLASS
@@ -549,16 +554,9 @@ GST_IS_ELEMENTFACTORY_CLASS GstAutoplug GstAutoplug GstAutoplugFlags -GstAutoplugFactory gst_autoplug_signal_new_object gst_autoplug_to_caps gst_autoplug_to_renderers -gst_autoplugfactory_new -gst_autoplugfactory_destroy -gst_autoplugfactory_find -gst_autoplugfactory_get_list -gst_autoplugfactory_create -gst_autoplugfactory_make GST_AUTOPLUG GST_IS_AUTOPLUG @@ -566,6 +564,19 @@ GST_TYPE_AUTOPLUG gst_autoplug_get_type GST_AUTOPLUG_CLASS GST_IS_AUTOPLUG_CLASS + + +
+gstautoplugfactory +GstAutoplugFactory +GstAutoplugFactory +gst_autoplugfactory_new +gst_autoplugfactory_destroy +gst_autoplugfactory_find +gst_autoplugfactory_get_list +gst_autoplugfactory_create +gst_autoplugfactory_make + gst_autoplugfactory_get_type GstAutoplugFactoryClass GST_TYPE_AUTOPLUGFACTORY @@ -745,21 +756,6 @@ GST_GPAD_REALPAD GstGhostPad gst_ghost_pad_new -GstPadPresence -GstPadTemplate -GST_PADTEMPLATE_CAPS -GST_PADTEMPLATE_DIRECTION -GST_PADTEMPLATE_NAME_TEMPLATE -GST_PADTEMPLATE_PRESENCE -GST_PADTEMPLATE_NEW -GST_PADTEMPLATE_FACTORY -GST_PADTEMPLATE_GET -gst_padtemplate_new -gst_padtemplate_load_thyself -gst_padtemplate_save_thyself -gst_padtemplate_get_caps -gst_padtemplate_get_caps_by_name - GstPadClass GST_TYPE_PAD @@ -793,7 +789,27 @@ GST_IS_GHOST_PAD GST_IS_GHOST_PAD_CLASS GST_IS_GHOST_PAD_FAST gst_ghost_pad_get_type +
+ +
+gstpadtemplate +GstPadTemplate +GstPadPresence +GstPadTemplate +GST_PADTEMPLATE_CAPS +GST_PADTEMPLATE_DIRECTION +GST_PADTEMPLATE_NAME_TEMPLATE +GST_PADTEMPLATE_PRESENCE +GST_PADTEMPLATE_NEW +GST_PADTEMPLATE_FACTORY +GST_PADTEMPLATE_GET +gst_padtemplate_new +gst_padtemplate_load_thyself +gst_padtemplate_save_thyself +gst_padtemplate_get_caps +gst_padtemplate_get_caps_by_name + GstPadTemplateClass GST_TYPE_PADTEMPLATE GST_PADTEMPLATE @@ -938,6 +954,7 @@ GstTypeDefinition GstTypeFindFunc gst_typefactory_new gst_typefactory_find +gst_typefactory_get_list GST_TYPEFACTORY GST_IS_TYPEFACTORY diff --git a/docs/gst/gstreamer.hierarchy b/docs/gst/gstreamer.hierarchy index 9b9cf68..a5e36a2 100644 --- a/docs/gst/gstreamer.hierarchy +++ b/docs/gst/gstreamer.hierarchy @@ -47,6 +47,7 @@ GtkObject GstQueue GstTypeFind GstPad + GstPadTemplate GstPluginFeature GstAutoplugFactory GstTypeFactory diff --git a/docs/gst/tmpl/gstautoplug.sgml b/docs/gst/tmpl/gstautoplug.sgml index f07c1c5..61d1925 100644 --- a/docs/gst/tmpl/gstautoplug.sgml +++ b/docs/gst/tmpl/gstautoplug.sgml @@ -13,14 +13,12 @@ non renderer ones do. -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). -A list of all available autopluggers can be obtained with gst_autoplugfactory_get_list(). - - 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 @@ compatible with the provided sink caps. 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. @@ -110,12 +108,6 @@ The type of the autoplugger. @GST_AUTOPLUG_TO_RENDERER: @GST_AUTOPLUG_FLAG_LAST: - - - - - - @@ -149,57 +141,3 @@ The type of the autoplugger. @Returns: - - - - - -@name: -@longdesc: -@type: -@Returns: - - - - - - - -@factory: - - - - - - - -@name: -@Returns: - - - - - - - -@Returns: - - - - - - - -@factory: -@Returns: - - - - - - - -@name: -@Returns: - - diff --git a/docs/gst/tmpl/gstautoplugfactory.sgml b/docs/gst/tmpl/gstautoplugfactory.sgml new file mode 100644 index 0000000..649c2aa --- /dev/null +++ b/docs/gst/tmpl/gstautoplugfactory.sgml @@ -0,0 +1,93 @@ + +GstAutoplugFactory + + +Create autopluggers from a factory. + + + +An autoplugfactory is used to create instances of an autoplugger. It +can be added to a #GstPlugin as it extends #GstPluginFeature. + + +Use gst_autoplugfactory_new() to create a new autoplugger which can be registered +to a plugin with gst_plugin_add_feature(). + + +Use gst_autoplugfactory_find() to find the named autoplugfactory. +or use gst_autoplugfactory_get_list() to get a list of all available autopluggers. + + +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. + + +Use gst_autoplugfactory_destroy() to remove the factory from the global list. + + + + +#GstAutoplug, #GstPlugin, #GstPluginFeature. + + + + + + + + + + + + + +@name: +@longdesc: +@type: +@Returns: + + + + + + + +@factory: + + + + + + + +@name: +@Returns: + + + + + + + +@Returns: + + + + + + + +@factory: +@Returns: + + + + + + + +@name: +@Returns: + + diff --git a/docs/gst/tmpl/gstelement.sgml b/docs/gst/tmpl/gstelement.sgml index 5903439..8bdb5db 100644 --- a/docs/gst/tmpl/gstelement.sgml +++ b/docs/gst/tmpl/gstelement.sgml @@ -25,7 +25,7 @@ simpler to connect pads of two elements together. - +#GstElementFactory @@ -205,27 +205,6 @@ Get the manager of this element. - - -This struct is used to define public information about the element. It -describes the element, mostly for the benefit of editors. - - -@longname: -@klass: -@description: -@version: -@author: -@copyright: - - - -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. - - - This function type is used to specify a loop function for the element. It @@ -502,86 +481,6 @@ instead. @Returns: - - - - - -@name: -@type: -@details: -@Returns: - - - - - - - -@elementfactory: -@templ: - -@temp: -@pad: - - - - - - - -@name: -@Returns: - - - - - - - -@Returns: - - - - - - - -@factory: -@caps: -@Returns: - - - - - - - -@factory: -@caps: -@Returns: - - - - - - - -@factory: -@name: -@Returns: - - - - - - - -@factoryname: -@name: -@Returns: - - Is trigered whenever the state of an element changes diff --git a/docs/gst/tmpl/gstelementfactory.sgml b/docs/gst/tmpl/gstelementfactory.sgml new file mode 100644 index 0000000..9d31aa2 --- /dev/null +++ b/docs/gst/tmpl/gstelementfactory.sgml @@ -0,0 +1,149 @@ + +GstElementFactory + + +Create GstElements from a factory + + + +GstElementFactory is used to create instances of elements. A GstElementfactory +can be added to a #GstPlugin as it is also a #GstPluginFeature. + + +Use gst_elementfactory_new() to create a new factory which can be added to a plugin +with gst_plugin_add_feature(). + + +gst_elementfactory_get_list() is used to get a list of all available factories in +the plugin repository. + + +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. + + +Use the gst_elementfactory_find() and gst_elementfactory_create() functions +to create element instances or use gst_elementfactory_make() as a convenient +shortcut. + + +The following code example shows you how to create a GstDiskSrc element. + + + + + #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); + ... + + + + + +#GstElement, #GstPlugin, #GstPluginFeature, #GstPadTemplate. + + + + +This struct is used to define public information about the element. It +describes the element, mostly for the benefit of editors. + + +@longname: +@klass: +@description: +@version: +@author: +@copyright: + + + + + + +@name: +@type: +@details: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@Returns: + + + + + + + +@elementfactory: +@templ: + +@temp: +@pad: + + + + + + + +@factory: +@caps: +@Returns: + + + + + + + +@factory: +@caps: +@Returns: + + + + + + + +@factory: +@name: +@Returns: + + + + + + + +@factoryname: +@name: +@Returns: + + diff --git a/docs/gst/tmpl/gstpad.sgml b/docs/gst/tmpl/gstpad.sgml index 0083f07..9d493e0 100644 --- a/docs/gst/tmpl/gstpad.sgml +++ b/docs/gst/tmpl/gstpad.sgml @@ -11,38 +11,12 @@ connections. After two pad are retrieved from an element with gst_element_get_pa can be connected with gst_pad_connect(). -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(). -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. - -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"); - ... -} - +manipulate the caps of the pads. Pads created from a padtemplate cannot set capabilities that are incompatible with the padtemplates capabilities. @@ -51,7 +25,7 @@ Pads without padtemplates can be created with gst_pad_new() which takes a direct a name as an argument. -gst_pad_get_parent() will retrieve the GstElement that owns the pad. +gst_pad_get_parent() will retrieve the #GstElement that owns the pad. GstElements creating a pad will typicilally use the various gst_pad_set_*_function() calls @@ -61,7 +35,7 @@ to register callbacks for various events on the pads. 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. To send an event on a pad, use gst_pad_send_event(). @@ -69,7 +43,7 @@ To send an event on a pad, use gst_pad_send_event(). -#GstCaps, #GstElement, #GstEvent +#GstPadTemplate, #GstElement, #GstEvent @@ -911,139 +885,3 @@ Get the real pad of this ghost pad. @Returns: - - -Indicates when this pad will become available. - - -@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(). - - - - - - -@object: -@name_template: -@direction: -@presence: -@caps: - - - -Get a handle to the padtemplate #GstCaps - - -@templ: the template to query - - - - -Get the direction of the padtemplate. - - -@templ: the template to query - - - - -Get the nametemplate of the padtemplate. - - -@templ: the template to query - - - - -Get the presence of the padtemplate. - - -@templ: the template to query - - - - -Create a new padtemplate. - - -@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() - - - - -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. - - -@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() - - - - -Get the padtemplate of the factory created with GST_PADTEMPLATE_FACTORY() - - -@fact: the factory name to get the padtemplate from. - - - - - - - -@name_template: -@direction: -@presence: -@caps: -@Varargs: -@Returns: - - - - - - - -@parent: -@Returns: - - - - - - - -@templ: -@parent: -@Returns: - - - - - - - -@templ: -@Returns: - - - - - - - -@templ: -@name: -@Returns: - - diff --git a/docs/gst/tmpl/gstpadtemplate.sgml b/docs/gst/tmpl/gstpadtemplate.sgml new file mode 100644 index 0000000..39d714e --- /dev/null +++ b/docs/gst/tmpl/gstpadtemplate.sgml @@ -0,0 +1,212 @@ + +GstPadTemplate + + +Describe the media type of a pad. + + + +Padtemplates describe the possible media types a pad or an elementfactory can +handle. + + +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. + + +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. + + +The following code example shows the code to create a pad from a padtemplate. + + 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"); + ... + } + + + +The following example shows you how to add the padtemplate to an elementfactory: + + 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; + } + + + + + + +#GstPad, #GstElementFactory + + + + +Indicates when this pad will become available. + + +@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(). + + + + + + + + + +Get a handle to the padtemplate #GstCaps + + +@templ: the template to query + + + + +Get the direction of the padtemplate. + + +@templ: the template to query + + + + +Get the nametemplate of the padtemplate. + + +@templ: the template to query + + + + +Get the presence of the padtemplate. + + +@templ: the template to query + + + + +Create a new padtemplate. + + +@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() + + + + +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. + + +@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() + + + + +Get the padtemplate of the factory created with GST_PADTEMPLATE_FACTORY() + + +@fact: the factory name to get the padtemplate from. + + + + + + + +@name_template: +@direction: +@presence: +@caps: +@Varargs: +@Returns: + + + + + + + +@parent: +@Returns: + + + + + + + +@templ: +@parent: +@Returns: + + + + + + + +@templ: +@Returns: + + + + + + + +@templ: +@name: +@Returns: + + + + + + + +@gstpadtemplate: the object which received the signal. +@arg1: + diff --git a/docs/gst/tmpl/gstreamer-unused.sgml b/docs/gst/tmpl/gstreamer-unused.sgml index 9e2cab1..900eee8 100644 --- a/docs/gst/tmpl/gstreamer-unused.sgml +++ b/docs/gst/tmpl/gstreamer-unused.sgml @@ -2423,6 +2423,14 @@ Get the size of the file. + + +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. + + + diff --git a/docs/gst/tmpl/gsttypefactory.sgml b/docs/gst/tmpl/gsttypefactory.sgml index a3e03af..f5ed4fc 100644 --- a/docs/gst/tmpl/gsttypefactory.sgml +++ b/docs/gst/tmpl/gsttypefactory.sgml @@ -20,8 +20,8 @@ gst_plugin_add_feature() as shown in the example: { 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); } @@ -97,3 +97,11 @@ performed by a plugin. @Returns: + + + + + +@Returns: + +