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