bluetooth: sbc: move sbc to bluetooth

move sbc to bluetooth because only bluetooth uses it,
change CONFIG_LIBSBC_ENCODER and CONFIG_LIBSBC_DECODER as CONFIG_LIBSBC.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
This commit is contained in:
Mark Wang
2025-10-10 11:22:16 +08:00
committed by Anas Nashif
parent 5f79cd83ea
commit d776d00c42
6 changed files with 8 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
if(CONFIG_LIBSBC_ENCODER OR CONFIG_LIBSBC_DECODER)
if(CONFIG_LIBSBC)
zephyr_library_named(libsbc)
# -Wno-stringop-overflow was added as otherwise gcc 13.3 produces multiple warnings in this library
@@ -8,7 +8,6 @@ zephyr_library_compile_options(-O3 -std=c11 -ffast-math -Wno-stringop-overflow)
zephyr_library_compile_definitions(SBC_FOR_EMBEDDED_LINUX)
zephyr_library_compile_definitions(SBC_NO_PCM_CPY_OPTION)
zephyr_library_sources(sbc.c)
zephyr_include_directories(
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/include
@@ -19,7 +18,6 @@ zephyr_include_directories(
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce
)
if(CONFIG_LIBSBC_ENCODER)
zephyr_library_sources(
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_analysis.c
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_dct.c
@@ -30,9 +28,7 @@ zephyr_library_sources(
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_encoder.c
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_packing.c
)
endif()
if(CONFIG_LIBSBC_DECODER)
zephyr_library_sources(
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/alloc.c
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/bitalloc.c
@@ -51,4 +47,3 @@ zephyr_library_sources(
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/synthesis-sbc.c
)
endif()
endif()

View File

@@ -4,12 +4,7 @@
config ZEPHYR_LIBSBC_MODULE
bool
config LIBSBC_ENCODER
bool "libsbc encoder Support"
config LIBSBC
bool "libsbc Support"
help
This option enables the Android SBC encoder library for Bluetooth A2DP
config LIBSBC_DECODER
bool "libsbc decoder Support"
help
This option enables the Android SBC decoder library for Bluetooth A2DP
This option enables Low Complexity Subband Codec (SBC)

View File

@@ -445,6 +445,7 @@ config BT_AVDTP
config BT_A2DP
bool "Bluetooth A2DP Profile [EXPERIMENTAL]"
select BT_AVDTP
imply LIBSBC
select EXPERIMENTAL
help
This option enables the A2DP profile

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources_ifdef(CONFIG_BT_EAD ead.c)
zephyr_sources_ifdef(CONFIG_LIBSBC sbc.c)

View File

@@ -5,9 +5,9 @@
*/
#include <errno.h>
#include <zephyr/libsbc/sbc.h>
#include <zephyr/bluetooth/sbc.h>
#if defined(CONFIG_LIBSBC_ENCODER)
#if defined(CONFIG_LIBSBC)
int sbc_setup_encoder(struct sbc_encoder *encoder, struct sbc_encoder_init_param *param)
{
@@ -136,9 +136,7 @@ int sbc_frame_encoded_bytes(struct sbc_encoder *encoder)
return size;
}
#endif
#if defined(CONFIG_LIBSBC_DECODER)
/**
* Setup decoder
*/