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/r210dec.c | |
parent | a688f3c13ce55c2ba51dbbb344564649f1bb52fe (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/r210dec.c')
-rw-r--r-- | libavcodec/r210dec.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index 77ccf724d8..cfe6401a21 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -104,38 +104,38 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } #if CONFIG_R210_DECODER -const AVCodec ff_r210_decoder = { - .name = "r210", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_R210, +const FFCodec ff_r210_decoder = { + .p.name = "r210", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_R210, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_R10K_DECODER -const AVCodec ff_r10k_decoder = { - .name = "r10k", - .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_R10K, +const FFCodec ff_r10k_decoder = { + .p.name = "r10k", + .p.long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_R10K, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_AVRP_DECODER -const AVCodec ff_avrp_decoder = { - .name = "avrp", - .long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVRP, +const FFCodec ff_avrp_decoder = { + .p.name = "avrp", + .p.long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVRP, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif |