mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec: add AVHWAccel.flush callback
This commit is contained in:
parent
be07145109
commit
6733a1a456
@ -1452,6 +1452,9 @@ static void av1_decode_flush(AVCodecContext *avctx)
|
||||
|
||||
ff_cbs_fragment_reset(&s->current_obu);
|
||||
ff_cbs_flush(s->cbc);
|
||||
|
||||
if (avctx->hwaccel && avctx->hwaccel->flush)
|
||||
avctx->hwaccel->flush(avctx);
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(AV1DecContext, x)
|
||||
|
@ -2267,6 +2267,11 @@ typedef struct AVHWAccel {
|
||||
* @param data the per-frame hardware accelerator private data to be freed.
|
||||
*/
|
||||
void (*free_frame_priv)(void *hwctx, uint8_t *data);
|
||||
|
||||
/**
|
||||
* Callback to flush the hwaccel state.
|
||||
*/
|
||||
void (*flush)(AVCodecContext *avctx);
|
||||
} AVHWAccel;
|
||||
|
||||
/**
|
||||
|
@ -484,6 +484,9 @@ static void h264_decode_flush(AVCodecContext *avctx)
|
||||
|
||||
ff_h264_free_tables(h);
|
||||
h->context_initialized = 0;
|
||||
|
||||
if (avctx->hwaccel && avctx->hwaccel->flush)
|
||||
avctx->hwaccel->flush(avctx);
|
||||
}
|
||||
|
||||
static int get_last_needed_nal(H264Context *h)
|
||||
|
@ -3708,6 +3708,9 @@ static void hevc_decode_flush(AVCodecContext *avctx)
|
||||
av_buffer_unref(&s->rpu_buf);
|
||||
s->max_ra = INT_MAX;
|
||||
s->eos = 1;
|
||||
|
||||
if (avctx->hwaccel && avctx->hwaccel->flush)
|
||||
avctx->hwaccel->flush(avctx);
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(HEVCContext, x)
|
||||
|
@ -167,6 +167,9 @@ static void vp8_decode_flush_impl(AVCodecContext *avctx, int free_mem)
|
||||
|
||||
if (free_mem)
|
||||
free_buffers(s);
|
||||
|
||||
if (avctx->hwaccel && avctx->hwaccel->flush)
|
||||
avctx->hwaccel->flush(avctx);
|
||||
}
|
||||
|
||||
static void vp8_decode_flush(AVCodecContext *avctx)
|
||||
|
@ -1801,6 +1801,9 @@ static void vp9_decode_flush(AVCodecContext *avctx)
|
||||
vp9_frame_unref(avctx, &s->s.frames[i]);
|
||||
for (i = 0; i < 8; i++)
|
||||
ff_thread_release_ext_buffer(avctx, &s->s.refs[i]);
|
||||
|
||||
if (avctx->hwaccel && avctx->hwaccel->flush)
|
||||
avctx->hwaccel->flush(avctx);
|
||||
}
|
||||
|
||||
static av_cold int vp9_decode_init(AVCodecContext *avctx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user