]> git.sesse.net Git - ffmpeg/commit
avcodec/mediacodecdec: restructure mediacodec_receive_frame
authorAman Gupta <aman@tmm1.net>
Tue, 24 Apr 2018 19:40:38 +0000 (12:40 -0700)
committerAman Gupta <aman@tmm1.net>
Fri, 4 May 2018 18:53:33 +0000 (11:53 -0700)
commitf6681feda641c026d84f6d207f661bf9b87d9d70
tree2050df51d09bd71392045a1d75a310b787f3a4af
parentfe0a6bcbda0f51d0613dbbd42a7635c22530ce95
avcodec/mediacodecdec: restructure mediacodec_receive_frame

The new logic follows a recommendation by @rcombs to use
dequeueInputBuffer with a timeout of 0 as a way to detect
whether the codec wants more data. The dequeued buffer index is
kept in MediaCodecDecContext until it can be used next.

A similar technique is also used by the Google's official media
player Exoplayer: see MediaCodecRenderer.feedInputBuffer().

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
libavcodec/mediacodecdec.c
libavcodec/mediacodecdec_common.c
libavcodec/mediacodecdec_common.h