summaryrefslogtreecommitdiff
path: root/libavcodec/libvpxdec.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/libvpxdec.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/libvpxdec.c')
-rw-r--r--libavcodec/libvpxdec.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index f613d09737..592474b301 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -356,18 +356,18 @@ static av_cold int vp8_init(AVCodecContext *avctx)
return vpx_init(avctx, &ctx->decoder, vpx_codec_vp8_dx());
}
-const AVCodec ff_libvpx_vp8_decoder = {
- .name = "libvpx",
- .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_VP8,
+const FFCodec ff_libvpx_vp8_decoder = {
+ .p.name = "libvpx",
+ .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_VP8,
+ .p.capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1,
+ .p.wrapper_name = "libvpx",
.priv_data_size = sizeof(VPxContext),
.init = vp8_init,
.close = vpx_free,
.decode = vpx_decode,
- .capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_AUTO_THREADS,
- .wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP8_DECODER */
@@ -378,19 +378,19 @@ static av_cold int vp9_init(AVCodecContext *avctx)
return vpx_init(avctx, &ctx->decoder, vpx_codec_vp9_dx());
}
-AVCodec ff_libvpx_vp9_decoder = {
- .name = "libvpx-vp9",
- .long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_VP9,
+FFCodec ff_libvpx_vp9_decoder = {
+ .p.name = "libvpx-vp9",
+ .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"),
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_VP9,
+ .p.capabilities = AV_CODEC_CAP_OTHER_THREADS,
+ .p.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles),
+ .p.wrapper_name = "libvpx",
.priv_data_size = sizeof(VPxContext),
.init = vp9_init,
.close = vpx_free,
.decode = vpx_decode,
- .capabilities = AV_CODEC_CAP_OTHER_THREADS,
.caps_internal = FF_CODEC_CAP_AUTO_THREADS,
.init_static_data = ff_vp9_init_static,
- .profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles),
- .wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP9_DECODER */