Gst.PadTemplate¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The capabilities of the pad described by the pad template |
||
r/w/co |
The direction of the pad described by the pad template |
||
r/w/co |
The |
||
r/w/co |
The name template of the pad template |
||
r/w/co |
When the pad described by the pad template will become available |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is fired when an element creates a pad from this template. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
caps |
r |
||
direction |
r |
||
name_template |
r |
||
object |
r |
||
presence |
r |
Class Details¶
- class Gst.PadTemplate(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Padtemplates describe the possible media types a pad or an elementfactory can handle. This allows for both inspection of handled types before loading the element plugin as well as identifying pads on elements that are not yet created (request or sometimes pads).
Pad and PadTemplates have
Gst.Caps
attached to it to describe the media type they are capable of dealing with.Gst.PadTemplate.get_caps
() or GST_PAD_TEMPLATE_CAPS() are used to get the caps of a padtemplate. It’s not possible to modify the caps of a padtemplate after creation.PadTemplates have a
Gst.PadPresence
property which identifies the lifetime of the pad and that can be retrieved with GST_PAD_TEMPLATE_PRESENCE(). Also the direction of the pad can be retrieved from theGst.PadTemplate
with GST_PAD_TEMPLATE_DIRECTION().The GST_PAD_TEMPLATE_NAME_TEMPLATE () is important for
Gst.PadPresence.REQUEST
pads because it has to be used as the name in theGst.Element.request_pad_simple
() call to instantiate a pad from this template.Padtemplates can be created with
Gst.PadTemplate.new
() or withGst.StaticPadTemplate.get
(), which creates aGst.PadTemplate
from aGst.StaticPadTemplate
that can be filled with the convenient GST_STATIC_PAD_TEMPLATE() macro.A padtemplate can be used to create a pad (see
Gst.Pad.new_from_template
() orGst.Pad.new_from_static_template
()) or to add to an element class (seeGst.ElementClass.add_static_pad_template
()).The following code example shows the code to create a pad from a padtemplate.
GstStaticPadTemplate my_template = GST_STATIC_PAD_TEMPLATE ( "sink", // the name of the pad GST_PAD_SINK, // the direction of the pad GST_PAD_ALWAYS, // when this pad will be present GST_STATIC_CAPS ( // the capabilities of the padtemplate "audio/x-raw, " "channels = (int) [ 1, 6 ]" ) ); void my_method (void) { GstPad *pad; pad = gst_pad_new_from_static_template (&my_template, "sink"); ... }
The following example shows you how to add the padtemplate to an element class, this is usually done in the class_init of the class:
static void my_element_class_init (GstMyElementClass *klass) { GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); gst_element_class_add_static_pad_template (gstelement_class, &my_template); }
- classmethod new(name_template, direction, presence, caps)[source]¶
- Parameters:
name_template (
str
) – the name template.direction (
Gst.PadDirection
) – theGst.PadDirection
of the template.presence (
Gst.PadPresence
) – theGst.PadPresence
of the pad.
- Returns:
a new
Gst.PadTemplate
.- Return type:
Creates a new pad template with a name according to the given template and with the given arguments.
- classmethod new_from_static_pad_template_with_gtype(pad_template, pad_type)[source]¶
- Parameters:
pad_template (
Gst.StaticPadTemplate
) – the static pad templatepad_type (
GObject.GType
) – TheGObject.GType
of the pad to create
- Returns:
a new
Gst.PadTemplate
.- Return type:
Converts a
Gst.StaticPadTemplate
into aGst.PadTemplate
with a type.New in version 1.14.
- classmethod new_with_gtype(name_template, direction, presence, caps, pad_type)[source]¶
- Parameters:
name_template (
str
) – the name template.direction (
Gst.PadDirection
) – theGst.PadDirection
of the template.presence (
Gst.PadPresence
) – theGst.PadPresence
of the pad.pad_type (
GObject.GType
) – TheGObject.GType
of the pad to create
- Returns:
a new
Gst.PadTemplate
.- Return type:
Creates a new pad template with a name according to the given template and with the given arguments.
New in version 1.14.
- get_documentation_caps()[source]¶
- Returns:
The caps to document. For convenience, this will return
Gst.PadTemplate.get_caps
() when no documentation caps were set.- Return type:
See
Gst.PadTemplate.set_documentation_caps
().New in version 1.18.
- set_documentation_caps(caps)[source]¶
- Parameters:
caps (
Gst.Caps
) – the documented capabilities
Certain elements will dynamically construct the caps of their pad templates. In order not to let environment-specific information into the documentation, element authors should use this method to expose “stable” caps to the reader.
New in version 1.18.
Signal Details¶
- Gst.PadTemplate.signals.pad_created(pad_template, pad)¶
- Signal Name:
pad-created
- Flags:
- Parameters:
pad_template (
Gst.PadTemplate
) – The object which received the signalpad (
Gst.Pad
) – the pad that was created.
This signal is fired when an element creates a pad from this template.
Property Details¶
- Gst.PadTemplate.props.caps¶
- Name:
caps
- Type:
- Default Value:
- Flags:
The capabilities of the pad described by the pad template.
- Gst.PadTemplate.props.direction¶
- Name:
direction
- Type:
- Default Value:
- Flags:
The direction of the pad described by the pad template.
- Gst.PadTemplate.props.gtype¶
- Name:
gtype
- Type:
- Default Value:
<GType void>
- Flags:
The type of the pad described by the pad template.
New in version 1.14.
- Gst.PadTemplate.props.name_template¶
- Name:
name-template
- Type:
- Default Value:
- Flags:
The name template of the pad template.
- Gst.PadTemplate.props.presence¶
- Name:
presence
- Type:
- Default Value:
- Flags:
When the pad described by the pad template will become available.