forked from osmocom/wireshark
![Peter Wu](/assets/img/avatar_default.png)
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>
95 lines
2.3 KiB
CMake
95 lines
2.3 KiB
CMake
# CMakeLists.txt
|
|
#
|
|
# Wireshark - Network traffic analyzer
|
|
# By Gerald Combs <gerald@wireshark.org>
|
|
# Copyright 1998 Gerald Combs
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License
|
|
# as published by the Free Software Foundation; either version 2
|
|
# of the License, or (at your option) any later version.
|
|
#
|
|
# This program 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 General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
#
|
|
|
|
set(WSCODECS_FILES
|
|
codecs.c
|
|
G711a/G711adecode.c
|
|
G711u/G711udecode.c
|
|
speex/resample.c
|
|
)
|
|
|
|
# Enables visibility in IDEs
|
|
file(GLOB EXTRA_CODEC_HEADERS
|
|
codecs.h
|
|
G711a/G711adecode.h G711a/G711atable.h
|
|
G711u/G711udecode.h G711u/G711utable.h
|
|
speex/arch.h
|
|
speex/speex_resampler.h
|
|
speex/stack_alloc.h
|
|
)
|
|
|
|
if(SBC_FOUND)
|
|
set(WSCODECS_FILES ${WSCODECS_FILES} sbc/sbc.c)
|
|
endif()
|
|
|
|
set(wscodecs_LIBS
|
|
${M_LIBRARIES}
|
|
${GMODULE2_LIBRARIES}
|
|
${SBC_LIBRARIES}
|
|
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
|
|
)
|
|
|
|
set(FULL_SO_VERSION "0.0.0")
|
|
|
|
set_target_properties(wscodecs PROPERTIES
|
|
PREFIX "lib"
|
|
COMPILE_DEFINITIONS "WS_BUILD_DLL"
|
|
COMPILE_OPTIONS "${WS_WS_WARNINGS_C_FLAGS}"
|
|
LINK_FLAGS "${WS_LINK_FLAGS}"
|
|
VERSION ${FULL_SO_VERSION} SOVERSION 0
|
|
FOLDER "DLLs"
|
|
)
|
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
|
set_target_properties(wscodecs PROPERTIES
|
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Frameworks
|
|
)
|
|
endif()
|
|
|
|
target_link_libraries(wscodecs ${wscodecs_LIBS})
|
|
|
|
if(NOT ${ENABLE_STATIC})
|
|
install(TARGETS wscodecs
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
)
|
|
endif()
|
|
|
|
CHECKAPI(
|
|
NAME
|
|
codecs
|
|
SWITCHES
|
|
-g abort -g termoutput -build
|
|
SOURCES
|
|
${WSCODECS_FILES}
|
|
)
|