aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libcelt_dec.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/libcelt_dec.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/libcelt_dec.c')
-rw-r--r--libavcodec/libcelt_dec.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libavcodec/libcelt_dec.c b/libavcodec/libcelt_dec.c
index 6ee6e29443..bae6e680d3 100644
--- a/libavcodec/libcelt_dec.c
+++ b/libavcodec/libcelt_dec.c
@@ -22,6 +22,7 @@
#include <celt/celt.h>
#include <celt/celt_header.h>
#include "avcodec.h"
+#include "codec_internal.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
@@ -127,15 +128,15 @@ static int libcelt_dec_decode(AVCodecContext *c, void *data,
return pkt->size;
}
-const AVCodec ff_libcelt_decoder = {
- .name = "libcelt",
- .long_name = NULL_IF_CONFIG_SMALL("Xiph CELT decoder using libcelt"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_CELT,
+const FFCodec ff_libcelt_decoder = {
+ .p.name = "libcelt",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Xiph CELT decoder using libcelt"),
+ .p.type = AVMEDIA_TYPE_AUDIO,
+ .p.id = AV_CODEC_ID_CELT,
+ .p.capabilities = AV_CODEC_CAP_DR1,
+ .p.wrapper_name = "libcelt",
.priv_data_size = sizeof(struct libcelt_context),
.init = libcelt_dec_init,
.close = libcelt_dec_close,
.decode = libcelt_dec_decode,
- .capabilities = AV_CODEC_CAP_DR1,
- .wrapper_name = "libcelt",
};