Gst.ElementClass

Fields

Name

Type

Access

Description

change_state

object

r

called by set_state to perform an incremental state change

elementfactory

Gst.ElementFactory

r

the Gst.ElementFactory that creates these elements

get_state

object

r

get the state of the element

metadata

object

r

metadata for elements of this class

no_more_pads

object

r

numpadtemplates

int

r

the number of padtemplates

pad_added

object

r

pad_removed

object

r

pad_templ_cookie

int

r

changed whenever the padtemplates change

padtemplates

[object]

r

a GLib.List of Gst.PadTemplate

parent_class

Gst.ObjectClass

r

the parent class structure

post_message

object

r

called when a message is posted on the element. Chain up to the parent class’ handler to have it posted on the bus.

provide_clock

object

r

gets the Gst.Clock provided by the element

query

object

r

perform a Gst.Query on the element

release_pad

object

r

called when a request pad is to be released

request_new_pad

object

r

called when a new pad is requested

send_event

object

r

send a Gst.Event to the element

set_bus

object

r

set a Gst.Bus on the element

set_clock

object

r

set the Gst.Clock on the element

set_context

object

r

set a Gst.Context on the element

set_state

object

r

set a new state on the element

state_changed

object

r

called immediately after a new state was set.

Methods

add_metadata (key, value)

add_pad_template (templ)

add_static_metadata (key, value)

add_static_pad_template (static_templ)

add_static_pad_template_with_gtype (static_templ, pad_type)

get_metadata (key)

get_pad_template (name)

get_pad_template_list ()

set_metadata (longname, classification, description, author)

set_static_metadata (longname, classification, description, author)

Details

class Gst.ElementClass

GStreamer element class. Override the vmethods to implement the element functionality.

add_metadata(key, value)[source]
Parameters:
  • key (str) – the key to set

  • value (str) – the value to set

Set key with value as metadata in self.

add_pad_template(templ)[source]
Parameters:

templ (Gst.PadTemplate) – a Gst.PadTemplate to add to the element class.

Adds a padtemplate to an element class. This is mainly used in the _class_init functions of classes. If a pad template with the same name as an already existing one is added the old one is replaced by the new one.

templ's reference count will be incremented, and any floating reference will be removed (see gst_object_ref_sink())

add_static_metadata(key, value)[source]
Parameters:
  • key (str) – the key to set

  • value (str) – the value to set

Set key with value as metadata in self.

Same as Gst.ElementClass.add_metadata(), but value must be a static string or an inlined string, as it will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.)

add_static_pad_template(static_templ)[source]
Parameters:

static_templ (Gst.StaticPadTemplate) – Gst.StaticPadTemplate to add as pad template to the element class.

Adds a pad template to an element class based on the static pad template templ. This is mainly used in the _class_init functions of element implementations. If a pad template with the same name already exists, the old one is replaced by the new one.

New in version 1.8.

add_static_pad_template_with_gtype(static_templ, pad_type)[source]
Parameters:

Adds a pad template to an element class based on the static pad template templ. This is mainly used in the _class_init functions of element implementations. If a pad template with the same name already exists, the old one is replaced by the new one.

New in version 1.14.

get_metadata(key)[source]
Parameters:

key (str) – the key to get

Returns:

the metadata for key.

Return type:

str

Get metadata with key in self.

get_pad_template(name)[source]
Parameters:

name (str) – the name of the Gst.PadTemplate to get.

Returns:

the Gst.PadTemplate with the given name, or None if none was found. No unreferencing is necessary.

Return type:

Gst.PadTemplate or None

Retrieves a padtemplate from self with the given name.

If you use this function in the GObject.InstanceInitFunc of an object class that has subclasses, make sure to pass the g_class parameter of the GObject.InstanceInitFunc here.

get_pad_template_list()[source]
Returns:

the GLib.List of pad templates.

Return type:

[Gst.PadTemplate]

Retrieves a list of the pad templates associated with self. The list must not be modified by the calling code.

If you use this function in the GObject.InstanceInitFunc of an object class that has subclasses, make sure to pass the g_class parameter of the GObject.InstanceInitFunc here.

set_metadata(longname, classification, description, author)[source]
Parameters:
  • longname (str) – The long English name of the element. E.g. “File Sink”

  • classification (str) – String describing the type of element, as an unordered list separated with slashes (‘/’). See draft-klass.txt of the design docs for more details and common types. E.g: “Sink/File”

  • description (str) – Sentence describing the purpose of the element. E.g: “Write stream to a file”

  • author (str) – Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: “Joe Bloggs <joe.blogs at foo.com>”

Sets the detailed information for a Gst.ElementClass.

This function is for use in _class_init functions only.

set_static_metadata(longname, classification, description, author)[source]
Parameters:
  • longname (str) – The long English name of the element. E.g. “File Sink”

  • classification (str) – String describing the type of element, as an unordered list separated with slashes (‘/’). See draft-klass.txt of the design docs for more details and common types. E.g: “Sink/File”

  • description (str) – Sentence describing the purpose of the element. E.g: “Write stream to a file”

  • author (str) – Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: “Joe Bloggs <joe.blogs at foo.com>”

Sets the detailed information for a Gst.ElementClass.

This function is for use in _class_init functions only.

Same as Gst.ElementClass.set_metadata(), but longname, classification, description, and author must be static strings or inlined strings, as they will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.)