Skip to content

Commit

Permalink
Merge pull request #65 from Polochon-street/polochon/ffmpeg6.1
Browse files Browse the repository at this point in the history
Initial support for ffmpeg 6.1
  • Loading branch information
Polochon-street authored Dec 3, 2023
2 parents 7f09111 + 65e294a commit 86e6da6
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,39 @@ jobs:
- name: Check format
run: |
cargo fmt -- --check
# Added only because there is no ffmpeg6.1 docker image here yet
# https://github.com/jrottenberg/ffmpeg
build-test-lint-latest:
name: FFmpeg Latest - build, test and lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
FEATURES: avcodec,avdevice,avfilter,avformat,postproc,swresample,swscale
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg6
sudo apt update
sudo apt install -y --no-install-recommends clang curl pkg-config ffmpeg libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavfilter-dev libavdevice-dev libswresample-dev
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Build
run: |
cargo build --features $FEATURES
- name: Test
run: |
cargo test --features $FEATURES
- name: Lint
run: |
cargo clippy --features $FEATURES -- -D warnings
- name: Check format
run: |
cargo fmt -- --check
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ffmpeg-sys-next"
version = "6.0.1"
version = "6.1.0"
build = "build.rs"
links = "ffmpeg"

Expand Down
5 changes: 3 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ fn check_features(
("ffmpeg_5_0", 59, 18),
("ffmpeg_5_1", 59, 37),
("ffmpeg_6_0", 60, 3),
("ffmpeg_6_1", 60, 31),
];
for &(ffmpeg_version_flag, lavc_version_major, lavc_version_minor) in
ffmpeg_lavc_versions.iter()
Expand Down Expand Up @@ -650,8 +651,8 @@ fn main() {
search().join("lib").to_string_lossy()
);
link_to_libraries(statik);
if fs::metadata(&search().join("lib").join("libavutil.a")).is_err() {
fs::create_dir_all(&output()).expect("failed to create build directory");
if fs::metadata(search().join("lib").join("libavutil.a")).is_err() {
fs::create_dir_all(output()).expect("failed to create build directory");
fetch().unwrap();
build().unwrap();
}
Expand Down
21 changes: 21 additions & 0 deletions channel_layout_fixed.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,24 @@ const unsigned long long AV_CH_LAYOUT_22POINT2 =
AV_CH_TOP_SIDE_RIGHT | AV_CH_TOP_BACK_CENTER | AV_CH_BOTTOM_FRONT_CENTER |
AV_CH_BOTTOM_FRONT_LEFT | AV_CH_BOTTOM_FRONT_RIGHT);
#endif

#if (LIBAVUTIL_VERSION_MAJOR >= 58 && LIBAVUTIL_VERSION_MINOR >= 29)

#undef AV_CH_LAYOUT_3POINT1POINT2
#undef AV_CH_LAYOUT_5POINT1POINT2_BACK
#undef AV_CH_LAYOUT_5POINT1POINT4_BACK
#undef AV_CH_LAYOUT_7POINT1POINT2
#undef AV_CH_LAYOUT_7POINT1POINT4_BACK

const unsigned long long AV_CH_LAYOUT_3POINT1POINT2 =
(AV_CH_LAYOUT_3POINT1 | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT);
const unsigned long long AV_CH_LAYOUT_5POINT1POINT2_BACK =
(AV_CH_LAYOUT_5POINT1_BACK | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT);
const unsigned long long AV_CH_LAYOUT_5POINT1POINT4_BACK =
(AV_CH_LAYOUT_5POINT1POINT2_BACK | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT);
const unsigned long long AV_CH_LAYOUT_7POINT1POINT2 =
(AV_CH_LAYOUT_7POINT1 | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT);
const unsigned long long AV_CH_LAYOUT_7POINT1POINT4_BACK =
(AV_CH_LAYOUT_7POINT1POINT2 | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT);

#endif

0 comments on commit 86e6da6

Please sign in to comment.