GstBadAudio.NonstreamAudioDecoderClass¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
decide_allocation |
r |
||
decode |
r |
||
element_class |
r |
The parent class structure |
|
get_current_subsong |
r |
||
get_main_tags |
r |
||
get_num_loops |
r |
||
get_num_subsongs |
r |
||
get_subsong_duration |
r |
||
get_subsong_tags |
r |
||
get_supported_output_modes |
r |
||
load_from_buffer |
r |
||
load_from_custom |
r |
||
loads_from_sinkpad |
r |
||
negotiate |
r |
||
propose_allocation |
r |
||
seek |
r |
||
set_current_subsong |
r |
||
set_num_loops |
r |
||
set_output_mode |
r |
||
set_subsong_mode |
r |
||
tell |
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 isTrue
.