aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/codecs.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-11-24 00:27:14 +0100
committerPeter Wu <peter@lekensteyn.nl>2016-12-06 17:51:47 +0000
commitf5e22a14877922aa7b907d2e434958c86efd6875 (patch)
tree33439d1a8cd3322faa9ce8b0f6b12a08427d47fb /codecs/codecs.c
parentd8cdb550445a1bc86626bd9d45da1ce958d1592b (diff)
codecs: Add support for G.722 and G.726
Integrate the Spandsp library for G.722 and G.726 support. Adds support for G.722 and all eight variants of G.726. Note: this also fixes a crash in Qt (buffer overrun, reading too much data) caused by confusion of the larger output buffer (resample_buff) with the smaller input buffer (decode_buff). It was not triggered before because the sample rate was always 8k, but with the addition of the new codecs, a different sample rate became possible (16k). Fix also a crash which occurs when the RTP_STREAM_DEBUG macro is enabled and the VOIP Calls dialog is opened (the begin frame, start_fd, is not yet known and therfore a NULL dereference could occur). Passes testing (plays normally without bad RTP timing errors) with SampleCaptures files: sip-rtp-g722.pcap and sip-rtp-g726.pcap. Tested with cmake (Qt), autotools (Qt and GTK+) with ASAN enabled. Bug: 5619 Change-Id: I5661908d193927bba50901079119eeff0c04991f Reviewed-on: https://code.wireshark.org/review/18939 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'codecs/codecs.c')
-rw-r--r--codecs/codecs.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/codecs/codecs.c b/codecs/codecs.c
index 8b6fcb3efc..447ee67793 100644
--- a/codecs/codecs.c
+++ b/codecs/codecs.c
@@ -32,6 +32,11 @@
#include "sbc/sbc_private.h"
#endif
+#ifdef HAVE_SPANDSP
+#include "G722/G722decode.h"
+#include "G726/G726decode.h"
+#endif
+
#ifdef HAVE_PLUGINS
#include <gmodule.h>
@@ -108,7 +113,21 @@ register_all_codecs(void)
#ifdef HAVE_SPANDSP
register_codec("g722", codec_g722_init, codec_g722_release,
codec_g722_get_channels, codec_g722_get_frequency, codec_g722_decode);
- register_codec("g726", codec_g726_init, codec_g726_release,
+ register_codec("G726-16", codec_g726_16_init, codec_g726_release,
+ codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode);
+ register_codec("G726-24", codec_g726_24_init, codec_g726_release,
+ codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode);
+ register_codec("G726-32", codec_g726_32_init, codec_g726_release,
+ codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode);
+ register_codec("G726-40", codec_g726_40_init, codec_g726_release,
+ codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode);
+ register_codec("AAL2-G726-16", codec_aal2_g726_16_init, codec_g726_release,
+ codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode);
+ register_codec("AAL2-G726-24", codec_aal2_g726_24_init, codec_g726_release,
+ codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode);
+ register_codec("AAL2-G726-32", codec_aal2_g726_32_init, codec_g726_release,
+ codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode);
+ register_codec("AAL2-G726-40", codec_aal2_g726_40_init, codec_g726_release,
codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode);
#endif
#ifdef HAVE_SBC