aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/imc.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/imc.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/imc.c')
-rw-r--r--libavcodec/imc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index cf7b2206d1..f11d28d28c 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -1085,35 +1085,35 @@ static av_cold void flush(AVCodecContext *avctx)
}
#if CONFIG_IMC_DECODER
-const AVCodec ff_imc_decoder = {
- .name = "imc",
- .long_name = NULL_IF_CONFIG_SMALL("IMC (Intel Music Coder)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_IMC,
+const FFCodec ff_imc_decoder = {
+ .p.name = "imc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("IMC (Intel Music Coder)"),
+ .p.type = AVMEDIA_TYPE_AUDIO,
+ .p.id = AV_CODEC_ID_IMC,
.priv_data_size = sizeof(IMCContext),
.init = imc_decode_init,
.close = imc_decode_close,
.decode = imc_decode_frame,
.flush = flush,
- .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
+ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_IAC_DECODER
-const AVCodec ff_iac_decoder = {
- .name = "iac",
- .long_name = NULL_IF_CONFIG_SMALL("IAC (Indeo Audio Coder)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_IAC,
+const FFCodec ff_iac_decoder = {
+ .p.name = "iac",
+ .p.long_name = NULL_IF_CONFIG_SMALL("IAC (Indeo Audio Coder)"),
+ .p.type = AVMEDIA_TYPE_AUDIO,
+ .p.id = AV_CODEC_ID_IAC,
.priv_data_size = sizeof(IMCContext),
.init = imc_decode_init,
.close = imc_decode_close,
.decode = imc_decode_frame,
.flush = flush,
- .capabilities = AV_CODEC_CAP_DR1,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
+ .p.capabilities = AV_CODEC_CAP_DR1,
+ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};