From fd44dd339be4971c0e32787b42514883ca934997 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 10 Oct 2024 20:54:16 +0200 Subject: [PATCH] Drop support for FFmpeg < 4.2 Check https://ffmpeg.org/download.html#releases and https://trac.ffmpeg.org/wiki/Downstreams to see the FFmpeg versions that are considered supported or EOL. --- .github/workflows/build.yml | 2 +- ffmpeg-sys-the-third/README.md | 23 ++++++------- ffmpeg-sys-the-third/build.rs | 13 +++---- src/codec/capabilities.rs | 2 -- src/codec/debug.rs | 8 ----- src/codec/id.rs | 63 ---------------------------------- src/codec/packet/packet.rs | 5 --- src/codec/packet/side_data.rs | 9 ----- src/format/format/flag.rs | 2 -- src/format/format/mod.rs | 4 --- src/util/format/pixel.rs | 54 ++--------------------------- src/util/frame/side_data.rs | 21 ++++-------- 12 files changed, 24 insertions(+), 182 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a7b376..4b5a45e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: strategy: matrix: ffmpeg_version: - ["3.4", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "6.0", "6.1", "7.0"] + ["4.2", "4.3", "4.4", "5.0", "5.1", "6.0", "6.1", "7.0"] fail-fast: false steps: diff --git a/ffmpeg-sys-the-third/README.md b/ffmpeg-sys-the-third/README.md index 35b7b1c..fd89755 100644 --- a/ffmpeg-sys-the-third/README.md +++ b/ffmpeg-sys-the-third/README.md @@ -5,26 +5,23 @@ This is a fork of the abandoned [ffmpeg-sys](https://github.com/meh/rust-ffmpeg- This crate contains low level bindings to FFmpeg. You're probably interested in the high level bindings instead: [ffmpeg-next](https://github.com/shssoichiro/ffmpeg-the-third). -A word on versioning: major and minor versions track major and minor versions of FFmpeg, e.g. 4.2.x of this crate has been updated to support the 4.2.x series of FFmpeg. Patch level is reserved for bug fixes of this crate and does not track FFmpeg patch versions. +A word on versioning: The crate version includes the **maximum supported** FFmpeg version for each release. E.g. `ffmpeg-sys-the-third@2.0.0+ffmpeg-7.0` supports *up to* FFmpeg 7.0. The minimum supported FFmpeg version at the moment is 4.2. ## Feature flags In addition to feature flags declared in `Cargo.toml`, this crate performs various compile-time version and feature detections and exposes the results in additional flags. These flags are briefly documented below; run `cargo build -vv` to view more details. -- `ffmpeg__` flags (new in v4.3.2), e.g. `ffmpeg_4_4`, indicating the FFmpeg installation being compiled against is at least version `.`. Currently available: +- `ffmpeg__` flags, e.g. `ffmpeg_4_4`, indicating the FFmpeg installation being compiled against is at least version `.`. Currently available: - - `ffmpeg_3_0` - - `ffmpeg_3_1` - - `ffmpeg_3_2` - - `ffmpeg_3_3` - - `ffmpeg_3_1` - - `ffmpeg_4_0` - - `ffmpeg_4_1` - - `ffmpeg_4_2` - - `ffmpeg_4_3` - - `ffmpeg_4_4` + - "ffmpeg_4_3" + - "ffmpeg_4_4" + - "ffmpeg_5_0" + - "ffmpeg_5_1" + - "ffmpeg_6_0" + - "ffmpeg_6_1" + - "ffmpeg_7_0" -- `avcodec_version_greater_than__` (new in v4.3.2), e.g., `avcodec_version_greater_than_58_90`. The name should be self-explanatory. +- `avcodec_version_greater_than__`, e.g., `avcodec_version_greater_than_58_90`. The name should be self-explanatory. - `ff_api_`, e.g. `ff_api_vaapi`, corresponding to whether their respective uppercase deprecation guards evaluate to true. diff --git a/ffmpeg-sys-the-third/build.rs b/ffmpeg-sys-the-third/build.rs index 7c8e35c..f6a95e9 100644 --- a/ffmpeg-sys-the-third/build.rs +++ b/ffmpeg-sys-the-third/build.rs @@ -807,7 +807,7 @@ fn check_features(include_paths: &[PathBuf]) { } } - let version_check_info = [("avcodec", 56, 62, 0, 108)]; + let version_check_info = [("avcodec", 57, 62, 0, 101)]; for &(lib, begin_version_major, end_version_major, begin_version_minor, end_version_minor) in &version_check_info { @@ -830,14 +830,6 @@ fn check_features(include_paths: &[PathBuf]) { } let ffmpeg_lavc_versions = [ - ("ffmpeg_3_0", 57, 24), - ("ffmpeg_3_1", 57, 48), - ("ffmpeg_3_2", 57, 64), - ("ffmpeg_3_3", 57, 89), - ("ffmpeg_3_1", 57, 107), - ("ffmpeg_4_0", 58, 18), - ("ffmpeg_4_1", 58, 35), - ("ffmpeg_4_2", 58, 54), ("ffmpeg_4_3", 58, 91), ("ffmpeg_4_4", 58, 100), ("ffmpeg_5_0", 59, 18), @@ -851,6 +843,9 @@ fn check_features(include_paths: &[PathBuf]) { .get("avcodec") .expect("Unable to find the version for lib{lib}"); + // This allows removing a lot of #[cfg] attributes. + assert!(lavc_version >= (58, 54), "FFmpeg 4.2 or higher is required, but found avcodec version {lavc_version:?}"); + for &(ffmpeg_version_flag, lavc_version_major, lavc_version_minor) in &ffmpeg_lavc_versions { // Every possible feature needs an unconditional check-cfg to prevent warnings println!( diff --git a/src/codec/capabilities.rs b/src/codec/capabilities.rs index 946c35b..49d9898 100644 --- a/src/codec/capabilities.rs +++ b/src/codec/capabilities.rs @@ -10,8 +10,6 @@ bitflags! { const TRUNCATED = AV_CODEC_CAP_TRUNCATED; const DELAY = AV_CODEC_CAP_DELAY; const SMALL_LAST_FRAME = AV_CODEC_CAP_SMALL_LAST_FRAME; - #[cfg(not(feature = "ffmpeg_4_0"))] - const HWACCEL_VDPAU = AV_CODEC_CAP_HWACCEL_VDPAU; const SUBFRAMES = AV_CODEC_CAP_SUBFRAMES; const EXPERIMENTAL = AV_CODEC_CAP_EXPERIMENTAL; const CHANNEL_CONF = AV_CODEC_CAP_CHANNEL_CONF; diff --git a/src/codec/debug.rs b/src/codec/debug.rs index 52132a6..bcb4b51 100644 --- a/src/codec/debug.rs +++ b/src/codec/debug.rs @@ -8,20 +8,12 @@ bitflags! { const BITSTREAM = FF_DEBUG_BITSTREAM; const MB_TYPE = FF_DEBUG_MB_TYPE; const QP = FF_DEBUG_QP; - #[cfg(not(feature = "ffmpeg_4_0"))] - const MV = FF_DEBUG_MV; const DCT_COEFF = FF_DEBUG_DCT_COEFF; const SKIP = FF_DEBUG_SKIP; const STARTCODE = FF_DEBUG_STARTCODE; - #[cfg(not(feature = "ffmpeg_4_0"))] - const PTS = FF_DEBUG_PTS; const ER = FF_DEBUG_ER; const MMCO = FF_DEBUG_MMCO; const BUGS = FF_DEBUG_BUGS; - #[cfg(not(feature = "ffmpeg_4_0"))] - const VIS_QP = FF_DEBUG_VIS_QP; - #[cfg(not(feature = "ffmpeg_4_0"))] - const VIS_MB_TYPE = FF_DEBUG_VIS_MB_TYPE; const BUFFERS = FF_DEBUG_BUFFERS; const THREADS = FF_DEBUG_THREADS; const NOMC = FF_DEBUG_NOMC; diff --git a/src/codec/id.rs b/src/codec/id.rs index 3a16619..a4642c8 100644 --- a/src/codec/id.rs +++ b/src/codec/id.rs @@ -401,7 +401,6 @@ pub enum Id { ON2AVC, DSS_SP, - #[cfg(feature = "ffmpeg_4_0")] CODEC2, FFWAVESYNTH, SONIC, @@ -487,47 +486,27 @@ pub enum Id { GREMLIN_DPCM, DOLBY_E, - #[cfg(feature = "ffmpeg_4_0")] APTX, - #[cfg(feature = "ffmpeg_4_0")] APTX_HD, - #[cfg(feature = "ffmpeg_4_0")] SBC, - #[cfg(feature = "ffmpeg_4_1")] AVS2, - #[cfg(feature = "ffmpeg_4_1")] IMM4, - #[cfg(feature = "ffmpeg_4_1")] PROSUMER, - #[cfg(feature = "ffmpeg_4_1")] MWSC, - #[cfg(feature = "ffmpeg_4_1")] WCMV, - #[cfg(feature = "ffmpeg_4_1")] RASC, - #[cfg(feature = "ffmpeg_4_1")] PCM_VIDC, - #[cfg(feature = "ffmpeg_4_1")] ATRAC9, - #[cfg(feature = "ffmpeg_4_1")] TTML, - #[cfg(feature = "ffmpeg_4_2")] HYMT, - #[cfg(feature = "ffmpeg_4_2")] ARBC, - #[cfg(feature = "ffmpeg_4_2")] AGM, - #[cfg(feature = "ffmpeg_4_2")] LSCR, - #[cfg(feature = "ffmpeg_4_2")] VP4, - #[cfg(feature = "ffmpeg_4_2")] ADPCM_AGM, - #[cfg(feature = "ffmpeg_4_2")] HCOM, - #[cfg(feature = "ffmpeg_4_2")] ARIB_CAPTION, #[cfg(feature = "ffmpeg_4_3")] @@ -1073,7 +1052,6 @@ impl From for Id { AV_CODEC_ID_ON2AVC => Id::ON2AVC, AV_CODEC_ID_DSS_SP => Id::DSS_SP, - #[cfg(feature = "ffmpeg_4_0")] AV_CODEC_ID_CODEC2 => Id::CODEC2, AV_CODEC_ID_FFWAVESYNTH => Id::FFWAVESYNTH, AV_CODEC_ID_SONIC => Id::SONIC, @@ -1158,47 +1136,27 @@ impl From for Id { AV_CODEC_ID_GREMLIN_DPCM => Id::GREMLIN_DPCM, AV_CODEC_ID_DOLBY_E => Id::DOLBY_E, - #[cfg(feature = "ffmpeg_4_0")] AV_CODEC_ID_APTX => Id::APTX, - #[cfg(feature = "ffmpeg_4_0")] AV_CODEC_ID_APTX_HD => Id::APTX_HD, - #[cfg(feature = "ffmpeg_4_0")] AV_CODEC_ID_SBC => Id::SBC, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_AVS2 => Id::AVS2, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_IMM4 => Id::IMM4, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_PROSUMER => Id::PROSUMER, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_MWSC => Id::MWSC, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_WCMV => Id::WCMV, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_RASC => Id::RASC, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_PCM_VIDC => Id::PCM_VIDC, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_ATRAC9 => Id::ATRAC9, - #[cfg(feature = "ffmpeg_4_1")] AV_CODEC_ID_TTML => Id::TTML, - #[cfg(feature = "ffmpeg_4_2")] AV_CODEC_ID_HYMT => Id::HYMT, - #[cfg(feature = "ffmpeg_4_2")] AV_CODEC_ID_ARBC => Id::ARBC, - #[cfg(feature = "ffmpeg_4_2")] AV_CODEC_ID_AGM => Id::AGM, - #[cfg(feature = "ffmpeg_4_2")] AV_CODEC_ID_LSCR => Id::LSCR, - #[cfg(feature = "ffmpeg_4_2")] AV_CODEC_ID_VP4 => Id::VP4, - #[cfg(feature = "ffmpeg_4_2")] AV_CODEC_ID_ADPCM_AGM => Id::ADPCM_AGM, - #[cfg(feature = "ffmpeg_4_2")] AV_CODEC_ID_HCOM => Id::HCOM, - #[cfg(feature = "ffmpeg_4_2")] AV_CODEC_ID_ARIB_CAPTION => Id::ARIB_CAPTION, #[cfg(feature = "ffmpeg_4_3")] @@ -1738,7 +1696,6 @@ impl From for AVCodecID { Id::ON2AVC => AV_CODEC_ID_ON2AVC, Id::DSS_SP => AV_CODEC_ID_DSS_SP, - #[cfg(feature = "ffmpeg_4_0")] Id::CODEC2 => AV_CODEC_ID_CODEC2, Id::FFWAVESYNTH => AV_CODEC_ID_FFWAVESYNTH, Id::SONIC => AV_CODEC_ID_SONIC, @@ -1824,47 +1781,27 @@ impl From for AVCodecID { Id::GREMLIN_DPCM => AV_CODEC_ID_GREMLIN_DPCM, Id::DOLBY_E => AV_CODEC_ID_DOLBY_E, - #[cfg(feature = "ffmpeg_4_0")] Id::APTX => AV_CODEC_ID_APTX, - #[cfg(feature = "ffmpeg_4_0")] Id::APTX_HD => AV_CODEC_ID_APTX_HD, - #[cfg(feature = "ffmpeg_4_0")] Id::SBC => AV_CODEC_ID_SBC, - #[cfg(feature = "ffmpeg_4_1")] Id::AVS2 => AV_CODEC_ID_AVS2, - #[cfg(feature = "ffmpeg_4_1")] Id::IMM4 => AV_CODEC_ID_IMM4, - #[cfg(feature = "ffmpeg_4_1")] Id::PROSUMER => AV_CODEC_ID_PROSUMER, - #[cfg(feature = "ffmpeg_4_1")] Id::MWSC => AV_CODEC_ID_MWSC, - #[cfg(feature = "ffmpeg_4_1")] Id::WCMV => AV_CODEC_ID_WCMV, - #[cfg(feature = "ffmpeg_4_1")] Id::RASC => AV_CODEC_ID_RASC, - #[cfg(feature = "ffmpeg_4_1")] Id::PCM_VIDC => AV_CODEC_ID_PCM_VIDC, - #[cfg(feature = "ffmpeg_4_1")] Id::ATRAC9 => AV_CODEC_ID_ATRAC9, - #[cfg(feature = "ffmpeg_4_1")] Id::TTML => AV_CODEC_ID_TTML, - #[cfg(feature = "ffmpeg_4_2")] Id::HYMT => AV_CODEC_ID_HYMT, - #[cfg(feature = "ffmpeg_4_2")] Id::ARBC => AV_CODEC_ID_ARBC, - #[cfg(feature = "ffmpeg_4_2")] Id::AGM => AV_CODEC_ID_AGM, - #[cfg(feature = "ffmpeg_4_2")] Id::LSCR => AV_CODEC_ID_LSCR, - #[cfg(feature = "ffmpeg_4_2")] Id::VP4 => AV_CODEC_ID_VP4, - #[cfg(feature = "ffmpeg_4_2")] Id::ADPCM_AGM => AV_CODEC_ID_ADPCM_AGM, - #[cfg(feature = "ffmpeg_4_2")] Id::HCOM => AV_CODEC_ID_HCOM, - #[cfg(feature = "ffmpeg_4_2")] Id::ARIB_CAPTION => AV_CODEC_ID_ARIB_CAPTION, #[cfg(feature = "ffmpeg_4_3")] diff --git a/src/codec/packet/packet.rs b/src/codec/packet/packet.rs index 779e018..8ed9c00 100644 --- a/src/codec/packet/packet.rs +++ b/src/codec/packet/packet.rs @@ -264,15 +264,10 @@ impl Clone for Packet { #[inline] fn clone_from(&mut self, source: &Self) { - #[cfg(feature = "ffmpeg_4_0")] unsafe { av_packet_ref(&mut self.0, &source.0); av_packet_make_writable(&mut self.0); } - #[cfg(not(feature = "ffmpeg_4_0"))] - unsafe { - av_copy_packet(&mut self.0, &source.0); - } } } diff --git a/src/codec/packet/side_data.rs b/src/codec/packet/side_data.rs index cbd3ba1..a950f3f 100644 --- a/src/codec/packet/side_data.rs +++ b/src/codec/packet/side_data.rs @@ -37,12 +37,9 @@ pub enum Type { ContentLightLevel, A53CC, - #[cfg(feature = "ffmpeg_4_0")] EncryptionInitInfo, - #[cfg(feature = "ffmpeg_4_0")] EncryptionInfo, - #[cfg(feature = "ffmpeg_4_1")] AFD, #[cfg(feature = "ffmpeg_4_3")] @@ -98,12 +95,9 @@ impl From for Type { AV_PKT_DATA_CONTENT_LIGHT_LEVEL => Type::ContentLightLevel, AV_PKT_DATA_A53_CC => Type::A53CC, - #[cfg(feature = "ffmpeg_4_0")] AV_PKT_DATA_ENCRYPTION_INIT_INFO => Type::EncryptionInitInfo, - #[cfg(feature = "ffmpeg_4_0")] AV_PKT_DATA_ENCRYPTION_INFO => Type::EncryptionInfo, - #[cfg(feature = "ffmpeg_4_1")] AV_PKT_DATA_AFD => Type::AFD, #[cfg(feature = "ffmpeg_4_3")] @@ -164,12 +158,9 @@ impl From for AVPacketSideDataType { Type::ContentLightLevel => AV_PKT_DATA_CONTENT_LIGHT_LEVEL, Type::A53CC => AV_PKT_DATA_A53_CC, - #[cfg(feature = "ffmpeg_4_0")] Type::EncryptionInitInfo => AV_PKT_DATA_ENCRYPTION_INIT_INFO, - #[cfg(feature = "ffmpeg_4_0")] Type::EncryptionInfo => AV_PKT_DATA_ENCRYPTION_INFO, - #[cfg(feature = "ffmpeg_4_1")] Type::AFD => AV_PKT_DATA_AFD, #[cfg(feature = "ffmpeg_4_3")] diff --git a/src/format/format/flag.rs b/src/format/format/flag.rs index 2383bd5..962a7ed 100644 --- a/src/format/format/flag.rs +++ b/src/format/format/flag.rs @@ -6,8 +6,6 @@ bitflags! { const NO_FILE = AVFMT_NOFILE; const NEED_NUMBER = AVFMT_NEEDNUMBER; const SHOW_IDS = AVFMT_SHOW_IDS; - #[cfg(not(feature = "ffmpeg_4_0"))] - const RAW_PICTURE = AVFMT_RAWPICTURE; const GLOBAL_HEADER = AVFMT_GLOBALHEADER; const NO_TIMESTAMPS = AVFMT_NOTIMESTAMPS; const GENERIC_INDEX = AVFMT_GENERIC_INDEX; diff --git a/src/format/format/mod.rs b/src/format/format/mod.rs index 9ed9cbd..7b3d013 100644 --- a/src/format/format/mod.rs +++ b/src/format/format/mod.rs @@ -7,17 +7,13 @@ pub use self::input::Input; mod output; pub use self::output::Output; -#[cfg(feature = "ffmpeg_4_0")] mod iter; -#[cfg(feature = "ffmpeg_4_0")] pub use self::iter::{DemuxerIter, MuxerIter}; -#[cfg(feature = "ffmpeg_4_0")] pub fn list_demuxers() -> DemuxerIter { DemuxerIter::new() } -#[cfg(feature = "ffmpeg_4_0")] pub fn list_muxers() -> MuxerIter { MuxerIter::new() } diff --git a/src/util/format/pixel.rs b/src/util/format/pixel.rs index d362a73..76ae6f5 100644 --- a/src/util/format/pixel.rs +++ b/src/util/format/pixel.rs @@ -116,8 +116,6 @@ pub enum Pixel { YUV444P10LE, YUV422P9BE, YUV422P9LE, - #[cfg(not(feature = "ffmpeg_4_0"))] - VDA_VLD, GBRP, GBRP9BE, @@ -161,9 +159,6 @@ pub enum Pixel { YVYU422, - #[cfg(not(feature = "ffmpeg_4_0"))] - VDA, - YA16BE, YA16LE, @@ -225,7 +220,7 @@ pub enum Pixel { VIDEOTOOLBOX, // --- defaults - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_7_0")))] + #[cfg(not(feature = "ffmpeg_7_0"))] XVMC, RGB32, @@ -313,29 +308,18 @@ pub enum Pixel { GBRAPF32LE, DRM_PRIME, - #[cfg(feature = "ffmpeg_4_0")] OPENCL, - #[cfg(feature = "ffmpeg_4_1")] GRAY14BE, - #[cfg(feature = "ffmpeg_4_1")] GRAY14LE, - #[cfg(feature = "ffmpeg_4_1")] GRAYF32BE, - #[cfg(feature = "ffmpeg_4_1")] GRAYF32LE, - #[cfg(feature = "ffmpeg_4_2")] YUVA422P12BE, - #[cfg(feature = "ffmpeg_4_2")] YUVA422P12LE, - #[cfg(feature = "ffmpeg_4_2")] YUVA444P12BE, - #[cfg(feature = "ffmpeg_4_2")] YUVA444P12LE, - #[cfg(feature = "ffmpeg_4_2")] NV24, - #[cfg(feature = "ffmpeg_4_2")] NV42, #[cfg(feature = "ffmpeg_4_3")] @@ -501,7 +485,7 @@ impl From for Pixel { AV_PIX_FMT_YUVJ420P => Pixel::YUVJ420P, AV_PIX_FMT_YUVJ422P => Pixel::YUVJ422P, AV_PIX_FMT_YUVJ444P => Pixel::YUVJ444P, - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_7_0")))] + #[cfg(not(feature = "ffmpeg_7_0"))] AV_PIX_FMT_XVMC => Pixel::XVMC, #[cfg(all(feature = "ff_api_xvmc", not(feature = "ffmpeg_5_0")))] AV_PIX_FMT_XVMC_MPEG2_MC => Pixel::XVMC_MPEG2_MC, @@ -591,8 +575,6 @@ impl From for Pixel { AV_PIX_FMT_YUV444P10LE => Pixel::YUV444P10LE, AV_PIX_FMT_YUV422P9BE => Pixel::YUV422P9BE, AV_PIX_FMT_YUV422P9LE => Pixel::YUV422P9LE, - #[cfg(not(feature = "ffmpeg_4_0"))] - AV_PIX_FMT_VDA_VLD => Pixel::VDA_VLD, AV_PIX_FMT_GBRP => Pixel::GBRP, AV_PIX_FMT_GBRP9BE => Pixel::GBRP9BE, @@ -636,9 +618,6 @@ impl From for Pixel { AV_PIX_FMT_YVYU422 => Pixel::YVYU422, - #[cfg(not(feature = "ffmpeg_4_0"))] - AV_PIX_FMT_VDA => Pixel::VDA, - AV_PIX_FMT_YA16BE => Pixel::YA16BE, AV_PIX_FMT_YA16LE => Pixel::YA16LE, @@ -724,29 +703,18 @@ impl From for Pixel { AV_PIX_FMT_GBRAPF32LE => Pixel::GBRAPF32LE, AV_PIX_FMT_DRM_PRIME => Pixel::DRM_PRIME, - #[cfg(feature = "ffmpeg_4_0")] AV_PIX_FMT_OPENCL => Pixel::OPENCL, - #[cfg(feature = "ffmpeg_4_1")] AV_PIX_FMT_GRAY14BE => Pixel::GRAY14BE, - #[cfg(feature = "ffmpeg_4_1")] AV_PIX_FMT_GRAY14LE => Pixel::GRAY14LE, - #[cfg(feature = "ffmpeg_4_1")] AV_PIX_FMT_GRAYF32BE => Pixel::GRAYF32BE, - #[cfg(feature = "ffmpeg_4_1")] AV_PIX_FMT_GRAYF32LE => Pixel::GRAYF32LE, - #[cfg(feature = "ffmpeg_4_2")] AV_PIX_FMT_YUVA422P12BE => Pixel::YUVA422P12BE, - #[cfg(feature = "ffmpeg_4_2")] AV_PIX_FMT_YUVA422P12LE => Pixel::YUVA422P12LE, - #[cfg(feature = "ffmpeg_4_2")] AV_PIX_FMT_YUVA444P12BE => Pixel::YUVA444P12BE, - #[cfg(feature = "ffmpeg_4_2")] AV_PIX_FMT_YUVA444P12LE => Pixel::YUVA444P12LE, - #[cfg(feature = "ffmpeg_4_2")] AV_PIX_FMT_NV24 => Pixel::NV24, - #[cfg(feature = "ffmpeg_4_2")] AV_PIX_FMT_NV42 => Pixel::NV42, #[cfg(feature = "ffmpeg_4_3")] @@ -959,8 +927,6 @@ impl From for AVPixelFormat { Pixel::YUV444P10LE => AV_PIX_FMT_YUV444P10LE, Pixel::YUV422P9BE => AV_PIX_FMT_YUV422P9BE, Pixel::YUV422P9LE => AV_PIX_FMT_YUV422P9LE, - #[cfg(not(feature = "ffmpeg_4_0"))] - Pixel::VDA_VLD => AV_PIX_FMT_VDA_VLD, Pixel::GBRP => AV_PIX_FMT_GBRP, Pixel::GBRP9BE => AV_PIX_FMT_GBRP9BE, @@ -1004,9 +970,6 @@ impl From for AVPixelFormat { Pixel::YVYU422 => AV_PIX_FMT_YVYU422, - #[cfg(not(feature = "ffmpeg_4_0"))] - Pixel::VDA => AV_PIX_FMT_VDA, - Pixel::YA16BE => AV_PIX_FMT_YA16BE, Pixel::YA16LE => AV_PIX_FMT_YA16LE, @@ -1068,7 +1031,7 @@ impl From for AVPixelFormat { Pixel::VIDEOTOOLBOX => AV_PIX_FMT_VIDEOTOOLBOX, // --- defaults - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_7_0")))] + #[cfg(not(feature = "ffmpeg_7_0"))] Pixel::XVMC => AV_PIX_FMT_XVMC, Pixel::RGB32 => AV_PIX_FMT_RGB32, @@ -1156,29 +1119,18 @@ impl From for AVPixelFormat { Pixel::GBRAPF32LE => AV_PIX_FMT_GBRAPF32LE, Pixel::DRM_PRIME => AV_PIX_FMT_DRM_PRIME, - #[cfg(feature = "ffmpeg_4_0")] Pixel::OPENCL => AV_PIX_FMT_OPENCL, - #[cfg(feature = "ffmpeg_4_1")] Pixel::GRAY14BE => AV_PIX_FMT_GRAY14BE, - #[cfg(feature = "ffmpeg_4_1")] Pixel::GRAY14LE => AV_PIX_FMT_GRAY14LE, - #[cfg(feature = "ffmpeg_4_1")] Pixel::GRAYF32BE => AV_PIX_FMT_GRAYF32BE, - #[cfg(feature = "ffmpeg_4_1")] Pixel::GRAYF32LE => AV_PIX_FMT_GRAYF32LE, - #[cfg(feature = "ffmpeg_4_2")] Pixel::YUVA422P12BE => AV_PIX_FMT_YUVA422P12BE, - #[cfg(feature = "ffmpeg_4_2")] Pixel::YUVA422P12LE => AV_PIX_FMT_YUVA422P12LE, - #[cfg(feature = "ffmpeg_4_2")] Pixel::YUVA444P12BE => AV_PIX_FMT_YUVA444P12BE, - #[cfg(feature = "ffmpeg_4_2")] Pixel::YUVA444P12LE => AV_PIX_FMT_YUVA444P12LE, - #[cfg(feature = "ffmpeg_4_2")] Pixel::NV24 => AV_PIX_FMT_NV24, - #[cfg(feature = "ffmpeg_4_2")] Pixel::NV42 => AV_PIX_FMT_NV42, #[cfg(feature = "ffmpeg_4_3")] diff --git a/src/util/frame/side_data.rs b/src/util/frame/side_data.rs index 21adfda..499e932 100644 --- a/src/util/frame/side_data.rs +++ b/src/util/frame/side_data.rs @@ -31,17 +31,14 @@ pub enum Type { ContentLightLevel, IccProfile, - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_5_0")))] + #[cfg(not(feature = "ffmpeg_5_0"))] QPTableProperties, - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_5_0")))] + #[cfg(not(feature = "ffmpeg_5_0"))] QPTableData, - #[cfg(feature = "ffmpeg_4_1")] S12M_TIMECODE, - #[cfg(feature = "ffmpeg_4_2")] DYNAMIC_HDR_PLUS, - #[cfg(feature = "ffmpeg_4_2")] REGIONS_OF_INTEREST, #[cfg(feature = "ffmpeg_4_3")] @@ -100,16 +97,13 @@ impl From for Type { AV_FRAME_DATA_CONTENT_LIGHT_LEVEL => Type::ContentLightLevel, AV_FRAME_DATA_ICC_PROFILE => Type::IccProfile, - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_5_0")))] + #[cfg(not(feature = "ffmpeg_5_0"))] AV_FRAME_DATA_QP_TABLE_PROPERTIES => Type::QPTableProperties, - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_5_0")))] + #[cfg(not(feature = "ffmpeg_5_0"))] AV_FRAME_DATA_QP_TABLE_DATA => Type::QPTableData, - #[cfg(feature = "ffmpeg_4_1")] AV_FRAME_DATA_S12M_TIMECODE => Type::S12M_TIMECODE, - #[cfg(feature = "ffmpeg_4_2")] AV_FRAME_DATA_DYNAMIC_HDR_PLUS => Type::DYNAMIC_HDR_PLUS, - #[cfg(feature = "ffmpeg_4_2")] AV_FRAME_DATA_REGIONS_OF_INTEREST => Type::REGIONS_OF_INTEREST, #[cfg(feature = "ffmpeg_4_3")] @@ -164,16 +158,13 @@ impl From for AVFrameSideDataType { Type::ContentLightLevel => AV_FRAME_DATA_CONTENT_LIGHT_LEVEL, Type::IccProfile => AV_FRAME_DATA_ICC_PROFILE, - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_5_0")))] + #[cfg(not(feature = "ffmpeg_5_0"))] Type::QPTableProperties => AV_FRAME_DATA_QP_TABLE_PROPERTIES, - #[cfg(all(feature = "ffmpeg_4_0", not(feature = "ffmpeg_5_0")))] + #[cfg(not(feature = "ffmpeg_5_0"))] Type::QPTableData => AV_FRAME_DATA_QP_TABLE_DATA, - #[cfg(feature = "ffmpeg_4_1")] Type::S12M_TIMECODE => AV_FRAME_DATA_S12M_TIMECODE, - #[cfg(feature = "ffmpeg_4_2")] Type::DYNAMIC_HDR_PLUS => AV_FRAME_DATA_DYNAMIC_HDR_PLUS, - #[cfg(feature = "ffmpeg_4_2")] Type::REGIONS_OF_INTEREST => AV_FRAME_DATA_REGIONS_OF_INTEREST, #[cfg(feature = "ffmpeg_4_3")]