1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Describe the media type of a pad.
7 <!-- ##### SECTION Long_Description ##### -->
9 Padtemplates describe the possible media types a pad or an elementfactory can
13 Pad and PadTemplates have #GstCaps attached to it to describe the media type they
14 are capable of dealing with. gst_pad_template_get_caps() is used to get the
15 caps of a padtemplate. It's not possible to modify the caps of a padtemplate after
19 Padtemplates can be created with gst_pad_template_new() or with the convenient
20 GST_PAD_TEMPLATE_FACTORY() macro. A padtemplate can be used to create a pad or
21 to add to an elementfactory.
24 The following code example shows the code to create a pad from a padtemplate.
26 <title>Create a pad from a padtemplate</title>
28 GstStaticPadTemplate my_template =
29 GST_STATIC_PAD_TEMPLATE (
30 "sink", /* the name of the pad */
31 GST_PAD_SINK, /* the direction of the pad */
32 GST_PAD_ALWAYS, /* when this pad will be present */
33 GST_STATIC_CAPS ( /* the capabilities of the padtemplate */
35 "channels = (int) [ 1, 6 ]"
44 pad = gst_pad_new_from_template (GST_PAD_TEMPLATE_GET (my_template_factory), "sink");
51 The following example shows you how to add the padtemplate to an elementfactory:
54 my_factory_init (GstPlugin *plugin)
56 GstElementFactory *factory;
58 factory = gst_element_factory_new ("my_factory", GST_TYPE_MYFACTORY, &gst_myfactory_details);
59 g_return_val_if_fail (factory != NULL, FALSE);
61 gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (my_template_factory));
63 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
71 <!-- ##### SECTION See_Also ##### -->
73 #GstPad, #GstElementFactory
76 <!-- ##### STRUCT GstPadTemplate ##### -->
78 The padtemplate object.
82 <!-- ##### SIGNAL GstPadTemplate::pad-created ##### -->
84 This signal is fired when an element creates a pad from this
88 @gstpadtemplate: the object which received the signal.
89 @arg1: The pad that was created.
91 <!-- ##### STRUCT GstStaticPadTemplate ##### -->
101 <!-- ##### MACRO GST_IS_PAD_FAST ##### -->
109 <!-- ##### MACRO GST_PAD_TEMPLATE_NAME_TEMPLATE ##### -->
111 Get the nametemplate of the padtemplate.
114 @templ: the template to query
117 <!-- ##### MACRO GST_PAD_TEMPLATE_DIRECTION ##### -->
119 Get the direction of the padtemplate.
122 @templ: the template to query
125 <!-- ##### MACRO GST_PAD_TEMPLATE_PRESENCE ##### -->
127 Get the presence of the padtemplate.
130 @templ: the template to query
133 <!-- ##### MACRO GST_PAD_TEMPLATE_CAPS ##### -->
135 Get a handle to the padtemplate #GstCaps
138 @templ: the template to query
141 <!-- ##### MACRO GST_PAD_TEMPLATE_IS_FIXED ##### -->
143 Check if the properties of the padtemplate are fixed
146 @templ: the template to query
149 <!-- ##### ENUM GstPadTemplateFlags ##### -->
151 Flags for the padtemplate
154 @GST_PAD_TEMPLATE_FIXED: the padtemplate has no variable properties
155 @GST_PAD_TEMPLATE_FLAG_LAST: first flag that can be used by subclasses.
157 <!-- ##### FUNCTION gst_pad_template_new ##### -->
167 <!-- # Unused Parameters # -->
171 <!-- ##### FUNCTION gst_static_pad_template_get ##### -->
178 <!-- # Unused Parameters # -->
182 <!-- ##### FUNCTION gst_static_pad_template_get_caps ##### -->
191 <!-- ##### FUNCTION gst_pad_template_get_caps ##### -->