Introducing speex RTP demuxing (RFC 5574)
authorDmitry Samonenko <shreddingwork@gmail.com>
Sat, 22 Sep 2012 10:39:03 +0000 (14:39 +0400)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 23 Sep 2012 12:20:13 +0000 (14:20 +0200)
RTPDynamicProtocolHandler for speex is added. Initial support for
speex depacketization from RTP stream comes with it.
Currently, only codec audio rate can be applied based on sdp:
* Narrowband    ( 8K)
* Wideband      (16K)
* Ultrawideband (32K)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/Makefile
libavformat/rtpdec.c
libavformat/rtpdec_formats.h
libavformat/rtpdec_speex.c [new file with mode: 0644]

index 1040446..d6f8a1a 100644 (file)
@@ -299,6 +299,7 @@ OBJS-$(CONFIG_RTPDEC)                    += rdt.o         \
                                             rtpdec_qcelp.o \
                                             rtpdec_qdm2.o \
                                             rtpdec_qt.o   \
+                                            rtpdec_speex.o \
                                             rtpdec_svq3.o \
                                             rtpdec_vp8.o  \
                                             rtpdec_xiph.o
index e480115..67c273a 100644 (file)
@@ -78,6 +78,7 @@ void av_register_rtp_dynamic_payload_handlers(void)
     ff_register_dynamic_payload_handler(&ff_vp8_dynamic_handler);
     ff_register_dynamic_payload_handler(&ff_qcelp_dynamic_handler);
     ff_register_dynamic_payload_handler(&ff_realmedia_mp3_dynamic_handler);
+    ff_register_dynamic_payload_handler(&ff_speex_dynamic_handler);
 
     ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfv_handler);
     ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfa_handler);
index 471888b..9798c5d 100644 (file)
@@ -58,6 +58,7 @@ extern RTPDynamicProtocolHandler ff_qt_rtp_aud_handler;
 extern RTPDynamicProtocolHandler ff_qt_rtp_vid_handler;
 extern RTPDynamicProtocolHandler ff_quicktime_rtp_aud_handler;
 extern RTPDynamicProtocolHandler ff_quicktime_rtp_vid_handler;
+extern RTPDynamicProtocolHandler ff_speex_dynamic_handler;
 extern RTPDynamicProtocolHandler ff_svq3_dynamic_handler;
 extern RTPDynamicProtocolHandler ff_theora_dynamic_handler;
 extern RTPDynamicProtocolHandler ff_vorbis_dynamic_handler;
diff --git a/libavformat/rtpdec_speex.c b/libavformat/rtpdec_speex.c
new file mode 100644 (file)
index 0000000..4e23090
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * RTP SPEEX Depacketizer, RFC 5574
+ * Copyright (c) 2012 Dmitry Samonenko
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "rtpdec_formats.h"
+#include "libavutil/avstring.h"
+
+static int speex_parse_sdp_line(AVFormatContext *s, int st_index,
+                               PayloadContext *data, const char *line)
+{
+    av_log(s, AV_LOG_WARNING, "fmtp line parsing is not implemented yet\n");
+
+    return 0;
+}
+
+RTPDynamicProtocolHandler ff_speex_dynamic_handler = {
+    .enc_name         = "speex",
+    .codec_type       = AVMEDIA_TYPE_AUDIO,
+    .codec_id         = AV_CODEC_ID_SPEEX,
+    .parse_sdp_a_line = speex_parse_sdp_line,
+};