Commit 2ccc6ff0 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Add an Opus and a Speex muxer.

Fixes ticket #3181.
parent 4ba90392
...@@ -269,6 +269,8 @@ OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \ ...@@ -269,6 +269,8 @@ OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \
vorbiscomment.o vorbiscomment.o
OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o oma.o OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o oma.o
OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o oma.o id3v2enc.o OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o oma.o id3v2enc.o
OBJS-$(CONFIG_OPUS_MUXER) += oggenc.o \
vorbiscomment.o
OBJS-$(CONFIG_PAF_DEMUXER) += paf.o OBJS-$(CONFIG_PAF_DEMUXER) += paf.o
OBJS-$(CONFIG_PCM_ALAW_DEMUXER) += pcmdec.o pcm.o OBJS-$(CONFIG_PCM_ALAW_DEMUXER) += pcmdec.o pcm.o
OBJS-$(CONFIG_PCM_ALAW_MUXER) += pcmenc.o rawenc.o OBJS-$(CONFIG_PCM_ALAW_MUXER) += pcmenc.o rawenc.o
...@@ -365,6 +367,8 @@ OBJS-$(CONFIG_SOX_DEMUXER) += soxdec.o pcm.o ...@@ -365,6 +367,8 @@ OBJS-$(CONFIG_SOX_DEMUXER) += soxdec.o pcm.o
OBJS-$(CONFIG_SOX_MUXER) += soxenc.o rawenc.o OBJS-$(CONFIG_SOX_MUXER) += soxenc.o rawenc.o
OBJS-$(CONFIG_SPDIF_DEMUXER) += spdif.o spdifdec.o OBJS-$(CONFIG_SPDIF_DEMUXER) += spdif.o spdifdec.o
OBJS-$(CONFIG_SPDIF_MUXER) += spdif.o spdifenc.o OBJS-$(CONFIG_SPDIF_MUXER) += spdif.o spdifenc.o
OBJS-$(CONFIG_SPEEX_MUXER) += oggenc.o \
vorbiscomment.o
OBJS-$(CONFIG_SRT_DEMUXER) += srtdec.o subtitles.o OBJS-$(CONFIG_SRT_DEMUXER) += srtdec.o subtitles.o
OBJS-$(CONFIG_SRT_MUXER) += srtenc.o OBJS-$(CONFIG_SRT_MUXER) += srtenc.o
OBJS-$(CONFIG_STR_DEMUXER) += psxstr.o OBJS-$(CONFIG_STR_DEMUXER) += psxstr.o
......
...@@ -205,6 +205,7 @@ void av_register_all(void) ...@@ -205,6 +205,7 @@ void av_register_all(void)
REGISTER_DEMUXER (NUV, nuv); REGISTER_DEMUXER (NUV, nuv);
REGISTER_MUXDEMUX(OGG, ogg); REGISTER_MUXDEMUX(OGG, ogg);
REGISTER_MUXDEMUX(OMA, oma); REGISTER_MUXDEMUX(OMA, oma);
REGISTER_MUXER (OPUS, opus);
REGISTER_DEMUXER (PAF, paf); REGISTER_DEMUXER (PAF, paf);
REGISTER_MUXDEMUX(PCM_ALAW, pcm_alaw); REGISTER_MUXDEMUX(PCM_ALAW, pcm_alaw);
REGISTER_MUXDEMUX(PCM_MULAW, pcm_mulaw); REGISTER_MUXDEMUX(PCM_MULAW, pcm_mulaw);
...@@ -264,6 +265,7 @@ void av_register_all(void) ...@@ -264,6 +265,7 @@ void av_register_all(void)
REGISTER_DEMUXER (SOL, sol); REGISTER_DEMUXER (SOL, sol);
REGISTER_MUXDEMUX(SOX, sox); REGISTER_MUXDEMUX(SOX, sox);
REGISTER_MUXDEMUX(SPDIF, spdif); REGISTER_MUXDEMUX(SPDIF, spdif);
REGISTER_MUXER (SPEEX, speex);
REGISTER_MUXDEMUX(SRT, srt); REGISTER_MUXDEMUX(SRT, srt);
REGISTER_DEMUXER (STR, str); REGISTER_DEMUXER (STR, str);
REGISTER_DEMUXER (SUBVIEWER1, subviewer1); REGISTER_DEMUXER (SUBVIEWER1, subviewer1);
......
...@@ -86,14 +86,6 @@ static const AVOption options[] = { ...@@ -86,14 +86,6 @@ static const AVOption options[] = {
{ NULL }, { NULL },
}; };
static const AVClass ogg_muxer_class = {
.class_name = "Ogg muxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
static void ogg_update_checksum(AVFormatContext *s, AVIOContext *pb, int64_t crc_offset) static void ogg_update_checksum(AVFormatContext *s, AVIOContext *pb, int64_t crc_offset)
{ {
int64_t pos = avio_tell(pb); int64_t pos = avio_tell(pb);
...@@ -624,11 +616,26 @@ static int ogg_write_trailer(AVFormatContext *s) ...@@ -624,11 +616,26 @@ static int ogg_write_trailer(AVFormatContext *s)
return 0; return 0;
} }
#if CONFIG_OGG_MUXER
static const AVClass ogg_muxer_class = {
.class_name = "Ogg muxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
AVOutputFormat ff_ogg_muxer = { AVOutputFormat ff_ogg_muxer = {
.name = "ogg", .name = "ogg",
.long_name = NULL_IF_CONFIG_SMALL("Ogg"), .long_name = NULL_IF_CONFIG_SMALL("Ogg"),
.mime_type = "application/ogg", .mime_type = "application/ogg",
.extensions = "ogg,ogv,spx,opus", .extensions = "ogg,ogv"
#if !CONFIG_SPEEX_MUXER
",spx"
#endif
#if !CONFIG_OPUS_MUXER
",opus"
#endif
,
.priv_data_size = sizeof(OGGContext), .priv_data_size = sizeof(OGGContext),
.audio_codec = AV_CODEC_ID_FLAC, .audio_codec = AV_CODEC_ID_FLAC,
.video_codec = AV_CODEC_ID_THEORA, .video_codec = AV_CODEC_ID_THEORA,
...@@ -638,3 +645,52 @@ AVOutputFormat ff_ogg_muxer = { ...@@ -638,3 +645,52 @@ AVOutputFormat ff_ogg_muxer = {
.flags = AVFMT_TS_NEGATIVE, .flags = AVFMT_TS_NEGATIVE,
.priv_class = &ogg_muxer_class, .priv_class = &ogg_muxer_class,
}; };
#endif
#if CONFIG_SPEEX_MUXER
static const AVClass speex_muxer_class = {
.class_name = "Speex muxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
AVOutputFormat ff_speex_muxer = {
.name = "speex",
.long_name = NULL_IF_CONFIG_SMALL("Speex"),
.mime_type = "audio/ogg",
.extensions = "spx",
.priv_data_size = sizeof(OGGContext),
.audio_codec = AV_CODEC_ID_SPEEX,
.video_codec = AV_CODEC_ID_NONE,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.flags = AVFMT_TS_NEGATIVE,
.priv_class = &speex_muxer_class,
};
#endif
#if CONFIG_OPUS_MUXER
static const AVClass opus_muxer_class = {
.class_name = "Opus muxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
AVOutputFormat ff_opus_muxer = {
.name = "opus",
.long_name = NULL_IF_CONFIG_SMALL("Opus"),
.mime_type = "audio/ogg",
.extensions = "opus",
.priv_data_size = sizeof(OGGContext),
.audio_codec = AV_CODEC_ID_OPUS,
.video_codec = AV_CODEC_ID_NONE,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.flags = AVFMT_TS_NEGATIVE,
.priv_class = &opus_muxer_class,
};
#endif
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 55 #define LIBAVFORMAT_VERSION_MAJOR 55
#define LIBAVFORMAT_VERSION_MINOR 21 #define LIBAVFORMAT_VERSION_MINOR 22
#define LIBAVFORMAT_VERSION_MICRO 102 #define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \ LIBAVFORMAT_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment