aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp8.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-08-01 19:44:22 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-08-07 09:50:29 +0200
commite35dfe864d8fb1ee9e28684a5a93e4b75d0d8092 (patch)
treebbf1004fe094653f8dc00048137f17cc4cb06ab6 /libavcodec/vp8.c
parentc48cc9c6e90bc8ca0304bd57cb77f7a689f83391 (diff)
downloadffmpeg-e35dfe864d8fb1ee9e28684a5a93e4b75d0d8092.tar.gz
avcodec/avcodec: Add FFHWAccel, hide internals of AVHWAccel
This commit is the AVHWAccel analogue of commit 20f972701806be20a77f808db332d9489343bb78: It moves the private fields of AVHWAccel to a new struct FFHWAccel extending AVHWAccel in an internal header (namely hwaccel_internal.h). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r--libavcodec/vp8.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 15a2961f56..64b1c7f60e 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -31,6 +31,7 @@
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
+#include "hwaccel_internal.h"
#include "hwconfig.h"
#include "mathops.h"
#include "thread.h"
@@ -166,8 +167,8 @@ 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);
+ if (FF_HW_HAS_CB(avctx, flush))
+ FF_HW_SIMPLE_CALL(avctx, flush);
}
static void vp8_decode_flush(AVCodecContext *avctx)
@@ -2764,15 +2765,16 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
ff_thread_finish_setup(avctx);
if (avctx->hwaccel) {
- ret = avctx->hwaccel->start_frame(avctx, avpkt->data, avpkt->size);
+ const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel);
+ ret = hwaccel->start_frame(avctx, avpkt->data, avpkt->size);
if (ret < 0)
goto err;
- ret = avctx->hwaccel->decode_slice(avctx, avpkt->data, avpkt->size);
+ ret = hwaccel->decode_slice(avctx, avpkt->data, avpkt->size);
if (ret < 0)
goto err;
- ret = avctx->hwaccel->end_frame(avctx);
+ ret = hwaccel->end_frame(avctx);
if (ret < 0)
goto err;