Skip to content

Commit d8ebce0

Browse files
committed
Optimize file structure
1 parent a5af041 commit d8ebce0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+118
-224
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ Liteplayer 具有如下特点:
1010

1111
**核心播放接口**
1212
- 提供播放器基本服务,包括 set_data_source、prepare、start、pause、resume、seek、stop、reset 等操作
13-
- https://github.com/sepnic/liteplayer_priv/blob/master/library/include/liteplayer_main.h
13+
- https://github.com/sepnic/liteplayer_priv/blob/master/include/liteplayer_main.h
1414

1515
**列表播放接口**
1616
- 除了播放器基本功能外,还支持 m3u8 协议列表、本地播放列表、切换上下首、单曲循环等操作
17-
- https://github.com/sepnic/liteplayer_priv/blob/master/library/include/liteplayer_listplayer.h
17+
- https://github.com/sepnic/liteplayer_priv/blob/master/include/liteplayer_listplayer.h
1818

1919
**TTS播放接口**
2020
- 提供 TTS 流播放功能,支持 prepare、start、stop、reset 等操作
21-
- https://github.com/sepnic/liteplayer_priv/blob/master/library/include/liteplayer_ttsplayer.h
21+
- https://github.com/sepnic/liteplayer_priv/blob/master/include/liteplayer_ttsplayer.h
2222

2323
**播放器适配层**
2424
- 数据源输入、音频设备输出的抽象接口,默认适配了 "文件流-标准文件系统"、 "网络流-httpclient"、"音频设备输出-alsa/OpenSLES/AudioTrack"
25-
- https://github.com/sepnic/liteplayer_priv/blob/master/library/include/liteplayer_adapter.h
25+
- https://github.com/sepnic/liteplayer_priv/blob/master/include/liteplayer_adapter.h
2626

2727
**OSAL 适配层**
2828
- Thread、Memory、Time 等操作系统相关的抽象接口,如果系统已支持 POSIX 接口规范,则不用修改直接使用即可

build.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ set -x
44
set -e
55

66
TOP_DIR=${PWD}
7-
CUR_DIR=${PWD}
87
OUTPUT_DIR=${PWD}/out
98

109
# build libs
11-
echo "Building libs"
12-
mkdir -p ${OUTPUT_DIR}/libs
13-
cd ${OUTPUT_DIR}/libs
14-
cmake ${TOP_DIR}/library
10+
echo "Building library"
11+
mkdir -p ${OUTPUT_DIR}/library
12+
cd ${OUTPUT_DIR}/library
13+
cmake ${TOP_DIR}/src
1514
make
1615

1716
# build example
@@ -21,6 +20,3 @@ cd ${OUTPUT_DIR}/example
2120
cmake ${TOP_DIR}/example/unix
2221
make
2322

24-
# build android jni
25-
cd ${CUR_DIR}
26-
ndk-build -C android/jni

example/android/library/src/main/cpp/CMakeLists.txt

+21-22
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(liteplayer_jni)
44
set(TOP_DIR "${CMAKE_SOURCE_DIR}/../../../../../..")
55

66
# include files
7-
include_directories(${TOP_DIR}/library/include)
7+
include_directories(${TOP_DIR}/include)
88
include_directories(${TOP_DIR}/adapter)
99

1010
# cflags: compile paramters
@@ -41,24 +41,24 @@ file(GLOB CODEC_SRC src
4141
${TOP_DIR}/thirdparty/codecs/aac-pvaac/*.cpp)
4242
set(LITEPLAYER_CORE_SRC
4343
${CODEC_SRC}
44-
${TOP_DIR}/library/source/esp_adf/audio_element.c
45-
${TOP_DIR}/library/source/esp_adf/audio_event_iface.c
46-
${TOP_DIR}/library/source/audio_decoder/mp3_pvmp3_wrapper.c
47-
${TOP_DIR}/library/source/audio_decoder/mp3_decoder.c
48-
${TOP_DIR}/library/source/audio_decoder/aac_pvaac_wrapper.c
49-
${TOP_DIR}/library/source/audio_decoder/aac_decoder.c
50-
${TOP_DIR}/library/source/audio_decoder/m4a_decoder.c
51-
${TOP_DIR}/library/source/audio_decoder/wav_decoder.c
52-
${TOP_DIR}/library/source/audio_extractor/mp3_extractor.c
53-
${TOP_DIR}/library/source/audio_extractor/aac_extractor.c
54-
${TOP_DIR}/library/source/audio_extractor/m4a_extractor.c
55-
${TOP_DIR}/library/source/audio_extractor/wav_extractor.c
56-
${TOP_DIR}/library/source/liteplayer_adapter.c
57-
${TOP_DIR}/library/source/liteplayer_source.c
58-
${TOP_DIR}/library/source/liteplayer_parser.c
59-
${TOP_DIR}/library/source/liteplayer_main.c
60-
${TOP_DIR}/library/source/liteplayer_listplayer.c
61-
${TOP_DIR}/library/source/liteplayer_ttsplayer.c)
44+
${TOP_DIR}/src/esp_adf/audio_element.c
45+
${TOP_DIR}/src/esp_adf/audio_event_iface.c
46+
${TOP_DIR}/src/audio_decoder/mp3_pvmp3_wrapper.c
47+
${TOP_DIR}/src/audio_decoder/mp3_decoder.c
48+
${TOP_DIR}/src/audio_decoder/aac_pvaac_wrapper.c
49+
${TOP_DIR}/src/audio_decoder/aac_decoder.c
50+
${TOP_DIR}/src/audio_decoder/m4a_decoder.c
51+
${TOP_DIR}/src/audio_decoder/wav_decoder.c
52+
${TOP_DIR}/src/audio_extractor/mp3_extractor.c
53+
${TOP_DIR}/src/audio_extractor/aac_extractor.c
54+
${TOP_DIR}/src/audio_extractor/m4a_extractor.c
55+
${TOP_DIR}/src/audio_extractor/wav_extractor.c
56+
${TOP_DIR}/src/liteplayer_adapter.c
57+
${TOP_DIR}/src/liteplayer_source.c
58+
${TOP_DIR}/src/liteplayer_parser.c
59+
${TOP_DIR}/src/liteplayer_main.c
60+
${TOP_DIR}/src/liteplayer_listplayer.c
61+
${TOP_DIR}/src/liteplayer_ttsplayer.c)
6262
add_library(liteplayer_core STATIC ${LITEPLAYER_CORE_SRC})
6363
target_compile_options(liteplayer_core PRIVATE
6464
-DLITEPLAYER_CONFIG_SINK_FIXED_S16LE -DLITEPLAYER_CONFIG_AAC_SBR
@@ -71,8 +71,7 @@ target_include_directories(liteplayer_core PRIVATE
7171
${TOP_DIR}/thirdparty/codecs/mp3-pvmp3/include
7272
${TOP_DIR}/thirdparty/codecs/mp3-pvmp3/src
7373
${TOP_DIR}/thirdparty/codecs/aac-pvaac
74-
${TOP_DIR}/library/include
75-
${TOP_DIR}/library/source
74+
${TOP_DIR}/src
7675
${TOP_DIR}/adapter)
7776

7877
# liteplayer_adapter
@@ -82,7 +81,7 @@ set(LITEPLAYER_ADAPTER_SRC
8281
${TOP_DIR}/adapter/sink_opensles_wrapper.cpp)
8382
add_library(liteplayer_adapter STATIC ${LITEPLAYER_ADAPTER_SRC})
8483
target_include_directories(liteplayer_adapter PRIVATE
85-
${TOP_DIR}/thirdparty/sysutils/include ${TOP_DIR}/library/include)
84+
${TOP_DIR}/thirdparty/sysutils/include)
8685

8786
# liteplayer-jni
8887
add_library(liteplayer-jni SHARED liteplayer-jni.cpp)

example/esp32/components/liteplayer_adapter/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
set(TOP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..)
2-
set(LITEPLAYER_DIR ${TOP_DIR}/library)
32
set(THIRDPARTY_DIR ${TOP_DIR}/thirdparty)
43
set(ADAPTER_DIR ${TOP_DIR}/adapter)
54

@@ -8,7 +7,7 @@ set(COMPONENT_PRIV_REQUIRES sysutils driver)
87

98
set(COMPONENT_ADD_INCLUDEDIRS ${ADAPTER_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
109

11-
set(COMPONENT_PRIV_INCLUDEDIRS ${LITEPLAYER_DIR}/include)
10+
set(COMPONENT_PRIV_INCLUDEDIRS ${TOP_DIR}/include)
1211

1312
set(COMPONENT_SRCS
1413
${ADAPTER_DIR}/source_httpclient_wrapper.c
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
set(TOP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..)
2-
set(LITEPLAYER_DIR ${TOP_DIR}/library)
2+
set(LITEPLAYER_DIR ${TOP_DIR}/src)
33
set(THIRDPARTY_DIR ${TOP_DIR}/thirdparty)
44

55
set(COMPONENT_REQUIRES)
66
set(COMPONENT_PRIV_REQUIRES sysutils)
77

8-
set(COMPONENT_ADD_INCLUDEDIRS ${LITEPLAYER_DIR}/include)
8+
set(COMPONENT_ADD_INCLUDEDIRS ${TOP_DIR}/include)
99

1010
set(COMPONENT_PRIV_INCLUDEDIRS
1111
${THIRDPARTY_DIR}/sysutils/include
1212
${THIRDPARTY_DIR}/codecs
1313
${THIRDPARTY_DIR}/codecs/mp3-pvmp3/include
1414
${THIRDPARTY_DIR}/codecs/mp3-pvmp3/src
1515
${THIRDPARTY_DIR}/codecs/aac-pvaac
16-
${LITEPLAYER_DIR}/source
16+
${LITEPLAYER_DIR}
1717
)
1818

1919
file(GLOB CODECS_SRCS src
@@ -22,24 +22,24 @@ file(GLOB CODECS_SRCS src
2222
)
2323

2424
set(COMPONENT_SRCS
25-
${LITEPLAYER_DIR}/source/esp_adf/audio_element.c
26-
${LITEPLAYER_DIR}/source/esp_adf/audio_event_iface.c
27-
${LITEPLAYER_DIR}/source/audio_decoder/mp3_pvmp3_wrapper.c
28-
${LITEPLAYER_DIR}/source/audio_decoder/mp3_decoder.c
29-
${LITEPLAYER_DIR}/source/audio_decoder/aac_pvaac_wrapper.c
30-
${LITEPLAYER_DIR}/source/audio_decoder/aac_decoder.c
31-
${LITEPLAYER_DIR}/source/audio_decoder/m4a_decoder.c
32-
${LITEPLAYER_DIR}/source/audio_decoder/wav_decoder.c
33-
${LITEPLAYER_DIR}/source/audio_extractor/mp3_extractor.c
34-
${LITEPLAYER_DIR}/source/audio_extractor/aac_extractor.c
35-
${LITEPLAYER_DIR}/source/audio_extractor/m4a_extractor.c
36-
${LITEPLAYER_DIR}/source/audio_extractor/wav_extractor.c
37-
${LITEPLAYER_DIR}/source/liteplayer_adapter.c
38-
${LITEPLAYER_DIR}/source/liteplayer_source.c
39-
${LITEPLAYER_DIR}/source/liteplayer_parser.c
40-
${LITEPLAYER_DIR}/source/liteplayer_main.c
41-
${LITEPLAYER_DIR}/source/liteplayer_listplayer.c
42-
${LITEPLAYER_DIR}/source/liteplayer_ttsplayer.c
25+
${LITEPLAYER_DIR}/esp_adf/audio_element.c
26+
${LITEPLAYER_DIR}/esp_adf/audio_event_iface.c
27+
${LITEPLAYER_DIR}/audio_decoder/mp3_pvmp3_wrapper.c
28+
${LITEPLAYER_DIR}/audio_decoder/mp3_decoder.c
29+
${LITEPLAYER_DIR}/audio_decoder/aac_pvaac_wrapper.c
30+
${LITEPLAYER_DIR}/audio_decoder/aac_decoder.c
31+
${LITEPLAYER_DIR}/audio_decoder/m4a_decoder.c
32+
${LITEPLAYER_DIR}/audio_decoder/wav_decoder.c
33+
${LITEPLAYER_DIR}/audio_extractor/mp3_extractor.c
34+
${LITEPLAYER_DIR}/audio_extractor/aac_extractor.c
35+
${LITEPLAYER_DIR}/audio_extractor/m4a_extractor.c
36+
${LITEPLAYER_DIR}/audio_extractor/wav_extractor.c
37+
${LITEPLAYER_DIR}/liteplayer_adapter.c
38+
${LITEPLAYER_DIR}/liteplayer_source.c
39+
${LITEPLAYER_DIR}/liteplayer_parser.c
40+
${LITEPLAYER_DIR}/liteplayer_main.c
41+
${LITEPLAYER_DIR}/liteplayer_listplayer.c
42+
${LITEPLAYER_DIR}/liteplayer_ttsplayer.c
4343
${CODECS_SRCS}
4444
)
4545

@@ -56,3 +56,7 @@ target_compile_options(${COMPONENT_TARGET} PRIVATE
5656
-Wno-error=narrowing
5757
-Wno-error=int-to-pointer-cast
5858
)
59+
60+
IF(IDF_VERSION_MAJOR GREATER 3)
61+
target_compile_options(${COMPONENT_TARGET} PRIVATE -Wno-error=implicit-fallthrough)
62+
ENDIF()

example/unix/CMakeLists.txt

+21-21
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fPIC -std=c++11 -Wall -Werror")
2121

2222
# include files
2323
include_directories(${TOP_DIR}/thirdparty/sysutils/include)
24-
include_directories(${TOP_DIR}/library/include)
24+
include_directories(${TOP_DIR}/include)
2525
include_directories(${TOP_DIR}/adapter)
2626

2727
# sysutils files
@@ -50,25 +50,25 @@ file(GLOB LITEPLAYER_CODEC_SRC src
5050
)
5151
set(LITEPLAYER_CORE_SRC
5252
${LITEPLAYER_CODEC_SRC}
53-
${TOP_DIR}/library/source/esp_adf/audio_element.c
54-
${TOP_DIR}/library/source/esp_adf/audio_event_iface.c
55-
${TOP_DIR}/library/source/audio_decoder/mp3_pvmp3_wrapper.c
56-
${TOP_DIR}/library/source/audio_decoder/mp3_decoder.c
57-
${TOP_DIR}/library/source/audio_decoder/aac_pvaac_wrapper.c
58-
${TOP_DIR}/library/source/audio_decoder/aac_decoder.c
59-
${TOP_DIR}/library/source/audio_decoder/m4a_decoder.c
60-
${TOP_DIR}/library/source/audio_decoder/wav_decoder.c
61-
${TOP_DIR}/library/source/audio_extractor/mp3_extractor.c
62-
${TOP_DIR}/library/source/audio_extractor/aac_extractor.c
63-
${TOP_DIR}/library/source/audio_extractor/m4a_extractor.c
64-
${TOP_DIR}/library/source/audio_extractor/wav_extractor.c
65-
${TOP_DIR}/library/source/liteplayer_adapter.c
66-
${TOP_DIR}/library/source/liteplayer_source.c
67-
${TOP_DIR}/library/source/liteplayer_parser.c
68-
${TOP_DIR}/library/source/liteplayer_debug.c
69-
${TOP_DIR}/library/source/liteplayer_main.c
70-
${TOP_DIR}/library/source/liteplayer_listplayer.c
71-
${TOP_DIR}/library/source/liteplayer_ttsplayer.c
53+
${TOP_DIR}/src/esp_adf/audio_element.c
54+
${TOP_DIR}/src/esp_adf/audio_event_iface.c
55+
${TOP_DIR}/src/audio_decoder/mp3_pvmp3_wrapper.c
56+
${TOP_DIR}/src/audio_decoder/mp3_decoder.c
57+
${TOP_DIR}/src/audio_decoder/aac_pvaac_wrapper.c
58+
${TOP_DIR}/src/audio_decoder/aac_decoder.c
59+
${TOP_DIR}/src/audio_decoder/m4a_decoder.c
60+
${TOP_DIR}/src/audio_decoder/wav_decoder.c
61+
${TOP_DIR}/src/audio_extractor/mp3_extractor.c
62+
${TOP_DIR}/src/audio_extractor/aac_extractor.c
63+
${TOP_DIR}/src/audio_extractor/m4a_extractor.c
64+
${TOP_DIR}/src/audio_extractor/wav_extractor.c
65+
${TOP_DIR}/src/liteplayer_adapter.c
66+
${TOP_DIR}/src/liteplayer_source.c
67+
${TOP_DIR}/src/liteplayer_parser.c
68+
${TOP_DIR}/src/liteplayer_debug.c
69+
${TOP_DIR}/src/liteplayer_main.c
70+
${TOP_DIR}/src/liteplayer_listplayer.c
71+
${TOP_DIR}/src/liteplayer_ttsplayer.c
7272
)
7373
add_library(liteplayer_core STATIC ${LITEPLAYER_CORE_SRC})
7474
target_compile_options(liteplayer_core PRIVATE
@@ -84,7 +84,7 @@ target_include_directories(liteplayer_core PRIVATE
8484
${TOP_DIR}/thirdparty/codecs/mp3-pvmp3/include
8585
${TOP_DIR}/thirdparty/codecs/mp3-pvmp3/src
8686
${TOP_DIR}/thirdparty/codecs/aac-pvaac
87-
${TOP_DIR}/library/source
87+
${TOP_DIR}/src
8888
)
8989

9090
# mbedtls files

example/unix/CMakeLists.txt.pvmp3.fdkaac

-104
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)