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.
Subclasses can override any of the available optional virtual methods or not, as needed. At minimum,
load_from_buffer
(orload_from_custom)
,get_supported_output_modes,
anddecode
need to be overridden.All functions are called with a locked decoder mutex.
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 callload_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.