diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-16 21:09:54 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-21 01:33:09 +0100 |
commit | 20f972701806be20a77f808db332d9489343bb78 (patch) | |
tree | 8d8b588c0ca06fa652518a5685db8280b0bf532d /libavcodec/vc1dec.c | |
parent | a688f3c13ce55c2ba51dbbb344564649f1bb52fe (diff) | |
download | ffmpeg-20f972701806be20a77f808db332d9489343bb78.tar.gz |
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/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 73a96690c0..e279ffd1c1 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -1202,19 +1202,19 @@ static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = { AV_PIX_FMT_NONE }; -const AVCodec ff_vc1_decoder = { - .name = "vc1", - .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, +const FFCodec ff_vc1_decoder = { + .p.name = "vc1", + .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, .decode = vc1_decode_frame, .flush = ff_mpeg_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .pix_fmts = vc1_hwaccel_pixfmt_list_420, + .p.pix_fmts = vc1_hwaccel_pixfmt_list_420, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_VC1_DXVA2_HWACCEL HWACCEL_DXVA2(vc1), @@ -1236,23 +1236,23 @@ const AVCodec ff_vc1_decoder = { #endif NULL }, - .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) + .p.profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) }; #if CONFIG_WMV3_DECODER -const AVCodec ff_wmv3_decoder = { - .name = "wmv3", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, +const FFCodec ff_wmv3_decoder = { + .p.name = "wmv3", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, .decode = vc1_decode_frame, .flush = ff_mpeg_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .pix_fmts = vc1_hwaccel_pixfmt_list_420, + .p.pix_fmts = vc1_hwaccel_pixfmt_list_420, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_WMV3_DXVA2_HWACCEL HWACCEL_DXVA2(wmv3), @@ -1274,24 +1274,24 @@ const AVCodec ff_wmv3_decoder = { #endif NULL }, - .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) + .p.profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) }; #endif #if CONFIG_WMV3IMAGE_DECODER -const AVCodec ff_wmv3image_decoder = { - .name = "wmv3image", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3IMAGE, +const FFCodec ff_wmv3image_decoder = { + .p.name = "wmv3image", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3IMAGE, .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, .decode = vc1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vc1_sprite_flush, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, @@ -1299,19 +1299,19 @@ const AVCodec ff_wmv3image_decoder = { #endif #if CONFIG_VC1IMAGE_DECODER -const AVCodec ff_vc1image_decoder = { - .name = "vc1image", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1IMAGE, +const FFCodec ff_vc1image_decoder = { + .p.name = "vc1image", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1IMAGE, .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, .decode = vc1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vc1_sprite_flush, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, |