summaryrefslogtreecommitdiff
path: root/libavcodec/textdec.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/textdec.c
parenta688f3c13ce55c2ba51dbbb344564649f1bb52fe (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/textdec.c')
-rw-r--r--libavcodec/textdec.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c
index 690c0bbaad..95450a18f7 100644
--- a/libavcodec/textdec.c
+++ b/libavcodec/textdec.c
@@ -81,15 +81,15 @@ static const AVClass textsub_decoder_class = {
};
#if CONFIG_TEXT_DECODER
-const AVCodec ff_text_decoder = {
- .name = "text",
- .long_name = NULL_IF_CONFIG_SMALL("Raw text subtitle"),
+const FFCodec ff_text_decoder = {
+ .p.name = "text",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Raw text subtitle"),
.priv_data_size = sizeof(TextContext),
- .type = AVMEDIA_TYPE_SUBTITLE,
- .id = AV_CODEC_ID_TEXT,
+ .p.type = AVMEDIA_TYPE_SUBTITLE,
+ .p.id = AV_CODEC_ID_TEXT,
.decode = text_decode_frame,
.init = ff_ass_subtitle_header_default,
- .priv_class = &textsub_decoder_class,
+ .p.priv_class = &textsub_decoder_class,
.flush = text_flush,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -105,60 +105,60 @@ static int linebreak_init(AVCodecContext *avctx)
}
#if CONFIG_VPLAYER_DECODER
-const AVCodec ff_vplayer_decoder = {
- .name = "vplayer",
- .long_name = NULL_IF_CONFIG_SMALL("VPlayer subtitle"),
+const FFCodec ff_vplayer_decoder = {
+ .p.name = "vplayer",
+ .p.long_name = NULL_IF_CONFIG_SMALL("VPlayer subtitle"),
.priv_data_size = sizeof(TextContext),
- .type = AVMEDIA_TYPE_SUBTITLE,
- .id = AV_CODEC_ID_VPLAYER,
+ .p.type = AVMEDIA_TYPE_SUBTITLE,
+ .p.id = AV_CODEC_ID_VPLAYER,
.decode = text_decode_frame,
.init = linebreak_init,
- .priv_class = &textsub_decoder_class,
+ .p.priv_class = &textsub_decoder_class,
.flush = text_flush,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_STL_DECODER
-const AVCodec ff_stl_decoder = {
- .name = "stl",
- .long_name = NULL_IF_CONFIG_SMALL("Spruce subtitle format"),
+const FFCodec ff_stl_decoder = {
+ .p.name = "stl",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Spruce subtitle format"),
.priv_data_size = sizeof(TextContext),
- .type = AVMEDIA_TYPE_SUBTITLE,
- .id = AV_CODEC_ID_STL,
+ .p.type = AVMEDIA_TYPE_SUBTITLE,
+ .p.id = AV_CODEC_ID_STL,
.decode = text_decode_frame,
.init = linebreak_init,
- .priv_class = &textsub_decoder_class,
+ .p.priv_class = &textsub_decoder_class,
.flush = text_flush,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_PJS_DECODER
-const AVCodec ff_pjs_decoder = {
- .name = "pjs",
- .long_name = NULL_IF_CONFIG_SMALL("PJS subtitle"),
+const FFCodec ff_pjs_decoder = {
+ .p.name = "pjs",
+ .p.long_name = NULL_IF_CONFIG_SMALL("PJS subtitle"),
.priv_data_size = sizeof(TextContext),
- .type = AVMEDIA_TYPE_SUBTITLE,
- .id = AV_CODEC_ID_PJS,
+ .p.type = AVMEDIA_TYPE_SUBTITLE,
+ .p.id = AV_CODEC_ID_PJS,
.decode = text_decode_frame,
.init = linebreak_init,
- .priv_class = &textsub_decoder_class,
+ .p.priv_class = &textsub_decoder_class,
.flush = text_flush,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_SUBVIEWER1_DECODER
-const AVCodec ff_subviewer1_decoder = {
- .name = "subviewer1",
- .long_name = NULL_IF_CONFIG_SMALL("SubViewer1 subtitle"),
+const FFCodec ff_subviewer1_decoder = {
+ .p.name = "subviewer1",
+ .p.long_name = NULL_IF_CONFIG_SMALL("SubViewer1 subtitle"),
.priv_data_size = sizeof(TextContext),
- .type = AVMEDIA_TYPE_SUBTITLE,
- .id = AV_CODEC_ID_SUBVIEWER1,
+ .p.type = AVMEDIA_TYPE_SUBTITLE,
+ .p.id = AV_CODEC_ID_SUBVIEWER1,
.decode = text_decode_frame,
.init = linebreak_init,
- .priv_class = &textsub_decoder_class,
+ .p.priv_class = &textsub_decoder_class,
.flush = text_flush,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};