Skip to content

Commit d776d00

Browse files
MarkWangChinesenashif
authored andcommitted
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 <[email protected]>
1 parent 5f79cd8 commit d776d00

File tree

6 files changed

+8
-18
lines changed

6 files changed

+8
-18
lines changed
File renamed without changes.

modules/libsbc/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if(CONFIG_LIBSBC_ENCODER OR CONFIG_LIBSBC_DECODER)
1+
if(CONFIG_LIBSBC)
22

33
zephyr_library_named(libsbc)
44
# -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)
88

99
zephyr_library_compile_definitions(SBC_FOR_EMBEDDED_LINUX)
1010
zephyr_library_compile_definitions(SBC_NO_PCM_CPY_OPTION)
11-
zephyr_library_sources(sbc.c)
1211

1312
zephyr_include_directories(
1413
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/include
@@ -19,7 +18,6 @@ zephyr_include_directories(
1918
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce
2019
)
2120

22-
if(CONFIG_LIBSBC_ENCODER)
2321
zephyr_library_sources(
2422
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_analysis.c
2523
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_dct.c
@@ -30,9 +28,7 @@ zephyr_library_sources(
3028
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_encoder.c
3129
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_packing.c
3230
)
33-
endif()
3431

35-
if(CONFIG_LIBSBC_DECODER)
3632
zephyr_library_sources(
3733
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/alloc.c
3834
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/bitalloc.c
@@ -51,4 +47,3 @@ zephyr_library_sources(
5147
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/synthesis-sbc.c
5248
)
5349
endif()
54-
endif()

modules/libsbc/Kconfig

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
config ZEPHYR_LIBSBC_MODULE
55
bool
66

7-
config LIBSBC_ENCODER
8-
bool "libsbc encoder Support"
7+
config LIBSBC
8+
bool "libsbc Support"
99
help
10-
This option enables the Android SBC encoder library for Bluetooth A2DP
11-
12-
config LIBSBC_DECODER
13-
bool "libsbc decoder Support"
14-
help
15-
This option enables the Android SBC decoder library for Bluetooth A2DP
10+
This option enables Low Complexity Subband Codec (SBC)

subsys/bluetooth/host/classic/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ config BT_AVDTP
445445
config BT_A2DP
446446
bool "Bluetooth A2DP Profile [EXPERIMENTAL]"
447447
select BT_AVDTP
448+
imply LIBSBC
448449
select EXPERIMENTAL
449450
help
450451
This option enables the A2DP profile
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
zephyr_sources_ifdef(CONFIG_BT_EAD ead.c)
4+
zephyr_sources_ifdef(CONFIG_LIBSBC sbc.c)

modules/libsbc/sbc.c renamed to subsys/bluetooth/lib/sbc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
#include <errno.h>
8-
#include <zephyr/libsbc/sbc.h>
8+
#include <zephyr/bluetooth/sbc.h>
99

10-
#if defined(CONFIG_LIBSBC_ENCODER)
10+
#if defined(CONFIG_LIBSBC)
1111

1212
int sbc_setup_encoder(struct sbc_encoder *encoder, struct sbc_encoder_init_param *param)
1313
{
@@ -136,9 +136,7 @@ int sbc_frame_encoded_bytes(struct sbc_encoder *encoder)
136136

137137
return size;
138138
}
139-
#endif
140139

141-
#if defined(CONFIG_LIBSBC_DECODER)
142140
/**
143141
* Setup decoder
144142
*/

0 commit comments

Comments
 (0)