Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ffmpeg 6.0 support #50

Merged
merged 7 commits into from
Mar 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ffmpeg-sys-next"
version = "5.1.1"
version = "6.0.0"
build = "build.rs"
links = "ffmpeg"

Expand All @@ -19,10 +19,10 @@ doctest = false
libc = "0.2"

[build-dependencies]
num_cpus = "1.11"
num_cpus = "1.15"
cc = "1.0"
pkg-config = "0.3"
bindgen = { version = "0.59", default-features = false, features = ["runtime"] }
bindgen = { version = "0.64", default-features = false, features = ["runtime"] }

[target.'cfg(target_env = "msvc")'.build-dependencies]
vcpkg = "0.2"
Expand Down
12 changes: 5 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ fn check_features(
);
}

let version_check_info = [("avcodec", 56, 60, 0, 108)];
let version_check_info = [("avcodec", 56, 61, 0, 108)];
for &(lib, begin_version_major, end_version_major, begin_version_minor, end_version_minor) in
version_check_info.iter()
{
Expand Down Expand Up @@ -587,6 +587,7 @@ fn check_features(
("ffmpeg_4_4", 58, 100),
("ffmpeg_5_0", 59, 18),
("ffmpeg_5_1", 59, 37),
("ffmpeg_6_0", 60, 4),
];
for &(ffmpeg_version_flag, lavc_version_major, lavc_version_minor) in
ffmpeg_lavc_versions.iter()
Expand Down Expand Up @@ -1164,17 +1165,14 @@ fn main() {
.blocklist_function("y1l")
.blocklist_function("ynl")
.opaque_type("__mingw_ldbl_type_t")
.default_enum_style(bindgen::EnumVariation::Rust {
non_exhaustive: env::var("CARGO_FEATURE_NON_EXHAUSTIVE_ENUMS").is_ok(),
})
.prepend_enum_name(false)
.derive_eq(true)
.size_t_is_usize(true)
.parse_callbacks(Box::new(Callbacks));

if env::var("CARGO_FEATURE_NON_EXHAUSTIVE_ENUMS").is_ok() {
builder = builder.rustified_non_exhaustive_enum("*");
} else {
builder = builder.rustified_enum("*");
}

// The input headers we would like to generate
// bindings for.
if env::var("CARGO_FEATURE_AVCODEC").is_ok() {
Expand Down
2 changes: 1 addition & 1 deletion channel_layout_fixed.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://github.com/rust-lang/rust-bindgen/issues/258 is fixed.
#include <libavutil/channel_layout.h>

#if LIBAVUTIL_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MINOR >= 28
#if (LIBAVUTIL_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MINOR >= 28) || LIBAVUTIL_VERSION_MAJOR >= 58

#undef AV_CH_FRONT_LEFT
#undef AV_CH_FRONT_RIGHT
Expand Down