[FFmpeg-soc] G.723.1 Muxer
Mohamed Naufal
naufal11 at gmail.com
Fri Aug 20 10:44:43 CEST 2010
---
libavformat/Makefile | 1 +
libavformat/allformats.c | 2 +-
libavformat/g723_1.c | 21 +++++++++++++++++++++
3 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 794aa49..cbe9a15 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -80,6 +80,7 @@ OBJS-$(CONFIG_FOURXM_DEMUXER) += 4xm.o
OBJS-$(CONFIG_FRAMECRC_MUXER) += framecrcenc.o
OBJS-$(CONFIG_FRAMEMD5_MUXER) += md5enc.o
OBJS-$(CONFIG_G723_1_DEMUXER) += g723_1.o
+OBJS-$(CONFIG_G723_1_MUXER) += g723_1.o
OBJS-$(CONFIG_GIF_MUXER) += gif.o
OBJS-$(CONFIG_GSM_DEMUXER) += raw.o id3v2.o
OBJS-$(CONFIG_GXF_DEMUXER) += gxf.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 437d9d3..34327b3 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -90,7 +90,7 @@ void av_register_all(void)
REGISTER_DEMUXER (FOURXM, fourxm);
REGISTER_MUXER (FRAMECRC, framecrc);
REGISTER_MUXER (FRAMEMD5, framemd5);
- REGISTER_DEMUXER (G723_1, g723_1);
+ REGISTER_MUXDEMUX (G723_1, g723_1);
REGISTER_MUXER (GIF, gif);
REGISTER_DEMUXER (GSM, gsm);
REGISTER_MUXDEMUX (GXF, gxf);
diff --git a/libavformat/g723_1.c b/libavformat/g723_1.c
index 10125e6..9f4de36 100755
--- a/libavformat/g723_1.c
+++ b/libavformat/g723_1.c
@@ -80,3 +80,24 @@ AVInputFormat g723_1_demuxer = {
g723_1_read_packet,
.extensions = "tco",
};
+
+#if CONFIG_G723_1_MUXER
+static int g723_1_write_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ put_buffer(s->pb, pkt->data, pkt->size);
+ put_flush_packet(s->pb);
+ return 0;
+}
+
+AVOutputFormat g723_1_muxer = {
+ "g723_1",
+ NULL_IF_CONFIG_SMALL("G.723.1 format"),
+ "audio/g723",
+ "tco",
+ 0,
+ CODEC_ID_G723_1,
+ CODEC_ID_NONE,
+ NULL,
+ g723_1_write_packet,
+};
+#endif
--
More information about the FFmpeg-soc
mailing list