aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/r210enc.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/r210enc.c
parenta688f3c13ce55c2ba51dbbb344564649f1bb52fe (diff)
downloadffmpeg-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/r210enc.c')
-rw-r--r--libavcodec/r210enc.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c
index ef0d00b97a..88bbd4677d 100644
--- a/libavcodec/r210enc.c
+++ b/libavcodec/r210enc.c
@@ -91,41 +91,41 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static const enum AVPixelFormat pix_fmt[] = { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE };
#if CONFIG_R210_ENCODER
-const AVCodec ff_r210_encoder = {
- .name = "r210",
- .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_R210,
- .capabilities = AV_CODEC_CAP_DR1,
+const FFCodec ff_r210_encoder = {
+ .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,
+ .p.capabilities = AV_CODEC_CAP_DR1,
.init = encode_init,
.encode2 = encode_frame,
- .pix_fmts = pix_fmt,
+ .p.pix_fmts = pix_fmt,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_R10K_ENCODER
-const AVCodec ff_r10k_encoder = {
- .name = "r10k",
- .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_R10K,
- .capabilities = AV_CODEC_CAP_DR1,
+const FFCodec ff_r10k_encoder = {
+ .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,
+ .p.capabilities = AV_CODEC_CAP_DR1,
.init = encode_init,
.encode2 = encode_frame,
- .pix_fmts = pix_fmt,
+ .p.pix_fmts = pix_fmt,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_AVRP_ENCODER
-const AVCodec ff_avrp_encoder = {
- .name = "avrp",
- .long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_AVRP,
- .capabilities = AV_CODEC_CAP_DR1,
+const FFCodec ff_avrp_encoder = {
+ .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,
+ .p.capabilities = AV_CODEC_CAP_DR1,
.init = encode_init,
.encode2 = encode_frame,
- .pix_fmts = pix_fmt,
+ .p.pix_fmts = pix_fmt,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif