Skip to content

Commit 1a2bfe5

Browse files
committed
Auto push on 2022-07-31 17:07
1 parent e7a9fda commit 1a2bfe5

Some content is hidden

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

91 files changed

+8622
-252
lines changed

.vscode/extensions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"ms-vscode.cpptools",
88
"ms-vscode.cmake-tools",
99
"twxs.cmake",
10+
"mhutchie.git-graph"
1011
],
1112
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1213
"unwantedRecommendations": [

.vscode/launch.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,72 @@
3737
"externalConsole": false,
3838
"preLaunchTask": "Build All - Debug x64 - Demo"
3939
},
40+
{
41+
"name": "dec_avc_file",
42+
"type": "cppdbg",
43+
"request": "launch",
44+
// see: https://code.visualstudio.com/docs/cpp/config-clang-mac
45+
"osx": {
46+
"program": "${workspaceFolder}/bin/x64/dec_avc_file",
47+
"MIMode": "lldb",
48+
},
49+
// see: https://code.visualstudio.com/docs/cpp/config-linux
50+
"linux": {
51+
"program": "${workspaceFolder}/bin/x64/dec_avc_file",
52+
"MIMode": "gdb",
53+
"setupCommands": [
54+
{
55+
"description": "Enable pretty-printing for gdb",
56+
"text": "-enable-pretty-printing",
57+
"ignoreFailures": true
58+
}
59+
],
60+
},
61+
// see: https://code.visualstudio.com/docs/cpp/config-msvc
62+
"windows": {
63+
"type": "cppvsdbg",
64+
"program": "${workspaceFolder}/bin/x64/dec_avc_file.exe",
65+
},
66+
"args": [],
67+
"stopAtEntry": false,
68+
"cwd": "${workspaceFolder}/bin/x64",
69+
"environment": [],
70+
"externalConsole": false,
71+
"preLaunchTask": "Build All - Debug x64 - Demo"
72+
},
73+
{
74+
"name": "enc_aac_adts_file",
75+
"type": "cppdbg",
76+
"request": "launch",
77+
// see: https://code.visualstudio.com/docs/cpp/config-clang-mac
78+
"osx": {
79+
"program": "${workspaceFolder}/bin/x64/enc_aac_adts_file",
80+
"MIMode": "lldb",
81+
},
82+
// see: https://code.visualstudio.com/docs/cpp/config-linux
83+
"linux": {
84+
"program": "${workspaceFolder}/bin/x64/enc_aac_adts_file",
85+
"MIMode": "gdb",
86+
"setupCommands": [
87+
{
88+
"description": "Enable pretty-printing for gdb",
89+
"text": "-enable-pretty-printing",
90+
"ignoreFailures": true
91+
}
92+
],
93+
},
94+
// see: https://code.visualstudio.com/docs/cpp/config-msvc
95+
"windows": {
96+
"type": "cppvsdbg",
97+
"program": "${workspaceFolder}/bin/x64/enc_aac_adts_file.exe",
98+
},
99+
"args": [],
100+
"stopAtEntry": false,
101+
"cwd": "${workspaceFolder}/bin/x64",
102+
"environment": [],
103+
"externalConsole": false,
104+
"preLaunchTask": "Build All - Debug x64 - Demo"
105+
},
40106
{
41107
"name": "enc_avc_file",
42108
"type": "cppdbg",

.vscode/settings.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,29 @@
2222
"ranges": "cpp",
2323
"functional": "cpp",
2424
"iomanip": "cpp",
25-
"iosfwd": "cpp"
25+
"iosfwd": "cpp",
26+
"sstream": "cpp"
27+
},
28+
"editor.tokenColorCustomizations": {
29+
"textMateRules": [
30+
{
31+
"scope": "googletest.failed",
32+
"settings": {
33+
"foreground": "#f00"
34+
}
35+
},
36+
{
37+
"scope": "googletest.passed",
38+
"settings": {
39+
"foreground": "#0f0"
40+
}
41+
},
42+
{
43+
"scope": "googletest.run",
44+
"settings": {
45+
"foreground": "#0f0"
46+
}
47+
}
48+
]
2649
},
2750
}

samples/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,25 @@ string(TOLOWER ${CMAKE_SYSTEM_NAME} OS)
88

99
# add projects, each project should be in its own directory
1010
if (OS STREQUAL "darwin")
11+
add_subdirectory(${OS}/dec_aac_adts_file)
1112
add_subdirectory(${OS}/dec_avc_au)
13+
add_subdirectory(${OS}/dec_avc_file)
14+
add_subdirectory(${OS}/enc_aac_adts_file)
1215
add_subdirectory(${OS}/enc_avc_file)
1316
endif()
1417

1518
if(OS STREQUAL "linux")
19+
add_subdirectory(${OS}/dec_aac_adts_file)
1620
add_subdirectory(${OS}/dec_avc_au)
21+
add_subdirectory(${OS}/dec_avc_file)
22+
add_subdirectory(${OS}/enc_aac_adts_file)
1723
add_subdirectory(${OS}/enc_avc_file)
1824
endif()
1925

2026
if(OS STREQUAL "windows")
27+
add_subdirectory(${OS}/dec_aac_adts_file)
2128
add_subdirectory(${OS}/dec_avc_au)
29+
add_subdirectory(${OS}/dec_avc_file)
30+
add_subdirectory(${OS}/enc_aac_adts_file)
2231
add_subdirectory(${OS}/enc_avc_file)
2332
endif()

samples/darwin/README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,42 @@
22

33
## Decoding
44

5-
### AVC / H.264
5+
### AAC (Advanced Audio Coding)
6+
7+
#### dec_aac_adts_file
8+
9+
Decode AAC file in Audio Data Transport Stream (ADTS) format and save the output to WAV file.
10+
11+
See [dec_aac_adts_file](./dec_aac_adts_file) for details.
12+
13+
### AVC / H.264 (Advance Video Coding)
614

715
#### dec_avc_au
816

9-
Shows how to decode AVC / H.264 stream. The sample uses sequence of files to simulate a stream of H.264 Access Units (AUs) and a Transcoder object to decode the AUs to raw YUV video frames.
17+
Decode AVC / H.264 stream. The sample uses sequence of files to simulate a stream of H.264 Access Units (AUs) and a Transcoder object to decode the AUs to raw YUV video frames.
1018

1119
See [dec_avc_au](./dec_avc_au) for details.
1220

21+
#### dec_avc_file
22+
23+
Decode a compressed AVC / H.264 file to raw uncompressed YUV video file.
24+
25+
See [dec_avc_file](./dec_avc_file) for details.
26+
1327
## Encoding
1428

15-
### AVC / H.264
29+
### AAC (Advanced Audio Coding)
30+
31+
## enc_aac_adts_file
32+
33+
Encode WAV file to AAC file in Audio Data Transport Stream (ADTS) format.
34+
35+
See [enc_aac_adts_file](./enc_aac_adts_file) for details.
36+
37+
### AVC / H.264 (Advance Video Coding)
1638

1739
#### enc_avc_file
1840

19-
Shows how to convert a raw YUV video file to a compressed H.264 video file.
41+
Convert a raw YUV video file to a compressed AVC / H.264 video file.
2042

2143
See [enc_avc_file](./enc_avc_file) for details.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(dec_aac_adts_file)
4+
set (target dec_aac_adts_file)
5+
6+
add_executable(${target})
7+
8+
# Operating System
9+
string(TOLOWER ${CMAKE_SYSTEM_NAME} OS)
10+
11+
# output
12+
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../../../bin/${PLATFORM})
13+
14+
if (CMAKE_GENERATOR STREQUAL "Xcode")
15+
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../../../bin)
16+
endif()
17+
18+
# debug definitions
19+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
20+
target_compile_definitions(${target} PUBLIC _DEBUG)
21+
endif()
22+
23+
# release definitions
24+
if (CMAKE_BUILD_TYPE STREQUAL "Release")
25+
target_compile_definitions(${target} PUBLIC NDEBUG)
26+
endif()
27+
28+
# macOS
29+
if(OS STREQUAL "darwin")
30+
# common compile options
31+
target_compile_options(${target} PRIVATE -std=c++17 -stdlib=libc++)
32+
33+
# x64 compile options
34+
if (PLATFORM STREQUAL "x64")
35+
target_compile_options(${target} PRIVATE -m64 -fPIC)
36+
endif()
37+
38+
# x86 compile options
39+
if (PLATFORM STREQUAL "x86")
40+
target_compile_options(${target} PRIVATE -m32)
41+
endif()
42+
43+
# debug compile options
44+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
45+
target_compile_options(${target} PRIVATE -g)
46+
endif()
47+
48+
# release compile options
49+
if (CMAKE_BUILD_TYPE STREQUAL "Release")
50+
target_compile_options(${target} PRIVATE -Os)
51+
endif()
52+
endif()
53+
54+
# include dirs
55+
target_include_directories(${target}
56+
PUBLIC
57+
../../../sdk/include
58+
)
59+
60+
# sources
61+
file(GLOB source "./*.cpp" "./*.mm")
62+
63+
target_sources(${target}
64+
PRIVATE
65+
${source}
66+
)
67+
68+
# lib dirs
69+
target_link_directories(${target}
70+
PRIVATE
71+
# avblocks
72+
${PROJECT_SOURCE_DIR}/../../../sdk/lib/${PLATFORM}
73+
)
74+
75+
# libs
76+
if (OS STREQUAL "darwin")
77+
target_link_libraries(
78+
${target}
79+
80+
# primo-avblocks
81+
libAVBlocks.dylib
82+
83+
# os
84+
"-framework CoreFoundation"
85+
"-framework AppKit"
86+
)
87+
endif()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## dec_aac_adts_file
2+
3+
Decode AAC file in Audio Data Transport Stream (ADTS) format and save output to WAV file.
4+
5+
### Command Line
6+
7+
```powershell
8+
./dec_aac_adts_file --input <aac file> --output <wav file>
9+
```
10+
11+
### Examples
12+
13+
List options:
14+
15+
```powershell
16+
./bin/x64/dec_aac_adts_file --help
17+
18+
dec_aac_adts_file --input <aac file> --output <wav file>
19+
-h, --help
20+
-i, --input input AAC file
21+
-o, --output output WAV file
22+
```
23+
24+
The following example encode input file `..\assets\aud\Hydrate-Kenny_Beltrey.adts.aac` into output file `Hydrate-Kenny_Beltrey.wav`:
25+
26+
```powershell
27+
mkdir -p ./output/dec_aac_adts_file
28+
29+
./bin/x64/dec_aac_adts_file \
30+
--input ./assets/aud/Hydrate-Kenny_Beltrey.adts.aac \
31+
--output ./output/dec_aac_adts_file/Hydrate-Kenny_Beltrey.wav
32+
```
33+

0 commit comments

Comments
 (0)