summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-02-16 11:12:35 +0100
committerEvan Huus <eapache@gmail.com>2014-02-17 21:44:17 +0000
commit5e27a39fc6ed65bca15461bb61c26bbb0a946f88 (patch)
treefe11397a7b2611406cf2b0b9da3c264f5fb0740c
parent49abfc47cc4d015f2e2f368d8c92f9ab6ca4377e (diff)
downloadwireshark-5e27a39fc6ed65bca15461bb61c26bbb0a946f88.tar.gz
Add Bluetooth SBC Codec support in cmake
SBC Codec can be optionally linked with Wireshark to provide ability to playing RTP/SBC stream by RTP Player. Change-Id: Iffbae16a741ffbfd0fb55a300064739d2c27c2e5 Reviewed-on: https://code.wireshark.org/review/223 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
-rw-r--r--CMakeLists.txt7
-rw-r--r--CMakeOptions.txt1
-rw-r--r--cmake/modules/FindSBC.cmake35
-rw-r--r--cmakeconfig.h.in3
4 files changed, 46 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17f838f9de..1dee27128f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -499,6 +499,10 @@ if(ENABLE_NETLINK)
set(PACKAGELIST ${PACKAGELIST} NL)
endif()
+if(ENABLE_SBC)
+ set(PACKAGELIST ${PACKAGELIST} SBC)
+endif()
+
# Capabilities
if(ENABLE_CAP)
set(PACKAGELIST ${PACKAGELIST} CAP SETCAP)
@@ -590,6 +594,9 @@ endif()
if(HAVE_LIBNL AND HAVE_AIRPCAP)
message(ERROR "Airpcap and Libnl support are mutually exclusive")
endif()
+if(HAVE_LIBSBC)
+ set(HAVE_SBC 1)
+endif()
# No matter which version of GTK is present
if(GTK2_FOUND OR GTK3_FOUND)
set(GTK_FOUND ON)
diff --git a/CMakeOptions.txt b/CMakeOptions.txt
index c3d167eda9..dad0217b71 100644
--- a/CMakeOptions.txt
+++ b/CMakeOptions.txt
@@ -56,6 +56,7 @@ option(ENABLE_CARES "Build with c-ares support" ON)
option(ENABLE_NETLINK "Build with libnl support" ON)
# todo Mostly hardcoded
option(ENABLE_KERBEROS "Build with Kerberos support" ON)
+option(ENABLE_SBC "Build with SBC Codec 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")
diff --git a/cmake/modules/FindSBC.cmake b/cmake/modules/FindSBC.cmake
new file mode 100644
index 0000000000..00ed88d66e
--- /dev/null
+++ b/cmake/modules/FindSBC.cmake
@@ -0,0 +1,35 @@
+# Find the native Bluetooth SBC Codec includes and library
+#
+# SBC_INCLUDE_DIRS - where to find sbc.h
+# SBC_LIBRARIES - List of libraries when using SBC
+# SBC_FOUND - True if SBC found
+
+include( FindWSWinLibs )
+FindWSWinLibs( "sbc" "SBC_HINTS" )
+
+find_path( SBC_INCLUDE_DIR
+ NAMES
+ sbc/sbc.h
+ HINTS
+ "${SBC_HINTS}/include"
+)
+
+find_library( SBC_LIBRARY
+ NAMES
+ sbc
+ HINTS
+ "${SBC_HINTS}/lib"
+)
+
+include( FindPackageHandleStandardArgs )
+find_package_handle_standard_args( SBC DEFAULT_MSG SBC_INCLUDE_DIR SBC_LIBRARY )
+
+if( SBC_FOUND )
+ set( SBC_INCLUDE_DIRS ${SBC_INCLUDE_DIR} )
+ set( SBC_LIBRARIES ${SBC_LIBRARY} )
+else()
+ set( SBC_INCLUDE_DIRS )
+ set( SBC_LIBRARIES )
+endif()
+
+mark_as_advanced( SBC_LIBRARIES SBC_INCLUDE_DIRS )
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index d33781de70..0f64dceea1 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -243,6 +243,9 @@
/* Define if sa_len field exists in struct sockaddr */
#cmakedefine HAVE_SA_LEN 1
+/* 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 `setresgid' function. */
#cmakedefine HAVE_SETRESGID 1