GstAudio.AudioEncoderClass

Fields

Name

Type

Access

Description

close

object

r

Optional. Called when the element changes to Gst.State.NULL. Allows closing external resources.

decide_allocation

object

r

Optional. Setup the allocation parameters for allocating output buffers. The passed in query contains the result of the downstream allocation query. Subclasses should chain up to the parent implementation to invoke the default handler.

element_class

Gst.ElementClass

r

The parent class structure

flush

object

r

Optional. Instructs subclass to clear any codec caches and discard any pending samples and not yet returned encoded data.

getcaps

object

r

Optional. Allows for a custom sink getcaps implementation (e.g. for multichannel input specification). If not implemented, default returns GstAudio.AudioEncoder.proxy_getcaps applied to sink template caps.

handle_frame

object

r

Provides input samples (or None to clear any remaining data) according to directions as configured by the subclass using the API. Input data ref management is performed by base class, subclass should not care or intervene, and input data is only valid until next call to base class, most notably a call to GstAudio.AudioEncoder.finish_frame().

negotiate

object

r

Optional. Negotiate with downstream and configure buffer pools, etc. Subclasses should chain up to the parent implementation to invoke the default handler.

open

object

r

Optional. Called when the element changes to Gst.State.READY. Allows opening external resources.

pre_push

object

r

Optional. Called just prior to pushing (encoded data) buffer downstream. Subclass has full discretionary access to buffer, and a not OK flow return will abort downstream pushing.

propose_allocation

object

r

Optional. Propose buffer allocation parameters for upstream elements. Subclasses should chain up to the parent implementation to invoke the default handler.

set_format

object

r

Notifies subclass of incoming data format. GstAudio.AudioInfo contains the format according to provided caps.

sink_event

object

r

Optional. Event handler on the sink pad. Subclasses should chain up to the parent implementation to invoke the default handler.

sink_query

object

r

Optional. Query handler on the sink pad. This function should return True if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler.

src_event

object

r

Optional. Event handler on the src pad. Subclasses should chain up to the parent implementation to invoke the default handler.

src_query

object

r

Optional. Query handler on the source pad. This function should return True if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler.

start

object

r

Optional. Called when the element starts processing. Allows opening external resources.

stop

object

r

Optional. Called when the element stops processing. Allows closing external resources.

transform_meta

object

r

Optional. Transform the metadata on the input buffer to the output buffer. By default this method copies all meta without tags and meta with only the “audio” tag. subclasses can implement this method and return True if the metadata is to be copied.

Methods

None

Details

class GstAudio.AudioEncoderClass

Subclasses can override any of the available virtual methods or not, as needed. At minimum set_format and handle_frame needs to be overridden.