[vlc-devel] [PATCH 0/3] Android MediaCodec direct rendering
felix.abecassis at gmail.com
Fri Nov 15 18:24:18 CET 2013
2013/11/15 Rémi Denis-Courmont <remi at remlab.net>
> If the hardware (driver) does not provide enough picture for decoding,
> then you are screwed, period. Depending on the codec (and profile), you
> need a certain minimum number of concurrent pictures.
> If however you are merely waiting for pictures to free up, then it might
> just mean you are not keeping track of them correctly. Note that the video
> output prepare and display callbacks bear little to no relevance to the
> picture references. A single picture may be displayed more than once (for
> instance when paused), or never (due to frame skip or preroll).
I don't think that's the issue. It looks like no pictures are being
displayed before the decoder has returned N pictures.
If N is greater that the number of MediaCodec output buffers then the
decoder is called repeatedly but it can neither accept an input block nor
return a frame since all the output buffers are currently associated with
pictures that are currently in flight.
The only way for the decoder to make progress is to release output buffers
by displaying or skipping frames.
By returning fake pictures, the pictures associated to real buffers will
start getting displayed (or skipped), freeing some buffers and unblocking
Another way to solve this issue is to apply the following patch (by Martin)
@@ -1391,12 +1391,13 @@ static void DecoderPlayVideo( decoder_t *p_dec,
DecoderWaitUnblock( p_dec, &b_reject
if( p_owner->b_buffering && !p_owner->buffer.b_first
bool b_buffering_first =
@@ -1415,8 +1416,8 @@ static void DecoderPlayVideo( decoder_t *p_dec,
- assert( p_owner->buffer.b_first
- assert( !p_owner->buffer.i_count
+// assert( p_owner->buffer.b_first
+// assert( !p_owner->buffer.i_count
msg_Dbg( p_dec, "Received first picture"
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vlc-devel