From f1e978b58d1e7e1e146d549a534b6b87bb05f76c Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 30 Oct 2024 11:34:46 +0100 Subject: [PATCH] Remove avresample The crate never supported any wrappers for it and FFmpeg 5.0 dropped it anyways. --- Cargo.toml | 1 - ffmpeg-sys-the-third/Cargo.toml | 1 - ffmpeg-sys-the-third/build.rs | 13 +------------ 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e82c0d4..3aa1cc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,6 @@ codec = ["ffmpeg-sys-the-third/avcodec"] device = ["ffmpeg-sys-the-third/avdevice", "format"] filter = ["ffmpeg-sys-the-third/avfilter"] format = ["ffmpeg-sys-the-third/avformat", "codec"] -resampling = ["ffmpeg-sys-the-third/avresample"] postprocessing = ["ffmpeg-sys-the-third/postproc"] software-resampling = ["ffmpeg-sys-the-third/swresample"] software-scaling = ["ffmpeg-sys-the-third/swscale", "codec"] diff --git a/ffmpeg-sys-the-third/Cargo.toml b/ffmpeg-sys-the-third/Cargo.toml index 5f5051a..cd96d8c 100644 --- a/ffmpeg-sys-the-third/Cargo.toml +++ b/ffmpeg-sys-the-third/Cargo.toml @@ -58,7 +58,6 @@ avcodec = [] avdevice = ["avformat"] avfilter = [] avformat = ["avcodec"] -avresample = [] postproc = [] swresample = [] swscale = [] diff --git a/ffmpeg-sys-the-third/build.rs b/ffmpeg-sys-the-third/build.rs index ea45941..2c8af45 100644 --- a/ffmpeg-sys-the-third/build.rs +++ b/ffmpeg-sys-the-third/build.rs @@ -66,7 +66,6 @@ static LIBRARIES: &[Library] = &[ Library::optional("avformat", AVFORMAT_FEATURES, AVFORMAT_HEADERS), Library::optional("avdevice", AVDEVICE_FEATURES, AVDEVICE_HEADERS), Library::optional("avfilter", AVFILTER_FEATURES, AVFILTER_HEADERS), - Library::optional("avresample", AVRESAMPLE_FEATURES, AVRESAMPLE_HEADERS), Library::optional("swscale", SWSCALE_FEATURES, SWSCALE_HEADERS), Library::optional("swresample", SWRESAMPLE_FEATURES, SWRESAMPLE_HEADERS), Library::optional("postproc", POSTPROC_FEATURES, POSTPROC_HEADERS), @@ -216,8 +215,6 @@ static AVFILTER_FEATURES: &[AVFeature] = &[ AVFeature::new("LINK_PUBLIC"), ]; -static AVRESAMPLE_FEATURES: &[AVFeature] = &[]; - static SWSCALE_FEATURES: &[AVFeature] = &[]; static SWRESAMPLE_FEATURES: &[AVFeature] = &[]; @@ -302,7 +299,6 @@ static AVFILTER_HEADERS: &[AVHeader] = &[ AVHeader::new("buffersrc.h"), AVHeader::new("avfilter.h"), ]; -static AVRESAMPLE_HEADERS: &[AVHeader] = &[AVHeader::new("avresample.h")]; static SWSCALE_HEADERS: &[AVHeader] = &[AVHeader::new("swscale.h")]; static SWRESAMPLE_HEADERS: &[AVHeader] = &[AVHeader::new("swresample.h")]; static POSTPROC_HEADERS: &[AVHeader] = &[AVHeader::new("postprocess.h")]; @@ -562,14 +558,8 @@ fn build(out_dir: &Path, ffmpeg_version: &str) -> io::Result { // the binary using ffmpeg-sys cannot be redistributed configure.switch("BUILD_LICENSE_NONFREE", "nonfree"); - let ffmpeg_major_version: u32 = get_major_version(ffmpeg_version); - // configure building libraries based on features - for lib in LIBRARIES - .iter() - .filter(|lib| lib.optional) - .filter(|lib| !(lib.name == "avresample" && ffmpeg_major_version >= 5)) - { + for lib in LIBRARIES.iter().filter(|lib| lib.optional) { configure.switch(&lib.name.to_uppercase(), lib.name); } @@ -971,7 +961,6 @@ fn main() { .allowlist_file(r#".*[/\\]libavformat[/\\].*"#) .allowlist_file(r#".*[/\\]libavdevice[/\\].*"#) .allowlist_file(r#".*[/\\]libavfilter[/\\].*"#) - .allowlist_file(r#".*[/\\]libavresample[/\\].*"#) .allowlist_file(r#".*[/\\]libswscale[/\\].*"#) .allowlist_file(r#".*[/\\]libswresample[/\\].*"#) .allowlist_file(r#".*[/\\]libpostproc[/\\].*"#)