diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-30 21:33:24 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-05 19:54:09 +0200 |
commit | ce7dbd0481f990e249c2a05f179228489d3062cf (patch) | |
tree | c5f04e58129705430e1d97a5842131b72e250083 /libavcodec/vp8.c | |
parent | fb59a42ef977dd91085a602f10c9c82f88d072e5 (diff) |
avcodec/codec_internal: Make FFCodec.decode use AVFrame*
This increases type-safety by avoiding conversions from/through void*.
It also avoids the boilerplate "AVFrame *frame = data;" line
for non-subtitle decoders.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r-- | libavcodec/vp8.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 2e7ca63236..acb61ceede 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -2625,7 +2625,7 @@ static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, } static av_always_inline -int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, +int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const AVPacket *avpkt, int is_vp7) { VP8Context *s = avctx->priv_data; @@ -2800,7 +2800,7 @@ skip_decode: s->prob[0] = s->prob[1]; if (!s->invisible) { - if ((ret = av_frame_ref(data, curframe->tf.f)) < 0) + if ((ret = av_frame_ref(rframe, curframe->tf.f)) < 0) return ret; *got_frame = 1; } @@ -2811,17 +2811,17 @@ err: return ret; } -int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +int ff_vp8_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - return vp78_decode_frame(avctx, data, got_frame, avpkt, IS_VP8); + return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP8); } #if CONFIG_VP7_DECODER -static int vp7_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int vp7_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - return vp78_decode_frame(avctx, data, got_frame, avpkt, IS_VP7); + return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP7); } #endif /* CONFIG_VP7_DECODER */ |