[vlc-devel] [PATCH 01/11] decoder: add decoder_OnOutputReady
Rémi Denis-Courmont
remi at remlab.net
Wed Aug 26 19:20:06 CEST 2015
On Wednesday 26 August 2015 18:09:58 Thomas Guillem wrote:
> ---
> include/vlc_codec.h | 7 +++++++
> src/input/decoder.c | 6 ++++++
> 2 files changed, 13 insertions(+)
>
> diff --git a/include/vlc_codec.h b/include/vlc_codec.h
> index 0c43978..f417d78 100644
> --- a/include/vlc_codec.h
> +++ b/include/vlc_codec.h
> @@ -241,6 +241,13 @@ VLC_API mtime_t decoder_GetDisplayDate( decoder_t *,
> mtime_t ) VLC_USED; */
> VLC_API int decoder_GetDisplayRate( decoder_t * ) VLC_USED;
>
> +/**
> + * This function wakes up the DecoderThread that will call pf_decode with a
> + * NULL pp_block. This allow asynchronous decoder modules to queue a
> picture + * immediatly from the DecoderThread.
> + */
> +VLC_API void decoder_OnOutputReady( decoder_t * );
> +
> /** @} */
> /** @} */
> #endif /* _VLC_CODEC_H */
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 25eac79..3bcc31c 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -594,6 +594,12 @@ int decoder_GetDisplayRate( decoder_t *p_dec )
>
> return p_dec->pf_get_display_rate( p_dec );
> }
> +/* decoder_OnOutputReady
> + */
> +void decoder_OnOutputReady( decoder_t *p_dec )
> +{
> + input_DecoderDrain( p_dec );
> +}
That function is meant to be called on the input thread. Calling it from the
decoder will likely cause deadlocks. Besides, as the name implies, the
function is literally meant to empty the buffers all the way to the output.
>
> static bool DecoderWaitUnblock( decoder_t *p_dec )
> {
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list