[vlc-devel] [PATCH 3/3] mediacodec: implementation of MediaCodec direct rendering based on the work by Martin Storsjö.

Rémi Denis-Courmont remi at remlab.net
Mon Dec 30 15:55:32 CET 2013


Le lundi 30 décembre 2013, 15:35:45 Felix Abecassis a écrit :
> Good point, thanks.
> 
> MediaCodec opaque direct rendering does not make sense with
> transcoding since we need an Android surface for rendering.

That's not a good thing at all IMHO. VDPAU has fallback support for copying 
back to main memory to preserve transcoding - even if it might slow it down.

> With this assumption, would it now make sense to call
> input_DecoderIsExitRequested?

Even if we allow hardware decoding to break transcode, empirically, this will 
sooner or later get copied into a different code path where it will 
nonobviously be wrong.

> But this raises another question I haven't thought of: is there a way
> to know if the decoder was instantiated by a transcoder?

The encapsulation principle forbids it. If it were really required, you would 
have to add a new decoder callback.

But I am not convinced that it really fixes all race conditions. The lock scope 
does not cover the surface allocation so the TOCTOU issue should remain.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list