aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/videotoolbox.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/videotoolbox.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/videotoolbox.c')
-rw-r--r--libavcodec/videotoolbox.c71
1 files changed, 36 insertions, 35 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 6444325591..963379d483 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -33,6 +33,7 @@
#include "internal.h"
#include "h264dec.h"
#include "hevcdec.h"
+#include "hwaccel_internal.h"
#include "mpegvideo.h"
#include "proresdec.h"
#include <Availability.h>
@@ -1284,11 +1285,11 @@ int ff_videotoolbox_frame_params(AVCodecContext *avctx,
return 0;
}
-const AVHWAccel ff_h263_videotoolbox_hwaccel = {
- .name = "h263_videotoolbox",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_H263,
- .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+const FFHWAccel ff_h263_videotoolbox_hwaccel = {
+ .p.name = "h263_videotoolbox",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_H263,
+ .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
.alloc_frame = ff_videotoolbox_alloc_frame,
.start_frame = videotoolbox_mpeg_start_frame,
.decode_slice = videotoolbox_mpeg_decode_slice,
@@ -1299,11 +1300,11 @@ const AVHWAccel ff_h263_videotoolbox_hwaccel = {
.priv_data_size = sizeof(VTContext),
};
-const AVHWAccel ff_hevc_videotoolbox_hwaccel = {
- .name = "hevc_videotoolbox",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_HEVC,
- .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+const FFHWAccel ff_hevc_videotoolbox_hwaccel = {
+ .p.name = "hevc_videotoolbox",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_HEVC,
+ .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
.alloc_frame = ff_videotoolbox_alloc_frame,
.start_frame = videotoolbox_hevc_start_frame,
.decode_slice = videotoolbox_hevc_decode_slice,
@@ -1315,11 +1316,11 @@ const AVHWAccel ff_hevc_videotoolbox_hwaccel = {
.priv_data_size = sizeof(VTContext),
};
-const AVHWAccel ff_h264_videotoolbox_hwaccel = {
- .name = "h264_videotoolbox",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_H264,
- .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+const FFHWAccel ff_h264_videotoolbox_hwaccel = {
+ .p.name = "h264_videotoolbox",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_H264,
+ .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
.alloc_frame = ff_videotoolbox_alloc_frame,
.start_frame = ff_videotoolbox_h264_start_frame,
.decode_slice = ff_videotoolbox_h264_decode_slice,
@@ -1331,11 +1332,11 @@ const AVHWAccel ff_h264_videotoolbox_hwaccel = {
.priv_data_size = sizeof(VTContext),
};
-const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = {
- .name = "mpeg1_videotoolbox",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_MPEG1VIDEO,
- .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+const FFHWAccel ff_mpeg1_videotoolbox_hwaccel = {
+ .p.name = "mpeg1_videotoolbox",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_MPEG1VIDEO,
+ .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
.alloc_frame = ff_videotoolbox_alloc_frame,
.start_frame = videotoolbox_mpeg_start_frame,
.decode_slice = videotoolbox_mpeg_decode_slice,
@@ -1346,11 +1347,11 @@ const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = {
.priv_data_size = sizeof(VTContext),
};
-const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = {
- .name = "mpeg2_videotoolbox",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_MPEG2VIDEO,
- .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+const FFHWAccel ff_mpeg2_videotoolbox_hwaccel = {
+ .p.name = "mpeg2_videotoolbox",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_MPEG2VIDEO,
+ .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
.alloc_frame = ff_videotoolbox_alloc_frame,
.start_frame = videotoolbox_mpeg_start_frame,
.decode_slice = videotoolbox_mpeg_decode_slice,
@@ -1361,11 +1362,11 @@ const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = {
.priv_data_size = sizeof(VTContext),
};
-const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = {
- .name = "mpeg4_videotoolbox",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_MPEG4,
- .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+const FFHWAccel ff_mpeg4_videotoolbox_hwaccel = {
+ .p.name = "mpeg4_videotoolbox",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_MPEG4,
+ .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
.alloc_frame = ff_videotoolbox_alloc_frame,
.start_frame = videotoolbox_mpeg_start_frame,
.decode_slice = videotoolbox_mpeg_decode_slice,
@@ -1376,11 +1377,11 @@ const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = {
.priv_data_size = sizeof(VTContext),
};
-const AVHWAccel ff_prores_videotoolbox_hwaccel = {
- .name = "prores_videotoolbox",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_PRORES,
- .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+const FFHWAccel ff_prores_videotoolbox_hwaccel = {
+ .p.name = "prores_videotoolbox",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_PRORES,
+ .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
.alloc_frame = ff_videotoolbox_alloc_frame,
.start_frame = videotoolbox_prores_start_frame,
.decode_slice = videotoolbox_prores_decode_slice,