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 GST_PAD_TEMPLATE_FACTORY (my_template_factory,
27 "sink", /* the name of the pad */
28 GST_PAD_SINK, /* the direction of the pad */
29 GST_PAD_ALWAYS, /* when this pad will be present */
30 GST_CAPS_NEW ( /* the capabilities of the padtemplate */
33 "format", GST_PROPS_STRING ("int"),
34 "channels", GST_PROPS_INT_RANGE (1, 6)
43 pad = gst_pad_new_from_template (GST_PAD_TEMPLATE_GET (my_template_factory), "sink");
49 The following example shows you how to add the padtemplate to an elementfactory:
52 my_factory_init (GstPlugin *plugin)
54 GstElementFactory *factory;
56 factory = gst_element_factory_new ("my_factory", GST_TYPE_MYFACTORY, &gst_myfactory_details);
57 g_return_val_if_fail (factory != NULL, FALSE);
59 gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (my_template_factory));
61 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
69 <!-- ##### SECTION See_Also ##### -->
71 #GstPad, #GstElementFactory
74 <!-- ##### ENUM GstPadPresence ##### -->
76 Indicates when this pad will become available.
79 @GST_PAD_ALWAYS: the pad is always available
80 @GST_PAD_SOMETIMES: the pad will become available depending on the media stream
81 @GST_PAD_REQUEST: th pad is only available on request with
82 gst_element_request_pad_by_name() or gst_element_request_compatible_pad().
84 <!-- ##### STRUCT GstPadTemplate ##### -->
86 The padtemplate object.
90 <!-- ##### SIGNAL GstPadTemplate::pad-created ##### -->
92 This signal is fired when an element creates a pad from this
96 @gstpadtemplate: the object which received the signal.
97 @arg1: The pad that was created.
99 <!-- ##### ENUM GstPadTemplateFlags ##### -->
101 Flags for the padtemplate
104 @GST_PAD_TEMPLATE_FIXED: The padtemplate has no variable properties
105 @GST_PAD_TEMPLATE_FLAG_LAST: first flag that can be used by subclasses.
107 <!-- ##### MACRO GST_PAD_TEMPLATE_CAPS ##### -->
109 Get a handle to the padtemplate #GstCaps
112 @templ: the template to query
115 <!-- ##### MACRO GST_PAD_TEMPLATE_DIRECTION ##### -->
117 Get the direction of the padtemplate.
120 @templ: the template to query
123 <!-- ##### MACRO GST_PAD_TEMPLATE_NAME_TEMPLATE ##### -->
125 Get the nametemplate of the padtemplate.
128 @templ: the template to query
131 <!-- ##### MACRO GST_PAD_TEMPLATE_PRESENCE ##### -->
133 Get the presence of the padtemplate.
136 @templ: the template to query
139 <!-- ##### MACRO GST_PAD_TEMPLATE_IS_FIXED ##### -->
141 Check if the properties of the padtemplate are fixed
144 @templ: the template to query
147 <!-- ##### FUNCTION gst_pad_template_new ##### -->
157 <!-- # Unused Parameters # -->
161 <!-- ##### FUNCTION gst_pad_template_get_caps ##### -->
170 <!-- ##### FUNCTION gst_pad_template_get_caps_by_name ##### -->