Skip to content

Commit 2cfd343

Browse files
Merge pull request #15 from ChristianFeldmann/version/8
Version/8
2 parents c270331 + d6fe9d7 commit 2cfd343

45 files changed

Lines changed: 1104 additions & 116 deletions

Some content is hidden

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

.github/workflows/BuildAndTest.yml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ jobs:
1010
build:
1111
strategy:
1212
matrix:
13-
config: [ {os: windows-latest, copyCommand: copy, artifactName: integrationTestWindows, buildPath: Release/, dummyLib: dummyLib.dll, integrationTest: integrationTest.exe},
14-
{os: ubuntu-latest, copyCommand: cp, artifactName: integrationTestUbuntu, buildPath: , dummyLib: libdummyLib.so, integrationTest: integrationTest},
15-
{os: macos-13, copyCommand: cp, artifactName: integrationTestMacIntel, buildPath: , dummyLib: libdummyLib.dylib, integrationTest: integrationTest},
16-
{os: macos-14, copyCommand: cp, artifactName: integrationTestMacM1, buildPath: , dummyLib: libdummyLib.dylib, integrationTest: integrationTest} ]
13+
config: [ {os: windows-2025, copyCommand: copy, artifactName: integrationTestWindows, buildPath: Release/, dummyLib: dummyLib.dll, integrationTest: integrationTest.exe},
14+
{os: windows-11-arm, copyCommand: copy, artifactName: integrationTestWindowsArm, buildPath: Release/, dummyLib: dummyLib.dll, integrationTest: integrationTest.exe},
15+
{os: ubuntu-24.04, copyCommand: cp, artifactName: integrationTestUbuntu, buildPath: , dummyLib: libdummyLib.so, integrationTest: integrationTest},
16+
{os: ubuntu-24.04-arm, copyCommand: cp, artifactName: integrationTestUbuntuArm, buildPath: , dummyLib: libdummyLib.so, integrationTest: integrationTest},
17+
{os: macos-15, copyCommand: cp, artifactName: integrationTestMacArm, buildPath: , dummyLib: libdummyLib.dylib, integrationTest: integrationTest},
18+
{os: macos-15-intel, copyCommand: cp, artifactName: integrationTestMacIntel, buildPath: , dummyLib: libdummyLib.dylib, integrationTest: integrationTest} ]
1719
runs-on: ${{ matrix.config.os }}
1820

1921
steps:
@@ -40,25 +42,35 @@ jobs:
4042
needs: build
4143
strategy:
4244
matrix:
43-
config: [ {os: windows-latest, artifactName: integrationTestWindows, azureFolder: windows, unzipCommand: 7z x },
44-
{os: ubuntu-latest, artifactName: integrationTestUbuntu, azureFolder: ubuntu-22.04, unzipCommand: unzip },
45-
{os: macos-13, artifactName: integrationTestMacIntel, azureFolder: macos-intel, unzipCommand: unzip },
46-
{os: macos-14, artifactName: integrationTestMacM1, azureFolder: macos-m1, unzipCommand: unzip } ]
47-
ffmpegVersions: ["2.8.22", "3.4.13", "4.4.4", "5.1.4", "6.1.1", "7.0"]
45+
config: [ {os: windows-2025, artifactName: integrationTestWindows, unzipCommand: 7z x },
46+
{os: windows-11-arm, artifactName: integrationTestWindowsArm, unzipCommand: 7z x },
47+
{os: ubuntu-24.04, artifactName: integrationTestUbuntu, unzipCommand: unzip },
48+
{os: ubuntu-24.04-arm, artifactName: integrationTestUbuntuArm, unzipCommand: unzip },
49+
{os: macos-15, artifactName: integrationTestMacArm, unzipCommand: unzip },
50+
{os: macos-15-intel, artifactName: integrationTestMacIntel, unzipCommand: unzip } ]
51+
ffmpegVersions: ["2.8.22", "3.4.14", "4.4.6", "5.1.8", "6.1.4", "7.0.3", "8.0.1"]
52+
exclude:
53+
# I did not manage to compile the older ffmpeg versions an windows ARM
54+
# Let me know if you manage to do so.
55+
- ffmpegVersions: "2.8.22"
56+
config: {os: windows-11-arm, artifactName: integrationTestWindowsArm, unzipCommand: 7z x }
57+
- ffmpegVersions: "3.4.14"
58+
config: {os: windows-11-arm, artifactName: integrationTestWindowsArm, unzipCommand: 7z x }
4859
runs-on: ${{ matrix.config.os }}
60+
continue-on-error: true
4961
steps:
5062
- uses: actions/download-artifact@master
5163
with:
5264
name: ${{ matrix.config.artifactName }}
5365

5466
- name: Make integrationTest executable
5567
run: chmod a+x integrationTest
56-
if: ${{ matrix.config.os }} != windows-latest
68+
if: runner.os == 'Linux' || runner.os == 'macOS'
5769

5870
- name: Download FFmpeg
5971
run: |
60-
curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}ffmpeg/${{ matrix.config.azureFolder }}/ffmpeg-${{ matrix.ffmpegVersions }}.zip${{ secrets.AZURE_BLOB_TOKEN }}" -o ffmpeg.zip
61-
curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}bitstream-testfiles/TestFile_h264_aac_1s_320x240.mp4${{ secrets.AZURE_BLOB_TOKEN }}" -o TestFile_h264_aac_1s_320x240.mp4
72+
curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}ffmpeg/github/ffmpeg-${{ matrix.ffmpegVersions }}-${{ matrix.config.os }}.zip?${{ secrets.AZURE_BLOB_TOKEN }}" -o ffmpeg.zip
73+
curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}bitstream-testfiles/TestFile_h264_aac_1s_320x240.mp4?${{ secrets.AZURE_BLOB_TOKEN }}" -o TestFile_h264_aac_1s_320x240.mp4
6274
${{ matrix.config.unzipCommand }} ffmpeg.zip
6375
rm ffmpeg.zip
6476
@@ -69,11 +81,13 @@ jobs:
6981
needs: build
7082
strategy:
7183
matrix:
72-
config: [ {os: windows-latest, artifactName: integrationTestWindows},
73-
{os: ubuntu-latest, artifactName: integrationTestUbuntu},
74-
{os: macos-13, artifactName: integrationTestMacIntel},
75-
{os: macos-14, artifactName: integrationTestMacM1} ]
84+
config: [ {os: windows-2025, artifactName: integrationTestWindows},
85+
{os: ubuntu-24.04, artifactName: integrationTestUbuntu},
86+
{os: ubuntu-24.04-arm, artifactName: integrationTestUbuntuArm},
87+
{os: macos-15, artifactName: integrationTestMacArm},
88+
{os: macos-15-intel, artifactName: integrationTestMacIntel} ]
7689
runs-on: ${{ matrix.config.os }}
90+
continue-on-error: true
7791
steps:
7892
- uses: actions/download-artifact@master
7993
with:
@@ -87,14 +101,14 @@ jobs:
87101

88102
- name: Make integrationTest executable
89103
run: chmod a+x integrationTest
90-
if: matrix.config.os != 'windows-latest'
104+
if: runner.os == 'Linux' || runner.os == 'macOS'
91105

92106
- name: Add ffmpeg to path
93-
run: echo "C:\ProgramData\chocolatey\lib\ffmpeg-shared\tools\ffmpeg-7.0.2-full_build-shared\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
94-
if: matrix.config.os == 'windows-latest'
107+
run: echo "C:\ProgramData\chocolatey\lib\ffmpeg-shared\tools\ffmpeg-8.0.1-full_build-shared\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
108+
if: runner.os == 'Windows'
95109

96110
- name: Download Test files
97-
run: curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}bitstream-testfiles/TestFile_h264_aac_1s_320x240.mp4${{ secrets.AZURE_BLOB_TOKEN }}" -o TestFile_h264_aac_1s_320x240.mp4
111+
run: curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}bitstream-testfiles/TestFile_h264_aac_1s_320x240.mp4?${{ secrets.AZURE_BLOB_TOKEN }}" -o TestFile_h264_aac_1s_320x240.mp4
98112

99113
- name: Run integration tests
100114
run: ./integrationTest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vscode
2+
.cache
23
build
34
buildFFmpeg
45
*.mp4

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(NOT CMAKE_BUILD_TYPE)
55
endif()
66
message(STATUS "Build type " ${CMAKE_BUILD_TYPE})
77

8-
set(CMAKE_CXX_STANDARD 17)
8+
set(CMAKE_CXX_STANDARD 20)
99
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
1010

1111
project(LibFFmpeg++)

src/lib/AVCodec/Channel.h

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/* Copyright (c) 2023 Christian Feldmann [christian.feldmann@gmx.de].
2+
* All rights reserved.
3+
* This work is licensed under the terms of the MIT license.
4+
* For a copy, see <https://opensource.org/licenses/MIT>.
5+
*/
6+
7+
#pragma once
8+
9+
#include "common/EnumMapper.h"
10+
11+
#include <ostream>
12+
13+
namespace libffmpeg::avcodec
14+
{
15+
16+
enum class Channel
17+
{
18+
Unused,
19+
FrontLeft,
20+
FrontRight,
21+
FrontCenter,
22+
LowFrequency,
23+
BackLeft,
24+
BackRight,
25+
FrontLeftOfCenter,
26+
FrontRightOfCenter,
27+
BackCenter,
28+
SideLeft,
29+
SideRight,
30+
TopCenter,
31+
TopFrontLeft,
32+
TopFrontCenter,
33+
TopFrontRight,
34+
TopBackLeft,
35+
TopBackCenter,
36+
TopBackRight,
37+
StereoLeft,
38+
StereoRight,
39+
WideLeft,
40+
WideRight,
41+
SurroundDirectLeft,
42+
SurroundDirectRight,
43+
LowFrequency2,
44+
TopSideLeft,
45+
TopSideRight,
46+
BottomFrontCenter,
47+
BottomFrontLeft,
48+
BottomFrontRight,
49+
SideSurroundLeft,
50+
SideSurroundRight,
51+
TopSurroundLeft,
52+
TopSurroundRight,
53+
BinauralLeft,
54+
BinauralRight,
55+
Ambisonic
56+
};
57+
58+
const EnumMapper<Channel>
59+
channelMapper({{Channel::FrontLeft, "FL", "Front Left"},
60+
{Channel::FrontRight, "FR", "Front Right"},
61+
{Channel::FrontCenter, "FC", "Front Center"},
62+
{Channel::LowFrequency, "LFE", "Low Frequency"},
63+
{Channel::BackLeft, "BL", "Back Left"},
64+
{Channel::BackRight, "BR", "Back Right"},
65+
{Channel::FrontLeftOfCenter, "FLC", "Front Left of Center"},
66+
{Channel::FrontRightOfCenter, "FRC", "Front Right of Center"},
67+
{Channel::BackCenter, "BC", "Back Center"},
68+
{Channel::SideLeft, "SL", "Side Left"},
69+
{Channel::SideRight, "SR", "Side Right"},
70+
{Channel::TopCenter, "TC", "Top Center"},
71+
{Channel::TopFrontLeft, "TFL", "Top Front Left"},
72+
{Channel::TopFrontCenter, "TFC", "Top Front Center"},
73+
{Channel::TopFrontRight, "TFR", "Top Front Right"},
74+
{Channel::TopBackLeft, "TBL", "Top Back Left"},
75+
{Channel::TopBackCenter, "TBC", "Top Back Center"},
76+
{Channel::TopBackRight, "TBR", "Top Back Right"},
77+
{Channel::StereoLeft, "SLT", "Stereo Left"},
78+
{Channel::StereoRight, "SRT", "Stereo Right"},
79+
{Channel::WideLeft, "WL", "Wide Left"},
80+
{Channel::WideRight, "WR", "Wide Right"},
81+
{Channel::SurroundDirectLeft, "SDL", "Surround Direct Left"},
82+
{Channel::SurroundDirectRight, "SDR", "Surround Direct Right"},
83+
{Channel::LowFrequency2, "LFE2", "Low Frequency 2"},
84+
{Channel::TopSideLeft, "TSL", "Top Side Left"},
85+
{Channel::TopSideRight, "TSR", "Top Side Right"},
86+
{Channel::BottomFrontCenter, "BFC", "Bottom Front Center"},
87+
{Channel::BottomFrontLeft, "BFL", "Bottom Front Left"},
88+
{Channel::BottomFrontRight, "BFR", "Bottom Front Right"},
89+
{Channel::SideSurroundLeft, "SSL", "Side Surround Left"},
90+
{Channel::SideSurroundRight, "SSR", "Side Surround Right"},
91+
{Channel::TopSurroundLeft, "TSL", "Top Surround Left"},
92+
{Channel::TopSurroundRight, "TSR", "Top Surround Right"},
93+
{Channel::BinauralLeft, "BL", "Binaural Left"},
94+
{Channel::BinauralRight, "BR", "Binaural Right"},
95+
{Channel::Ambisonic, "AMB", "Ambisonic"}});
96+
97+
struct ChannelInfo
98+
{
99+
std::optional<Channel> channel;
100+
std::optional<int> ambisonicIndex;
101+
std::string name;
102+
103+
bool operator==(const ChannelInfo &other) const
104+
{
105+
return this->channel == other.channel && this->ambisonicIndex == other.ambisonicIndex &&
106+
this->name == other.name;
107+
}
108+
109+
friend std::ostream &operator<<(std::ostream &stream, const ChannelInfo &channelInfo)
110+
{
111+
stream << "{ Channel "
112+
<< (channelInfo.channel ? channelMapper.getName(*channelInfo.channel) : "nullopt")
113+
<< ", ambisonicIndex: "
114+
<< (channelInfo.ambisonicIndex ? std::to_string(*channelInfo.ambisonicIndex) : "nullopt")
115+
<< ", name: \"" << channelInfo.name << "\"}";
116+
return stream;
117+
}
118+
};
119+
120+
using ChannelLayout = std::vector<ChannelInfo>;
121+
122+
} // namespace libffmpeg::avcodec

0 commit comments

Comments
 (0)