GstBadAudio.NonstreamAudioDecoderClass

Fields

Name

Type

Access

Description

decide_allocation

object

r

decode

object

r

element_class

Gst.ElementClass

r

The parent class structure

get_current_subsong

object

r

get_main_tags

object

r

get_num_loops

object

r

get_num_subsongs

object

r

get_subsong_duration

object

r

get_subsong_tags

object

r

get_supported_output_modes

object

r

load_from_buffer

object

r

load_from_custom

object

r

loads_from_sinkpad

bool

r

negotiate

object

r

propose_allocation

object

r

seek

object

r

set_current_subsong

object

r

set_num_loops

object

r

set_output_mode

object

r

set_subsong_mode

object

r

tell

object

r

Methods

None

Details

class GstBadAudio.NonstreamAudioDecoderClass

Subclasses can override any of the available optional virtual methods or not, as needed. At minimum, load_from_buffer (or load_from_custom), get_supported_output_modes, and decode need to be overridden.

All functions are called with a locked decoder mutex.

If GST_ELEMENT_ERROR, GST_ELEMENT_WARNING, or GST_ELEMENT_INFO are called from inside one of these functions, it is strongly recommended to unlock the decoder mutex before and re-lock it after these macros to prevent potential deadlocks in case the application does something with the element when it receives an ERROR/WARNING/INFO message. Same goes for Gst.Element.post_message() calls and non-serialized events.

By default, this class works by reading media data from the sinkpad, and then commencing playback. Some decoders cannot be given data from a memory block, so the usual way of reading all upstream data and passing it to load_from_buffer doesn’t work then. In this case, set the value of loads_from_sinkpad to False. This changes the way this class operates; it does not require a sinkpad to exist anymore, and will call load_from_custom instead. One example of a decoder where this makes sense is UADE (Unix Amiga Delitracker Emulator). For some formats (such as TFMX), it needs to do the file loading by itself. Since most decoders can read input data from a memory block, the default value of loads_from_sinkpad is True.