These changes include removal of a duplicate usage of "queues", as
well as extending the documentation to include description of all
arguments.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
This replaces the decoder_RequestReload() function. The module implementation
that returns this status should not have modified or released the input block
passed in pf_decoder parameter.
This replaces the decoder_t->b_error boolean.
For now, only decoders that were setting b_error return VLCDEC_ECRITICAL, but a
lot more decoders should use this value since critical errors are often ignored.
Use only one callback for every decoder types:
int (*pf_decode)(decoder_t *, block_t *p_block);
There is now only one way to send output frames/blocks from a decoder module:
using decoder_QueueVideo(), decoder_QueueAudio() and decoder_QueueSub()
functions.
This fixes transcoding not receiving any output when a decoder used
decoder_Queue*() function.
The pf_packetize callback is kept unchanged. A packetizer shouldn't be
asynchronous at all (and this simplify the locking for decoder core).
The pf_decode callback returns, for now, only one value: SUCCESS. This will
allow a module to send more status.
Decoder modules are now responsible for calling decoder_UpdateVideoFormat()
before decoder_NewPicture().
In a lot of modules, decoder_UpdateVideoFormat() could be called in a better
place. Just after dec->fmt_out is updated for example.
This function allow asynchronous decoders to queue a subtitle to the video
output. Decoders that use this function should return NULL in pf_decode_sub
callback.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
This function allow asynchronous decoders to queue an audio block to the audio
output. Decoders that use this function should return NULL in pf_decode_audio
callback.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
This function allow asynchronous decoders to queue a picture to the video
output. Decoders that use this function should return NULL in pf_decode_video
callback.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
When the decoder/packetizer doesn't provide a flush callback, a block with
BLOCK_FLAG_DISCONTINUITY and BLOCK_FLAG_CORRUPTED is pushed downstream.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
When needed (fmt->b_packetized == false), create a packetizer before creating a
decoder. The fmt_in of the decoder is copied either from the fmt_out of the
packetizer, or from the fmt of CreateDecoder.
VLC has status reporting on the input state, but not on the output state.
This makes it impossible to know if playback actually started completely from
checking stream status states.
For instance a failed audio output cannot be determined programatically. This
patch adds an extra field per ES (in src/input/es_out.c) to determine the state
of that ES (DISABLE, ENABLED, ERROR).
If CreateDecoder() cannot instantiate an output, then it set p_dec->b_error = true.
This is used to determine what the return value for es_out_GetEsState() should be.
If p_dec->b_error is true, then it returns an ES_OUT_STATE_ES_ERROR to the caller.
Else it returns ES_OUT_STATE_ES_ENABLED or ES_OUT_STATE_ES_DISABLED.
A function 'es_out_GetEsState()' is available to query an input for the state of
the primary audio, video and SPU elementary streams.