summaryrefslogtreecommitdiff
path: root/libavcodec/videotoolboxenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-16 21:09:54 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-21 01:33:09 +0100
commit20f972701806be20a77f808db332d9489343bb78 (patch)
tree8d8b588c0ca06fa652518a5685db8280b0bf532d /libavcodec/videotoolboxenc.c
parenta688f3c13ce55c2ba51dbbb344564649f1bb52fe (diff)
avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec
Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/videotoolboxenc.c')
-rw-r--r--libavcodec/videotoolboxenc.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 95be432666..61c24f9110 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -2723,18 +2723,18 @@ static const AVClass h264_videotoolbox_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVCodec ff_h264_videotoolbox_encoder = {
- .name = "h264_videotoolbox",
- .long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.264 Encoder"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_H264,
- .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
+const FFCodec ff_h264_videotoolbox_encoder = {
+ .p.name = "h264_videotoolbox",
+ .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.264 Encoder"),
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_H264,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.priv_data_size = sizeof(VTEncContext),
- .pix_fmts = avc_pix_fmts,
+ .p.pix_fmts = avc_pix_fmts,
.init = vtenc_init,
.encode2 = vtenc_frame,
.close = vtenc_close,
- .priv_class = &h264_videotoolbox_class,
+ .p.priv_class = &h264_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
};
@@ -2757,22 +2757,22 @@ static const AVClass hevc_videotoolbox_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVCodec ff_hevc_videotoolbox_encoder = {
- .name = "hevc_videotoolbox",
- .long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.265 Encoder"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_HEVC,
- .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+const FFCodec ff_hevc_videotoolbox_encoder = {
+ .p.name = "hevc_videotoolbox",
+ .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.265 Encoder"),
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_HEVC,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_HARDWARE,
.priv_data_size = sizeof(VTEncContext),
- .pix_fmts = hevc_pix_fmts,
+ .p.pix_fmts = hevc_pix_fmts,
.init = vtenc_init,
.encode2 = vtenc_frame,
.close = vtenc_close,
- .priv_class = &hevc_videotoolbox_class,
+ .p.priv_class = &hevc_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
- .wrapper_name = "videotoolbox",
+ .p.wrapper_name = "videotoolbox",
};
static const AVOption prores_options[] = {
@@ -2796,20 +2796,20 @@ static const AVClass prores_videotoolbox_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVCodec ff_prores_videotoolbox_encoder = {
- .name = "prores_videotoolbox",
- .long_name = NULL_IF_CONFIG_SMALL("VideoToolbox ProRes Encoder"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_PRORES,
- .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+const FFCodec ff_prores_videotoolbox_encoder = {
+ .p.name = "prores_videotoolbox",
+ .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox ProRes Encoder"),
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_PRORES,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_HARDWARE,
.priv_data_size = sizeof(VTEncContext),
- .pix_fmts = prores_pix_fmts,
+ .p.pix_fmts = prores_pix_fmts,
.init = vtenc_init,
.encode2 = vtenc_frame,
.close = vtenc_close,
- .priv_class = &prores_videotoolbox_class,
+ .p.priv_class = &prores_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
- .wrapper_name = "videotoolbox",
+ .p.wrapper_name = "videotoolbox",
};