summaryrefslogtreecommitdiff
path: root/libavcodec/mediacodecdec_common.h
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2018-04-24 12:40:38 -0700
committerAman Gupta <aman@tmm1.net>2018-05-04 11:53:33 -0700
commitf6681feda641c026d84f6d207f661bf9b87d9d70 (patch)
tree2050df51d09bd71392045a1d75a310b787f3a4af /libavcodec/mediacodecdec_common.h
parentfe0a6bcbda0f51d0613dbbd42a7635c22530ce95 (diff)
downloadffmpeg-f6681feda641c026d84f6d207f661bf9b87d9d70.tar.gz
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>
Diffstat (limited to 'libavcodec/mediacodecdec_common.h')
-rw-r--r--libavcodec/mediacodecdec_common.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mediacodecdec_common.h b/libavcodec/mediacodecdec_common.h
index 023d4c5fa7..0b21129fee 100644
--- a/libavcodec/mediacodecdec_common.h
+++ b/libavcodec/mediacodecdec_common.h
@@ -65,6 +65,7 @@ typedef struct MediaCodecDecContext {
int display_height;
uint64_t output_buffer_count;
+ ssize_t current_input_buffer;
bool delay_flush;
atomic_int serial;
@@ -78,7 +79,8 @@ int ff_mediacodec_dec_init(AVCodecContext *avctx,
int ff_mediacodec_dec_send(AVCodecContext *avctx,
MediaCodecDecContext *s,
- AVPacket *pkt);
+ AVPacket *pkt,
+ bool wait);
int ff_mediacodec_dec_receive(AVCodecContext *avctx,
MediaCodecDecContext *s,