|
|
|
@@ -419,27 +419,9 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame) |
|
|
|
MediaCodecH264DecContext *s = avctx->priv_data; |
|
|
|
int ret; |
|
|
|
|
|
|
|
/* |
|
|
|
* MediaCodec.flush() discards both input and output buffers, thus we |
|
|
|
* need to delay the call to this function until the user has released or |
|
|
|
* renderered the frames he retains. |
|
|
|
* |
|
|
|
* After we have buffered an input packet, check if the codec is in the |
|
|
|
* flushing state. If it is, we need to call ff_mediacodec_dec_flush. |
|
|
|
* |
|
|
|
* ff_mediacodec_dec_flush returns 0 if the flush cannot be performed on |
|
|
|
* the codec (because the user retains frames). The codec stays in the |
|
|
|
* flushing state. |
|
|
|
* |
|
|
|
* ff_mediacodec_dec_flush returns 1 if the flush can actually be |
|
|
|
* performed on the codec. The codec leaves the flushing state and can |
|
|
|
* process again packets. |
|
|
|
* |
|
|
|
* ff_mediacodec_dec_flush returns a negative value if an error has |
|
|
|
* occurred. |
|
|
|
* |
|
|
|
*/ |
|
|
|
if (ff_mediacodec_dec_is_flushing(avctx, s->ctx)) { |
|
|
|
/* In delay_flush mode, wait until the user has released or rendered |
|
|
|
all retained frames. */ |
|
|
|
if (s->delay_flush && ff_mediacodec_dec_is_flushing(avctx, s->ctx)) { |
|
|
|
if (!ff_mediacodec_dec_flush(avctx, s->ctx)) { |
|
|
|
return AVERROR(EAGAIN); |
|
|
|
} |
|
|
|
|