summaryrefslogtreecommitdiff
path: root/libavformat/oggenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-01-27 15:06:00 +0100
committerAnton Khirnov <anton@khirnov.net>2023-02-09 15:24:15 +0100
commit59c9dc82f450638a3068deeb1db5c56f6d155752 (patch)
tree936dabca4a3e593553f6e0c8409e530111c99c0c /libavformat/oggenc.c
parentf23ae839fc184c4492e10f371cde5c1b55e51522 (diff)
avformat/avformat: Move AVOutputFormat internals out of public header
This commit does for AVOutputFormat what commit 20f972701806be20a77f808db332d9489343bb78 did for AVCodec: It adds a new type FFOutputFormat, moves all the internals of AVOutputFormat to it and adds a now reduced AVOutputFormat as first member. This does not affect/improve extensibility of both public or private fields for muxers (it is still a mess due to lavd). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/oggenc.c')
-rw-r--r--libavformat/oggenc.c85
1 files changed, 43 insertions, 42 deletions
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 458b2a9bdc..2e582d0754 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -33,6 +33,7 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include "version.h"
#include "vorbiscomment.h"
@@ -746,11 +747,11 @@ static void ogg_free(AVFormatContext *s)
}
#if CONFIG_OGG_MUXER
-const AVOutputFormat ff_ogg_muxer = {
- .name = "ogg",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg"),
- .mime_type = "application/ogg",
- .extensions = "ogg"
+const FFOutputFormat ff_ogg_muxer = {
+ .p.name = "ogg",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg"),
+ .p.mime_type = "application/ogg",
+ .p.extensions = "ogg"
#if !CONFIG_OGV_MUXER
",ogv"
#endif
@@ -762,90 +763,90 @@ const AVOutputFormat ff_ogg_muxer = {
#endif
,
.priv_data_size = sizeof(OGGContext),
- .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
+ .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ?
AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
- .video_codec = AV_CODEC_ID_THEORA,
+ .p.video_codec = AV_CODEC_ID_THEORA,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
#if CONFIG_OGA_MUXER
-const AVOutputFormat ff_oga_muxer = {
- .name = "oga",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg Audio"),
- .mime_type = "audio/ogg",
- .extensions = "oga",
+const FFOutputFormat ff_oga_muxer = {
+ .p.name = "oga",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Audio"),
+ .p.mime_type = "audio/ogg",
+ .p.extensions = "oga",
.priv_data_size = sizeof(OGGContext),
- .audio_codec = AV_CODEC_ID_FLAC,
+ .p.audio_codec = AV_CODEC_ID_FLAC,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
#if CONFIG_OGV_MUXER
-const AVOutputFormat ff_ogv_muxer = {
- .name = "ogv",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg Video"),
- .mime_type = "video/ogg",
- .extensions = "ogv",
+const FFOutputFormat ff_ogv_muxer = {
+ .p.name = "ogv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Video"),
+ .p.mime_type = "video/ogg",
+ .p.extensions = "ogv",
.priv_data_size = sizeof(OGGContext),
- .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
+ .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ?
AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
- .video_codec = CONFIG_LIBTHEORA_ENCODER ?
+ .p.video_codec = CONFIG_LIBTHEORA_ENCODER ?
AV_CODEC_ID_THEORA : AV_CODEC_ID_VP8,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
#if CONFIG_SPX_MUXER
-const AVOutputFormat ff_spx_muxer = {
- .name = "spx",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg Speex"),
- .mime_type = "audio/ogg",
- .extensions = "spx",
+const FFOutputFormat ff_spx_muxer = {
+ .p.name = "spx",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Speex"),
+ .p.mime_type = "audio/ogg",
+ .p.extensions = "spx",
.priv_data_size = sizeof(OGGContext),
- .audio_codec = AV_CODEC_ID_SPEEX,
+ .p.audio_codec = AV_CODEC_ID_SPEEX,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
#if CONFIG_OPUS_MUXER
-const AVOutputFormat ff_opus_muxer = {
- .name = "opus",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg Opus"),
- .mime_type = "audio/ogg",
- .extensions = "opus",
+const FFOutputFormat ff_opus_muxer = {
+ .p.name = "opus",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Opus"),
+ .p.mime_type = "audio/ogg",
+ .p.extensions = "opus",
.priv_data_size = sizeof(OGGContext),
- .audio_codec = AV_CODEC_ID_OPUS,
+ .p.audio_codec = AV_CODEC_ID_OPUS,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif