Ejemplo n.º 1
0
int ff_mediacodec_dec_flush(AVCodecContext *avctx, MediaCodecDecContext *s)
{
    FFAMediaCodec *codec = s->codec;
    int status;

    s->queued_buffer_nb = 0;
    s->dequeued_buffer_nb = 0;

    s->flushing = 0;

    status = ff_AMediaCodec_flush(codec);
    if (status < 0) {
        av_log(NULL, AV_LOG_ERROR, "Failed to flush MediaCodec %p", codec);
        return AVERROR_EXTERNAL;
    }

    s->first_buffer = 0;
    s->first_buffer_at = av_gettime();

    return 0;
}
Ejemplo n.º 2
0
static int mediacodec_dec_flush_codec(AVCodecContext *avctx, MediaCodecDecContext *s)
{
    FFAMediaCodec *codec = s->codec;
    int status;

    s->output_buffer_count = 0;

    s->draining = 0;
    s->flushing = 0;
    s->eos = 0;
    atomic_fetch_add(&s->serial, 1);
    atomic_init(&s->hw_buffer_count, 0);

    status = ff_AMediaCodec_flush(codec);
    if (status < 0) {
        av_log(avctx, AV_LOG_ERROR, "Failed to flush codec\n");
        return AVERROR_EXTERNAL;
    }

    return 0;
}
Ejemplo n.º 3
0
static int mediacodec_dec_flush_codec(AVCodecContext *avctx, MediaCodecDecContext *s)
{
    FFAMediaCodec *codec = s->codec;
    int status;

    s->dequeued_buffer_nb = 0;

    s->draining = 0;
    s->flushing = 0;
    s->eos = 0;

    status = ff_AMediaCodec_flush(codec);
    if (status < 0) {
        av_log(avctx, AV_LOG_ERROR, "Failed to flush codec\n");
        return AVERROR_EXTERNAL;
    }

    s->first_buffer = 0;
    s->first_buffer_at = av_gettime();

    return 0;
}