set(PACKAGELIST ${PACKAGELIST} SBC)
endif()
+if(ENABLE_SPANDSP)
+ set(PACKAGELIST ${PACKAGELIST} SPANDSP)
+endif()
+
# Capabilities
if(ENABLE_CAP)
set(PACKAGELIST ${PACKAGELIST} CAP SETCAP)
if(HAVE_LIBSBC)
set(HAVE_SBC 1)
endif()
+if(SPANDSP_FOUND)
+ set(HAVE_SPANDSP 1)
+endif()
if(EXTCAP_ANDROIDDUMP_LIBPCAP)
set(ANDROIDDUMP_USE_LIBPCAP 1)
endif()
include(FeatureSummary)
#SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ])
SET_FEATURE_INFO(SBC "SBC Codec for Bluetooth A2DP stream playing" "www: http://git.kernel.org/cgit/bluetooth/sbc.git" )
+SET_FEATURE_INFO(SPANDSP "Support for G.722 and G.726 codecs in RTP player" "http://www.soft-switch.org/" )
SET_FEATURE_INFO(LIBSSH "libssh is library for ssh connections and it is needed to build sshdump/ciscodump" "www: https://www.libssh.org/get-it/" )
FEATURE_SUMMARY(WHAT ALL)
"${_dll_output_dir}"
)
endif(SBC_FOUND)
+ if (SPANDSP_FOUND)
+ add_custom_command(TARGET copy_cli_dlls PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${SPANDSP_DLL_DIR}/${SPANDSP_DLL}"
+ "${_dll_output_dir}"
+ )
+ endif(SPANDSP_FOUND)
if (SMI_FOUND)
# Wireshark.nsi wants SMI_DIR which is the base SMI directory
get_filename_component(SMI_DIR ${SMI_DLL_DIR} DIRECTORY)
# todo Mostly hardcoded
option(ENABLE_KERBEROS "Build with Kerberos support" ON)
option(ENABLE_SBC "Build with SBC Codec support in RTP Player" ON)
+option(ENABLE_SPANDSP "Build with G.722/G.726 codecs support in RTP Player" ON)
# How to install
set(DUMPCAP_INSTALL_OPTION "normal" CACHE STRING "Permissions to install")
set(DUMPCAP_INST_VALS "normal" "suid" "capabilities")
--- /dev/null
+# Find the system's Spandsp includes and library
+#
+# SPANDSP_INCLUDE_DIRS - where to find spandsp.h
+# SPANDSP_LIBRARIES - List of libraries when using spandsp
+# SPANDSP_FOUND - True if spandsp found
+# SPANDSP_DLL_DIR - (Windows) Path to the Spandsp DLL
+# SPANDSP_DLL - (Windows) Name of the Spandsp DLL
+
+include( FindWSWinLibs )
+FindWSWinLibs( "spandsp-.*" "SPANDSP_HINTS" )
+
+find_package(PkgConfig)
+pkg_search_module(SPANDSP spandsp)
+
+find_path( SPANDSP_INCLUDE_DIR
+ NAMES spandsp.h
+ HINTS
+ "${SPANDSP_INCLUDEDIR}"
+ "${SPANDSP_HINTS}/include"
+ PATHS /usr/local/include /usr/include
+)
+
+find_library( SPANDSP_LIBRARY
+ NAMES spandsp
+ HINTS
+ "${SPANDSP_LIBDIR}"
+ "${SPANDSP_HINTS}/lib"
+ PATHS /usr/local/lib /usr/lib
+)
+
+include( FindPackageHandleStandardArgs )
+find_package_handle_standard_args( Spandsp DEFAULT_MSG SPANDSP_INCLUDE_DIR SPANDSP_LIBRARY )
+
+if( SPANDSP_FOUND )
+ set( SPANDSP_INCLUDE_DIRS ${SPANDSP_INCLUDE_DIR} )
+ set( SPANDSP_LIBRARIES ${SPANDSP_LIBRARY} )
+ if (WIN32)
+ set ( SPANDSP_DLL_DIR "${SPANDSP_HINTS}/bin"
+ CACHE PATH "Path to spandsp DLL"
+ )
+ file( GLOB _spandsp_dll RELATIVE "${SPANDSP_DLL_DIR}"
+ "${SPANDSP_DLL_DIR}/libspandsp-*.dll"
+ )
+ set ( SPANDSP_DLL ${_spandsp_dll}
+ # We're storing filenames only. Should we use STRING instead?
+ CACHE FILEPATH "spandsp DLL file name"
+ )
+ mark_as_advanced( SPANDSP_DLL_DIR SPANDSP_DLL )
+ endif()
+else()
+ set( SPANDSP_INCLUDE_DIRS )
+ set( SPANDSP_LIBRARIES )
+endif()
+
+mark_as_advanced( SPANDSP_LIBRARIES SPANDSP_INCLUDE_DIRS )
/* Define to 1 if you want to playing SBC by standalone BlueZ SBC library */
#cmakedefine HAVE_SBC 1
+/* Define to 1 if you have the spandsp library. */
+#cmakedefine HAVE_SPANDSP 1
+
/* Define to 1 if you have the `setresgid' function. */
#cmakedefine HAVE_SETRESGID 1
codecs.c
G711a/G711adecode.c
G711u/G711udecode.c
- # These are wrapped in "#ifdef HAVE_SPANDSP", which we don't currently
- # handle or define.
- # G722/G722decode.c
- # G726/G726decode.c
speex/resample.c
)
wsutil
)
+if(HAVE_SPANDSP)
+ list(APPEND WSCODECS_FILES G722/G722decode.c G726/G726decode.c)
+ list(APPEND wscodecs_LIBS ${SPANDSP_LIBRARIES})
+endif()
+
add_library(wscodecs ${LINK_MODE_LIB}
${WSCODECS_FILES}
${CMAKE_BINARY_DIR}/image/libwscodecs.rc
/* G722decode.c
- * A-law G.711 codec
+ * G.722 codec
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
#include <glib.h>
#ifdef HAVE_SPANDSP
-#include "telephony.h"
-#include "g722.h"
+#include "spandsp.h"
#include "G722decode.h"
-static g722_decode_state_t state;
-
void *
codec_g722_init(void)
{
- memset (&state, 0, sizeof (state));
- g722_decode_init(&state, 64000, 0);
+ g722_decode_state_t *state;
+
+ /* Valid values for bit_rate for G.722 are 48000, 56000, 64000, but RTP/AVP
+ * profile requires 64kbps, aligned at octets. */
+ state = g722_decode_init(NULL, 64000, 0);
- return NULL;
+ return state;
}
void
-codec_g722_release(void *ctx _U_)
+codec_g722_release(void *ctx)
{
+ g722_decode_state_t *state = (g722_decode_state_t *)ctx;
+
+ if (!state) {
+ return; /* out-of-memory; */
+ }
+ /* Note: replaces g722_decode_release since spandsp 20090211 */
+ g722_decode_free(state);
}
-int
+unsigned
codec_g722_get_channels(void *ctx _U_)
{
+ /* G.722 has only one channel. */
return 1;
}
-int
+unsigned
codec_g722_get_frequency(void *ctx _U_)
{
- return 64000;
+ /* Note: RTP Clock rate is 8kHz due to a historic error, but actual sampling
+ * rate is 16kHz (RFC 3551, section 4.5.2). */
+ return 16000;
}
-int
-codec_g722_decode(void *ctx _U_, const void *input, int inputSizeBytes, void *output,
- int *outputSizeBytes)
+size_t
+codec_g722_decode(void *ctx, const void *input, size_t inputSizeBytes, void *output,
+ size_t *outputSizeBytes)
{
- *outputSizeBytes = g722_decode(&state, output, input, inputSizeBytes);
- return 0;
+ g722_decode_state_t *state = (g722_decode_state_t *)ctx;
+
+ if (!state) {
+ return 0; /* out-of-memory; */
+ }
+
+ if (!output || !outputSizeBytes) {
+ return 4 * inputSizeBytes;
+ }
+
+ /* g722_decode returns the number of 16-bit samples. */
+ *outputSizeBytes = 2 * g722_decode(state, (int16_t *)output, (const uint8_t *)input, (int)inputSizeBytes);
+ return *outputSizeBytes;
}
#endif
/* G722decode.h
- * Definitions for A-law G.722 codec
+ * Definitions for G.722 codec
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
void *codec_g722_init(void);
void codec_g722_release(void *ctx);
-int codec_g722_get_channels(void *ctx);
-int codec_g722_get_frequency(void *ctx);
-int codec_g722_decode(void *ctx, const void *input, int inputSizeBytes, void *output,
- int *outputSizeBytes);
+unsigned codec_g722_get_channels(void *ctx);
+unsigned codec_g722_get_frequency(void *ctx);
+size_t codec_g722_decode(void *ctx, const void *input, size_t inputSizeBytes, void *output,
+ size_t *outputSizeBytes);
#endif /* G722decode.h */
#include <glib.h>
#ifdef HAVE_SPANDSP
-#include "telephony.h"
-#include "bitstream.h"
-#include "g726.h"
+#include "spandsp.h"
#include "G726decode.h"
-/* this isn't reentrant. Making it might involve quite a few changes to be able to pass a g726 state
- * variable to the various functions involved in G.726 decoding.
- */
-static g726_state_t state;
+typedef struct _g726_codec_ctx {
+ g726_state_t *state;
+ int bit_rate;
+} g726_codec_ctx;
-/* Currently, only G.726-32, linear encoding, left packed is supported */
-void *
-codec_g726_init(void)
+static inline void *
+codec_g726_init(int bit_rate, int packing)
{
- memset (&state, 0, sizeof (state));
- g726_init(&state, 32000, 0, 1);
+ g726_state_t *decoder = g726_init(NULL, bit_rate, G726_ENCODING_LINEAR, packing);
+
+ if (!decoder) {
+ return NULL; /* out-of-memory; */
+ }
+
+ g726_codec_ctx *state = g_new(g726_codec_ctx, 1);
+ state->state = decoder;
+ state->bit_rate = bit_rate;
- return NULL;
+ return state;
}
+void *codec_g726_16_init(void) { return codec_g726_init(16000, G726_PACKING_RIGHT); }
+void *codec_g726_24_init(void) { return codec_g726_init(24000, G726_PACKING_RIGHT); }
+void *codec_g726_32_init(void) { return codec_g726_init(32000, G726_PACKING_RIGHT); }
+void *codec_g726_40_init(void) { return codec_g726_init(40000, G726_PACKING_RIGHT); }
+void *codec_aal2_g726_16_init(void) { return codec_g726_init(16000, G726_PACKING_LEFT); }
+void *codec_aal2_g726_24_init(void) { return codec_g726_init(24000, G726_PACKING_LEFT); }
+void *codec_aal2_g726_32_init(void) { return codec_g726_init(32000, G726_PACKING_LEFT); }
+void *codec_aal2_g726_40_init(void) { return codec_g726_init(40000, G726_PACKING_LEFT); }
+
void
-codec_g726_release(void *ctx _U_)
+codec_g726_release(void *ctx)
{
+ g726_codec_ctx *state = (g726_codec_ctx *)ctx;
+
+ if (!state) {
+ return; /* out-of-memory; */
+ }
+ /* Note: replaces g726_release since spandsp 20090211 */
+ g726_free(state->state);
+ g_free(state);
}
-int
+unsigned
codec_g726_get_channels(void *ctx _U_)
{
return 1;
}
-int
+unsigned
codec_g726_get_frequency(void *ctx _U_)
{
- return 32000;
+ return 8000;
}
-/* Packing should be user defined (via the decode dialog) since due to historical reasons two diverging
- * de facto standards are in use today (see RFC3551).
- */
-int
-codec_g726_decode(void *ctx _U_, const void *input, int inputSizeBytes, void *output,
- int *outputSizeBytes)
+size_t
+codec_g726_decode(void *ctx, const void *input, size_t inputSizeBytes, void *output,
+ size_t *outputSizeBytes)
{
- *outputSizeBytes = 2 * g726_decode(&state, output, (void*) input, inputSizeBytes);
- return 0;
+ g726_codec_ctx *state = (g726_codec_ctx *)ctx;
+
+ if (!state) {
+ return 0; /* out-of-memory; */
+ }
+
+ if (!output || !outputSizeBytes) {
+ /*
+ * sample rate 8kHz, for bitrate 16kHz we have 16/8 = 2 bits/sample, so
+ * 1 input byte (8 bits) will expand to four 16-bit samples. Likewise,
+ * for bitrate 40kHz we have 40/8 = 5 bits/sample. Alternatively:
+ * bitsPerSample = bitRate / sampleRate (8kHz).
+ * outputBytes = (inputBits / bitsPerSample) * sizeof(sample)
+ */
+ return inputSizeBytes * 8 / (state->bit_rate / 8000) * 2;
+ }
+
+ /* g726_decode returns the number of 16-bit samples. */
+ *outputSizeBytes = 2 * g726_decode(state->state, (int16_t *)output, (const uint8_t *) input, (int)inputSizeBytes);
+ return *outputSizeBytes;
}
#endif
/* G726decode.h
- * Definitions for A-law G.722 codec
+ * Definitions for G.726 codec
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
#ifndef __CODECS_G726DECODE_H__
#define __CODECS_G726DECODE_H__
-void *codec_g726_init(void);
+void *codec_g726_16_init(void);
+void *codec_g726_24_init(void);
+void *codec_g726_32_init(void);
+void *codec_g726_40_init(void);
+void *codec_aal2_g726_16_init(void);
+void *codec_aal2_g726_24_init(void);
+void *codec_aal2_g726_32_init(void);
+void *codec_aal2_g726_40_init(void);
void codec_g726_release(void *ctx);
-int codec_g726_get_channels(void *ctx);
-int codec_g726_get_frequency(void *ctx);
-int codec_g726_decode(void *ctx, const void *input, int inputSizeBytes, void *output,
- int *outputSizeBytes);
+unsigned codec_g726_get_channels(void *ctx);
+unsigned codec_g726_get_frequency(void *ctx);
+size_t codec_g726_decode(void *ctx, const void *input, size_t inputSizeBytes, void *output,
+ size_t *outputSizeBytes);
#endif /* G726decode.h */
libwscodecs_la_SOURCES = \
codecs.c \
G711a/G711adecode.c \
- G711u/G711udecode.c \
- G722/G722decode.c \
- G726/G726decode.c
+ G711u/G711udecode.c
if HAVE_SBC
libwscodecs_la_SOURCES += sbc/sbc.c
endif
+if HAVE_SPANDSP
+libwscodecs_la_SOURCES += G722/G722decode.c G726/G726decode.c
+endif
+
if !HAVE_SPEEXDSP
libwscodecs_la_SOURCES += speex/resample.c
endif
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libwscodecs_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
-libwscodecs_la_LIBADD = $(top_builddir)/wsutil/libwsutil.la $(GLIB_LIBS) $(SBC_LIBS)
+libwscodecs_la_LIBADD = $(top_builddir)/wsutil/libwsutil.la $(GLIB_LIBS) $(SBC_LIBS) $(SPANDSP_LIBS)
libwscodecs_la_DEPENDENCIES = $(top_builddir)/wsutil/libwsutil.la
#include "sbc/sbc_private.h"
#endif
+#ifdef HAVE_SPANDSP
+#include "G722/G722decode.h"
+#include "G726/G726decode.h"
+#endif
+
#ifdef HAVE_PLUGINS
#include <gmodule.h>
#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
fi
AM_CONDITIONAL(HAVE_SBC, test "x$have_sbc" = "xyes")
+#`
+# Check Spandsp library for RTP Player
+# http://www.soft-switch.org/
+AC_ARG_WITH([spandsp],
+ AC_HELP_STRING( [--with-spandsp=@<:@yes/no@:>@],
+ [use Spandsp to play G.722/G.726 codecs @<:@default=yes, if available@:>@]),
+ with_spandsp="$withval"; want_spandsp="yes", with_spandsp="yes")
+
+PKG_CHECK_MODULES(SPANDSP, spandsp, [have_spandsp=yes], [have_spandsp=no])
+if test "x$with_spandsp" != "xno"; then
+ if (test "${have_spandsp}" = "yes"); then
+ AC_DEFINE(HAVE_SPANDSP, 1, [Define if you have the spandsp library])
+ elif test "x$want_spandsp" = "xyes"; then
+ # Error out if the user explicitly requested the spandsp library
+ AC_MSG_ERROR([Spandsp library was requested, but is not available])
+ fi
+else
+ have_spandsp=no
+fi
+AM_CONDITIONAL(HAVE_SPANDSP, test "x$have_spandsp" = "xyes")
+
dnl
dnl check whether plugins should be enabled and, if they should be,
dnl check for plugins directory - stolen from Amanda's configure.ac
echo " Have ssh_userauth_agent : $ssh_userauth_agent_message"
echo " Use nl library : $libnl_message"
echo " Use SBC codec library : $have_sbc"
+echo " Use Spandsp library : $have_spandsp"
echo " Use nghttp2 library : $nghttp2_message"
echo " Use LZ4 library : $have_lz4"
echo " Use Snappy library : $have_snappy"
libgeoip-dev, dpkg-dev (>= 1.16.1~), imagemagick, xdg-utils,
libnl-genl-3-dev [linux-any], libnl-route-3-dev [linux-any], asciidoc,
cmake (>= 2.8.8), w3m, libsbc-dev, libnghttp2-dev, libssh-gcrypt-dev,
- libnghttp2-dev, liblz4-dev, libsnappy-dev
+ liblz4-dev, libsnappy-dev, libspandsp-dev
Build-Conflicts: libsnmp4.2-dev, libsnmp-dev
Vcs-Svn: svn://svn.debian.org/svn/collab-maint/ext-maint/wireshark/trunk
Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/ext-maint/wireshark/trunk/
* SS7 Point Codes can now be resolved into names with a hosts-like file.
* Wireshark can now go fullscreen to have more room for packets.
* TShark can now export objects like the other GUI interfaces.
+* Support for G.722 and G.726 codecs in the RTP Player (via the Spandsp library).
//=== Removed Dissectors
foreach(_dll ${GLIB2_DLLS} ${CARES_DLL} ${GCRYPT_DLLS} ${GEOIP_DLL}
${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLL} ${LUA_DLL}
${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL}
- ${WINSPARKLE_DLL} ${ZLIB_DLL}
+ ${SPANDSP_DLL} ${WINSPARKLE_DLL} ${ZLIB_DLL}
)
set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n")
endforeach()
%global with_lz4_and_snappy 1
%global with_c_ares 1
%global with_portaudio 0
+%global with_spandsp 0
%global with_nghttp2 1
# Set at most one of these two:
BuildRequires: portaudio-devel
Requires: portaudio
%endif
+%if %{with_spandsp}
+BuildRequires: spandsp-devel
+Requires: spandsp
+%endif
# Uncomment these if you want to be sure you get them...
#BuildRequires: GeoIP-devel
%if %{with_portaudio}
--with-portaudio \
%endif
+%if %{with_spandsp}
+ --with-spandsp \
+%endif
%if %{with qt}
--with-qt=4 \
%else
%endif
%changelog
+* Mon Dec 5 2016 Jeff Morriss
+- Add spandsp (as an option, defaulting to not required).
+
* Tue Oct 18 2016 Benoit Canet
- Add LZ4 and snappy compression support.
foreach(_dll ${GLIB2_DLLS} ${CARES_DLL} ${GCRYPT_DLLS} ${GEOIP_DLL}
${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLL} ${LUA_DLL}
${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL}
- ${WINSPARKLE_DLL} ${ZLIB_DLL}
+ ${SPANDSP_DLL} ${WINSPARKLE_DLL} ${ZLIB_DLL}
)
#ensure uniqueness of files
IF(NOT "${unique_component}" MATCHES "(^|;)${_dll}(;|$)")
foreach(_dll ${GLIB2_DLLS} ${CARES_DLL} ${GCRYPT_DLLS} ${GEOIP_DLL}
${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLL} ${LUA_DLL}
${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL}
- ${WINSPARKLE_DLL} ${ZLIB_DLL}
+ ${SPANDSP_DLL} ${WINSPARKLE_DLL} ${ZLIB_DLL}
)
#ensure uniqueness of files
IF(NOT "${unique_file}" MATCHES "(^|;)${_dll}(;|$)")
portaudio19-dev asciidoc libgcrypt-dev libsbc-dev libgeoip-dev \
qtmultimedia5-dev liblua5.2-dev libnl-cli-3-dev \
libparse-yapp-perl qt5-default cmake libcap-dev \
- liblz4-dev libsnappy-dev"
+ liblz4-dev libsnappy-dev libspandsp-dev"
# Adds package $2 to list variable $1 if the package is found
add_package() {
# trouble instead of trying to catch exceptions everywhere.
$ErrorActionPreference = "Stop"
-$Win64CurrentTag = "2016-10-26"
-$Win32CurrentTag = "2016-10-26"
+$Win64CurrentTag = "2016-11-29"
+$Win32CurrentTag = "2016-11-29"
# Archive file / subdir.
$Win64Archives = @{
"portaudio_v19_2.zip" = "";
"sbc-1.3-win64ws.zip" = "";
"snappy-1.1.3-win64ws.zip" = "";
+ "spandsp-0.0.6-win64ws.zip" = "";
"upx303w.zip" = "";
"WinSparkle-0.3-44-g2c8d9d3-win64ws.zip" = "";
"WpdPack_4_1_2.zip" = "";
"portaudio_v19_2.zip" = "";
"sbc-1.3-win32ws.zip" = "";
"snappy-1.1.3-win32ws.zip" = "";
+ "spandsp-0.0.6-win32ws.zip" = "";
"upx303w.zip" = "";
"WinSparkle-0.3-44-g2c8d9d3-win32ws.zip" = "";
"WpdPack_4_1_2.zip" = "";
"portaudio_v19_2"
"sbc-1.3-win??ws"
"snappy-1.1.3-win??ws"
+ "spandsp-0.0.6-win??ws"
"upx301w"
"upx303w"
"user-guide"
seq = rp->info->info_seq_num;
}
- rtp_time = (double)(rp->info->info_timestamp-start_timestamp)/sample_rate - start_rtp_time;
+ unsigned rtp_clock_rate = sample_rate;
+ if (rp->info->info_payload_type == PT_G722) {
+ // G.722 sample rate is 16kHz, but RTP clock rate is 8kHz for historic reasons.
+ rtp_clock_rate = 8000;
+ }
+
+ rtp_time = (double)(rp->info->info_timestamp-start_timestamp)/rtp_clock_rate - start_rtp_time;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cb_use_rtp_timestamp))) {
arrive_time = rtp_time;
}
last_sequence = rtp_packet->info->info_seq_num;
- double rtp_time = (double)(rtp_packet->info->info_timestamp-start_timestamp)/sample_rate - start_rtp_time;
+ unsigned rtp_clock_rate = sample_rate;
+ if (rtp_packet->info->info_payload_type == PT_G722) {
+ // G.722 sample rate is 16kHz, but RTP clock rate is 8kHz for historic reasons.
+ rtp_clock_rate = 8000;
+ }
+
+ double rtp_time = (double)(rtp_packet->info->info_timestamp-start_timestamp)/rtp_clock_rate - start_rtp_time;
double arrive_time;
if (timing_mode_ == RtpTimestamp) {
arrive_time = rtp_time;
}
speex_resampler_process_int(audio_resampler_, 0, decode_buff, &in_len, resample_buff, &out_len);
- write_buff = (char *) decode_buff;
+ write_buff = (char *) resample_buff;
write_bytes = out_len * sample_bytes_;
}
ui->streamTreeWidget->topLevelItemCount(),
rtp_stream->packet_count,
g_list_length(rtp_stream->rtp_packet_list),
- rtp_stream->start_fd->num);
+ rtp_stream->start_fd ? rtp_stream->start_fd->num : 0);
}
void RtpPlayerDialog::showEvent(QShowEvent *)