git: 0bfdf0bed66b - main - multimedia/wl-screenrec: unbreak build with ffmpeg 7.0

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Mon, 20 May 2024 07:03:23 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0bfdf0bed66b6f5848a55f36da506a8d63f5c74a

commit 0bfdf0bed66b6f5848a55f36da506a8d63f5c74a
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2024-02-16 11:24:12 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-05-20 07:02:22 +0000

    multimedia/wl-screenrec: unbreak build with ffmpeg 7.0
    
    error[E0425]: cannot find value `AV_CH_LAYOUT_NATIVE` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/util/channel_layout.rs:31:39
          |
    31    |         const NATIVE                = AV_CH_LAYOUT_NATIVE;
          |                                       ^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `AV_CH_LAYOUT_STEREO`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:20795:1
          |
    20795 | pub const AV_CH_LAYOUT_STEREO: libc::c_ulonglong = 3;
          | ------------------------------------------------ similarly named constant `AV_CH_LAYOUT_STEREO` defined here
    
    error[E0425]: cannot find value `AV_CH_LAYOUT_3POINT1POINT2` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/util/channel_layout.rs:63:37
          |
    63    |         const _3POINT1POINT2      = AV_CH_LAYOUT_3POINT1POINT2;
          |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `AV_CH_LAYOUT_3POINT1`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:20799:1
          |
    20799 | pub const AV_CH_LAYOUT_3POINT1: libc::c_ulonglong = 15;
          | ------------------------------------------------- similarly named constant `AV_CH_LAYOUT_3POINT1` defined here
    
    error[E0425]: cannot find value `AV_CH_LAYOUT_5POINT1POINT2_BACK` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/util/channel_layout.rs:65:37
          |
    65    |         const _5POINT1POINT2_BACK = AV_CH_LAYOUT_5POINT1POINT2_BACK;
          |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `AV_CH_LAYOUT_5POINT1_BACK`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:20807:1
          |
    20807 | pub const AV_CH_LAYOUT_5POINT1_BACK: libc::c_ulonglong = 63;
          | ------------------------------------------------------ similarly named constant `AV_CH_LAYOUT_5POINT1_BACK` defined here
    
    error[E0425]: cannot find value `AV_CH_LAYOUT_5POINT1POINT4_BACK` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/util/channel_layout.rs:67:37
          |
    67    |         const _5POINT1POINT4_BACK = AV_CH_LAYOUT_5POINT1POINT4_BACK;
          |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `AV_CH_LAYOUT_5POINT1_BACK`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:20807:1
          |
    20807 | pub const AV_CH_LAYOUT_5POINT1_BACK: libc::c_ulonglong = 63;
          | ------------------------------------------------------ similarly named constant `AV_CH_LAYOUT_5POINT1_BACK` defined here
    
    error[E0425]: cannot find value `AV_CH_LAYOUT_7POINT1POINT2` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/util/channel_layout.rs:69:37
          |
    69    |         const _7POINT1POINT2      = AV_CH_LAYOUT_7POINT1POINT2;
          |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `AV_CH_LAYOUT_7POINT1_WIDE`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:20817:1
          |
    20817 | pub const AV_CH_LAYOUT_7POINT1_WIDE: libc::c_ulonglong = 1743;
          | ------------------------------------------------------ similarly named constant `AV_CH_LAYOUT_7POINT1_WIDE` defined here
    
    error[E0425]: cannot find value `AV_CH_LAYOUT_7POINT1POINT4_BACK` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/util/channel_layout.rs:71:37
          |
    71    |         const _7POINT1POINT4_BACK = AV_CH_LAYOUT_7POINT1POINT4_BACK;
          |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `AV_CH_LAYOUT_7POINT1_WIDE_BACK`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:20818:1
          |
    20818 | pub const AV_CH_LAYOUT_7POINT1_WIDE_BACK: libc::c_ulonglong = 255;
          | ----------------------------------------------------------- similarly named constant `AV_CH_LAYOUT_7POINT1_WIDE_BACK` defined here
    
    error[E0425]: cannot find value `AV_PIX_FMT_XVMC` in this scope
        --> cargo-crates/ffmpeg-next-6.1.1/src/util/format/pixel.rs:1056:28
         |
    1056 |             Pixel::XVMC => AV_PIX_FMT_XVMC,
         |                            ^^^^^^^^^^^^^^^ help: a unit variant with a similar name exists: `AV_PIX_FMT_NV12`
         |
        ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:4874:5
         |
    4874 |     AV_PIX_FMT_NV12 = 23,
         |     --------------- similarly named unit variant `AV_PIX_FMT_NV12` defined here
    
    error[E0425]: cannot find value `AV_OPT_TYPE_CHANNEL_LAYOUT` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/util/option/mod.rs:82:36
          |
    82    |             Type::ChannelLayout => AV_OPT_TYPE_CHANNEL_LAYOUT,
          |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a unit variant with a similar name exists: `AV_OPT_TYPE_CHLAYOUT`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:13185:5
          |
    13185 |     AV_OPT_TYPE_CHLAYOUT = 19,
          |     -------------------- similarly named unit variant `AV_OPT_TYPE_CHLAYOUT` defined here
    
    error[E0425]: cannot find value `AV_CODEC_ID_AYUV` in this scope
        --> cargo-crates/ffmpeg-next-6.1.1/src/codec/id.rs:1538:25
         |
    1538 |             Id::AYUV => AV_CODEC_ID_AYUV,
         |                         ^^^^^^^^^^^^^^^^ help: a unit variant with a similar name exists: `AV_CODEC_ID_CYUV`
         |
        ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:7549:5
         |
    7549 |     AV_CODEC_ID_CYUV = 26,
         |     ---------------- similarly named unit variant `AV_CODEC_ID_CYUV` defined here
    
    error[E0425]: cannot find function `av_get_channel_layout_nb_channels` in this scope
      --> cargo-crates/ffmpeg-next-6.1.1/src/util/channel_layout.rs:78:18
       |
    78 |         unsafe { av_get_channel_layout_nb_channels(self.bits()) }
       |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
    
    error[E0425]: cannot find function `av_get_default_channel_layout` in this scope
      --> cargo-crates/ffmpeg-next-6.1.1/src/util/channel_layout.rs:83:47
       |
    83 |             ChannelLayout::from_bits_truncate(av_get_default_channel_layout(number) as c_ulonglong)
       |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
    
    error[E0609]: no field `coded_picture_number` on type `sys::AVFrame`
       --> cargo-crates/ffmpeg-next-6.1.1/src/util/frame/video.rs:178:35
        |
    178 |         unsafe { (*self.as_ptr()).coded_picture_number as usize }
        |                                   ^^^^^^^^^^^^^^^^^^^^ unknown field
        |
        = note: available fields are: `data`, `linesize`, `extended_data`, `width`, `height` ... and 40 others
    
    error[E0609]: no field `display_picture_number` on type `sys::AVFrame`
       --> cargo-crates/ffmpeg-next-6.1.1/src/util/frame/video.rs:183:35
        |
    183 |         unsafe { (*self.as_ptr()).display_picture_number as usize }
        |                                   ^^^^^^^^^^^^^^^^^^^^^^ unknown field
        |
        = note: available fields are: `data`, `linesize`, `extended_data`, `width`, `height` ... and 40 others
    
    error[E0609]: no field `channel_layout` on type `sys::AVFrame`
      --> cargo-crates/ffmpeg-next-6.1.1/src/util/frame/audio.rs:66:69
       |
    66 |         unsafe { ChannelLayout::from_bits_truncate((*self.as_ptr()).channel_layout as c_ulonglong) }
       |                                                                     ^^^^^^^^^^^^^^ unknown field
       |
       = note: available fields are: `data`, `linesize`, `extended_data`, `width`, `height` ... and 40 others
    
    error[E0609]: no field `channel_layout` on type `sys::AVFrame`
      --> cargo-crates/ffmpeg-next-6.1.1/src/util/frame/audio.rs:71:39
       |
    71 |         unsafe { (*self.as_mut_ptr()).channel_layout = value.bits() }
       |                                       ^^^^^^^^^^^^^^ unknown field
       |
       = note: available fields are: `data`, `linesize`, `extended_data`, `width`, `height` ... and 40 others
    
    error[E0609]: no field `channels` on type `sys::AVFrame`
      --> cargo-crates/ffmpeg-next-6.1.1/src/util/frame/audio.rs:76:35
       |
    76 |         unsafe { (*self.as_ptr()).channels as u16 }
       |                                   ^^^^^^^^ unknown field
       |
       = note: available fields are: `data`, `linesize`, `extended_data`, `width`, `height` ... and 40 others
    
    error[E0609]: no field `channels` on type `sys::AVFrame`
      --> cargo-crates/ffmpeg-next-6.1.1/src/util/frame/audio.rs:82:34
       |
    82 |             (*self.as_mut_ptr()).channels = i32::from(value);
       |                                  ^^^^^^^^ unknown field
       |
       = note: available fields are: `data`, `linesize`, `extended_data`, `width`, `height` ... and 40 others
    
    error[E0609]: no field `pkt_duration` on type `sys::AVFrame`
      --> cargo-crates/ffmpeg-next-6.1.1/src/util/frame/mod.rs:82:44
       |
    82 |                 duration: (*self.as_ptr()).pkt_duration,
       |                                            ^^^^^^^^^^^^ unknown field
       |
    help: a field with a similar name exists
       |
    82 |                 duration: (*self.as_ptr()).duration,
       |                                            ~~~~~~~~
    
    error[E0425]: cannot find function `av_opt_set_channel_layout` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/util/option/traits.rs:137:20
          |
    137   |               check!(av_opt_set_channel_layout(
          |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `av_opt_set_chlayout`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:13792:5
          |
    13792 | /     pub fn av_opt_set_chlayout(
    13793 | |         obj: *mut libc::c_void,
    13794 | |         name: *const libc::c_char,
    13795 | |         layout: *const AVChannelLayout,
    13796 | |         search_flags: libc::c_int,
    13797 | |     ) -> libc::c_int;
          | |____________________- similarly named function `av_opt_set_chlayout` defined here
    
    error[E0609]: no field `channel_layouts` on type `sys::AVCodec`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/audio.rs:41:39
       |
    41 |             if (*self.codec.as_ptr()).channel_layouts.is_null() {
       |                                       ^^^^^^^^^^^^^^^ unknown field
       |
    help: a field with a similar name exists
       |
    41 |             if (*self.codec.as_ptr()).ch_layouts.is_null() {
       |                                       ~~~~~~~~~~
    
    error[E0609]: no field `channel_layouts` on type `sys::AVCodec`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/audio.rs:45:44
       |
    45 |                     (*self.codec.as_ptr()).channel_layouts,
       |                                            ^^^^^^^^^^^^^^^ unknown field
       |
    help: a field with a similar name exists
       |
    45 |                     (*self.codec.as_ptr()).ch_layouts,
       |                                            ~~~~~~~~~~
    
    error[E0609]: no field `slice_count` on type `sys::AVCodecContext`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/decoder/video.rs:89:34
       |
    89 |             (*self.as_mut_ptr()).slice_count = value as c_int;
       |                                  ^^^^^^^^^^^ unknown field
       |
       = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `channels` on type `sys::AVCodecContext`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/decoder/audio.rs:51:35
       |
    51 |         unsafe { (*self.as_ptr()).channels as u16 }
       |                                   ^^^^^^^^ unknown field
       |
       = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `frame_number` on type `sys::AVCodecContext`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/decoder/audio.rs:65:35
       |
    65 |         unsafe { (*self.as_ptr()).frame_number as usize }
       |                                   ^^^^^^^^^^^^ unknown field
       |
       = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `channel_layout` on type `sys::AVCodecContext`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/decoder/audio.rs:73:69
       |
    73 |         unsafe { ChannelLayout::from_bits_truncate((*self.as_ptr()).channel_layout) }
       |                                                                     ^^^^^^^^^^^^^^ unknown field
       |
       = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `channel_layout` on type `sys::AVCodecContext`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/decoder/audio.rs:78:34
       |
    78 |             (*self.as_mut_ptr()).channel_layout = value.bits();
       |                                  ^^^^^^^^^^^^^^ unknown field
       |
       = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `request_channel_layout` on type `sys::AVCodecContext`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/decoder/audio.rs:84:34
       |
    84 |             (*self.as_mut_ptr()).request_channel_layout = value.bits();
       |                                  ^^^^^^^^^^^^^^^^^^^^^^ unknown field
       |
       = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `channel_layout` on type `sys::AVCodecContext`
      --> cargo-crates/ffmpeg-next-6.1.1/src/codec/encoder/audio.rs:98:34
       |
    98 |             (*self.as_mut_ptr()).channel_layout = value.bits();
       |                                  ^^^^^^^^^^^^^^ unknown field
       |
       = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `channel_layout` on type `sys::AVCodecContext`
       --> cargo-crates/ffmpeg-next-6.1.1/src/codec/encoder/audio.rs:103:69
        |
    103 |         unsafe { ChannelLayout::from_bits_truncate((*self.as_ptr()).channel_layout) }
        |                                                                     ^^^^^^^^^^^^^^ unknown field
        |
        = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `channels` on type `sys::AVCodecContext`
       --> cargo-crates/ffmpeg-next-6.1.1/src/codec/encoder/audio.rs:108:34
        |
    108 |             (*self.as_mut_ptr()).channels = value;
        |                                  ^^^^^^^^ unknown field
        |
        = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0609]: no field `channels` on type `sys::AVCodecContext`
       --> cargo-crates/ffmpeg-next-6.1.1/src/codec/encoder/audio.rs:113:35
        |
    113 |         unsafe { (*self.as_ptr()).channels as u16 }
        |                                   ^^^^^^^^ unknown field
        |
        = note: available fields are: `av_class`, `log_level_offset`, `codec_type`, `codec`, `codec_id` ... and 95 others
    
    error[E0425]: cannot find function `swr_alloc_set_opts` in this scope
         --> cargo-crates/ffmpeg-next-6.1.1/src/software/resampling/context.rs:71:23
          |
    71    |               let ptr = swr_alloc_set_opts(
          |                         ^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `swr_alloc_set_opts2`
          |
         ::: ../target/x86_64-unknown-freebsd/release/build/ffmpeg-sys-next-71257b07c8bd5e07/out/bindings.rs:23188:5
          |
    23188 | /     pub fn swr_alloc_set_opts2(
    23189 | |         ps: *mut *mut SwrContext,
    23190 | |         out_ch_layout: *const AVChannelLayout,
    23191 | |         out_sample_fmt: AVSampleFormat,
    ...     |
    23197 | |         log_ctx: *mut libc::c_void,
    23198 | |     ) -> libc::c_int;
          | |____________________- similarly named function `swr_alloc_set_opts2` defined here
    
    Some errors have detailed explanations: E0425, E0609.
    
    Reported by:    antoine (via bug 278705 exp-run)
---
 multimedia/wl-screenrec/Makefile            |   2 +-
 multimedia/wl-screenrec/Makefile.crates     |  13 +-
 multimedia/wl-screenrec/distinfo            |  26 ++-
 multimedia/wl-screenrec/files/patch-ffmpeg  |   4 +-
 multimedia/wl-screenrec/files/patch-ffmpeg7 | 313 ++++++++++++++++++++++++++++
 5 files changed, 334 insertions(+), 24 deletions(-)

diff --git a/multimedia/wl-screenrec/Makefile b/multimedia/wl-screenrec/Makefile
index 87db3afef992..92e1319ef234 100644
--- a/multimedia/wl-screenrec/Makefile
+++ b/multimedia/wl-screenrec/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	wl-screenrec
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.1.3
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	multimedia wayland
 
 MAINTAINER=	jbeich@FreeBSD.org
diff --git a/multimedia/wl-screenrec/Makefile.crates b/multimedia/wl-screenrec/Makefile.crates
index f1b035955ac6..a46a7ee3de9c 100644
--- a/multimedia/wl-screenrec/Makefile.crates
+++ b/multimedia/wl-screenrec/Makefile.crates
@@ -5,9 +5,8 @@ CARGO_CRATES=	aho-corasick-1.1.2 \
 		anstyle-query-1.0.2 \
 		anstyle-wincon-3.0.2 \
 		anyhow-1.0.79 \
-		bindgen-0.64.0 \
-		bitflags-1.3.2 \
-		bitflags-2.4.2 \
+		bindgen-0.69.4 \
+		bitflags-2.5.0 \
 		cc-1.0.83 \
 		cexpr-0.6.0 \
 		cfg-if-1.0.0 \
@@ -20,13 +19,15 @@ CARGO_CRATES=	aho-corasick-1.1.2 \
 		dlib-0.5.2 \
 		downcast-rs-1.2.0 \
 		drm-fourcc-2.2.0 \
+		either-1.12.0 \
 		errno-0.3.8 \
-		ffmpeg-next-6.1.1 \
-		ffmpeg-sys-next-6.1.0 \
+		ffmpeg-next-7.0.1 \
+		ffmpeg-sys-next-7.0.0 \
 		glob-0.3.1 \
 		heck-0.4.1 \
 		hermit-abi-0.3.6 \
 		human-size-0.4.3 \
+		itertools-0.12.1 \
 		itoa-1.0.10 \
 		lazy_static-1.4.0 \
 		lazycell-1.3.0 \
@@ -39,7 +40,6 @@ CARGO_CRATES=	aho-corasick-1.1.2 \
 		nix-0.27.1 \
 		nom-7.1.3 \
 		num_cpus-1.16.0 \
-		peeking_take_while-0.1.2 \
 		pkg-config-0.3.30 \
 		proc-macro2-1.0.78 \
 		quick-xml-0.31.0 \
@@ -59,7 +59,6 @@ CARGO_CRATES=	aho-corasick-1.1.2 \
 		signal-hook-registry-1.4.1 \
 		smallvec-1.13.1 \
 		strsim-0.11.0 \
-		syn-1.0.109 \
 		syn-2.0.49 \
 		thiserror-1.0.57 \
 		thiserror-impl-1.0.57 \
diff --git a/multimedia/wl-screenrec/distinfo b/multimedia/wl-screenrec/distinfo
index 749aedadb9d1..719741f170bd 100644
--- a/multimedia/wl-screenrec/distinfo
+++ b/multimedia/wl-screenrec/distinfo
@@ -13,12 +13,10 @@ SHA256 (rust/crates/anstyle-wincon-3.0.2.crate) = 1cd54b81ec8d6180e24654d0b371ad
 SIZE (rust/crates/anstyle-wincon-3.0.2.crate) = 11272
 SHA256 (rust/crates/anyhow-1.0.79.crate) = 080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca
 SIZE (rust/crates/anyhow-1.0.79.crate) = 44931
-SHA256 (rust/crates/bindgen-0.64.0.crate) = c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4
-SIZE (rust/crates/bindgen-0.64.0.crate) = 204700
-SHA256 (rust/crates/bitflags-1.3.2.crate) = bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a
-SIZE (rust/crates/bitflags-1.3.2.crate) = 23021
-SHA256 (rust/crates/bitflags-2.4.2.crate) = ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf
-SIZE (rust/crates/bitflags-2.4.2.crate) = 42602
+SHA256 (rust/crates/bindgen-0.69.4.crate) = a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0
+SIZE (rust/crates/bindgen-0.69.4.crate) = 221092
+SHA256 (rust/crates/bitflags-2.5.0.crate) = cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1
+SIZE (rust/crates/bitflags-2.5.0.crate) = 43821
 SHA256 (rust/crates/cc-1.0.83.crate) = f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0
 SIZE (rust/crates/cc-1.0.83.crate) = 68343
 SHA256 (rust/crates/cexpr-0.6.0.crate) = 6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766
@@ -43,12 +41,14 @@ SHA256 (rust/crates/downcast-rs-1.2.0.crate) = 9ea835d29036a4087793836fa931b0883
 SIZE (rust/crates/downcast-rs-1.2.0.crate) = 11670
 SHA256 (rust/crates/drm-fourcc-2.2.0.crate) = 0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4
 SIZE (rust/crates/drm-fourcc-2.2.0.crate) = 12192
+SHA256 (rust/crates/either-1.12.0.crate) = 3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b
+SIZE (rust/crates/either-1.12.0.crate) = 18974
 SHA256 (rust/crates/errno-0.3.8.crate) = a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245
 SIZE (rust/crates/errno-0.3.8.crate) = 10645
-SHA256 (rust/crates/ffmpeg-next-6.1.1.crate) = 4e72c72e8dcf638fb0fb03f033a954691662b5dabeaa3f85a6607d101569fccd
-SIZE (rust/crates/ffmpeg-next-6.1.1.crate) = 89765
-SHA256 (rust/crates/ffmpeg-sys-next-6.1.0.crate) = c2529ad916d08c3562c754c21bc9b17a26c7882c0f5706cc2cd69472175f1620
-SIZE (rust/crates/ffmpeg-sys-next-6.1.0.crate) = 15767
+SHA256 (rust/crates/ffmpeg-next-7.0.1.crate) = a681d69bf41d1c9edc7c6a2b09b69d0b96e9b916d200b7ec5b10de61f559eb31
+SIZE (rust/crates/ffmpeg-next-7.0.1.crate) = 96582
+SHA256 (rust/crates/ffmpeg-sys-next-7.0.0.crate) = 972a460dd8e901b737ce0482bf71a837e1751e3dd7c8f8b0a4ead808e7f174a5
+SIZE (rust/crates/ffmpeg-sys-next-7.0.0.crate) = 16033
 SHA256 (rust/crates/glob-0.3.1.crate) = d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b
 SIZE (rust/crates/glob-0.3.1.crate) = 18880
 SHA256 (rust/crates/heck-0.4.1.crate) = 95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8
@@ -57,6 +57,8 @@ SHA256 (rust/crates/hermit-abi-0.3.6.crate) = bd5256b483761cd23699d0da46cc6fd2ee
 SIZE (rust/crates/hermit-abi-0.3.6.crate) = 14884
 SHA256 (rust/crates/human-size-0.4.3.crate) = 9994b79e8c1a39b3166c63ae7823bb2b00831e2a96a31399c50fe69df408eaeb
 SIZE (rust/crates/human-size-0.4.3.crate) = 14757
+SHA256 (rust/crates/itertools-0.12.1.crate) = ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569
+SIZE (rust/crates/itertools-0.12.1.crate) = 137761
 SHA256 (rust/crates/itoa-1.0.10.crate) = b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c
 SIZE (rust/crates/itoa-1.0.10.crate) = 10534
 SHA256 (rust/crates/lazy_static-1.4.0.crate) = e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646
@@ -81,8 +83,6 @@ SHA256 (rust/crates/nom-7.1.3.crate) = d273983c5a657a70a3e8f2a01329822f3b8c8172b
 SIZE (rust/crates/nom-7.1.3.crate) = 117570
 SHA256 (rust/crates/num_cpus-1.16.0.crate) = 4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43
 SIZE (rust/crates/num_cpus-1.16.0.crate) = 15713
-SHA256 (rust/crates/peeking_take_while-0.1.2.crate) = 19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099
-SIZE (rust/crates/peeking_take_while-0.1.2.crate) = 6697
 SHA256 (rust/crates/pkg-config-0.3.30.crate) = d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec
 SIZE (rust/crates/pkg-config-0.3.30.crate) = 20613
 SHA256 (rust/crates/proc-macro2-1.0.78.crate) = e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae
@@ -121,8 +121,6 @@ SHA256 (rust/crates/smallvec-1.13.1.crate) = e6ecd384b10a64542d77071bd64bd7b231f
 SIZE (rust/crates/smallvec-1.13.1.crate) = 34952
 SHA256 (rust/crates/strsim-0.11.0.crate) = 5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01
 SIZE (rust/crates/strsim-0.11.0.crate) = 13710
-SHA256 (rust/crates/syn-1.0.109.crate) = 72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237
-SIZE (rust/crates/syn-1.0.109.crate) = 237611
 SHA256 (rust/crates/syn-2.0.49.crate) = 915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496
 SIZE (rust/crates/syn-2.0.49.crate) = 250652
 SHA256 (rust/crates/thiserror-1.0.57.crate) = 1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b
diff --git a/multimedia/wl-screenrec/files/patch-ffmpeg b/multimedia/wl-screenrec/files/patch-ffmpeg
index 007c18dffc29..20e006a0eaf7 100644
--- a/multimedia/wl-screenrec/files/patch-ffmpeg
+++ b/multimedia/wl-screenrec/files/patch-ffmpeg
@@ -22,8 +22,8 @@ help: a similar name exists in the module
 23 |     EPROTONOSUPPORT, EPROTOTYPE, ERANGE, EROFS, ESPIPE, ESRCH, VTIME, ETIMEDOUT, ETXTBSY,
    |                                                                ~~~~~
 
---- cargo-crates/ffmpeg-next-6.1.1/src/util/error.rs.orig	2006-07-24 01:21:28 UTC
-+++ cargo-crates/ffmpeg-next-6.1.1/src/util/error.rs
+--- cargo-crates/ffmpeg-next-7.0.1/src/util/error.rs.orig	2006-07-24 01:21:28 UTC
++++ cargo-crates/ffmpeg-next-7.0.1/src/util/error.rs
 @@ -17,10 +17,10 @@ pub use libc::{
      EBUSY, ECANCELED, ECHILD, ECONNABORTED, ECONNREFUSED, ECONNRESET, EDEADLK, EDESTADDRREQ, EDOM,
      EEXIST, EFAULT, EFBIG, EHOSTUNREACH, EIDRM, EILSEQ, EINPROGRESS, EINTR, EINVAL, EIO, EISCONN,
diff --git a/multimedia/wl-screenrec/files/patch-ffmpeg7 b/multimedia/wl-screenrec/files/patch-ffmpeg7
new file mode 100644
index 000000000000..392cca81ccf9
--- /dev/null
+++ b/multimedia/wl-screenrec/files/patch-ffmpeg7
@@ -0,0 +1,313 @@
+https://github.com/russelltg/wl-screenrec/commit/f73841b8d270
+https://github.com/russelltg/wl-screenrec/commit/098b9735fbc1
+
+--- Cargo.lock.orig	2024-02-16 05:09:17 UTC
++++ Cargo.lock
+@@ -67,37 +67,31 @@ name = "bindgen"
+ 
+ [[package]]
+ name = "bindgen"
+-version = "0.64.0"
++version = "0.69.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"
++checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
+ dependencies = [
+- "bitflags 1.3.2",
++ "bitflags",
+  "cexpr",
+  "clang-sys",
++ "itertools",
+  "lazy_static",
+  "lazycell",
+- "peeking_take_while",
+  "proc-macro2",
+  "quote",
+  "regex",
+  "rustc-hash",
+  "shlex",
+- "syn 1.0.109",
++ "syn",
+ ]
+ 
+ [[package]]
+ name = "bitflags"
+-version = "1.3.2"
++version = "2.5.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
++checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
+ 
+ [[package]]
+-name = "bitflags"
+-version = "2.4.2"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
+-
+-[[package]]
+ name = "cc"
+ version = "1.0.83"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+@@ -163,7 +157,7 @@ dependencies = [
+  "heck",
+  "proc-macro2",
+  "quote",
+- "syn 2.0.49",
++ "syn",
+ ]
+ 
+ [[package]]
+@@ -200,6 +194,12 @@ checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a04
+ checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4"
+ 
+ [[package]]
++name = "either"
++version = "1.12.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b"
++
++[[package]]
+ name = "errno"
+ version = "0.3.8"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+@@ -211,20 +211,20 @@ name = "ffmpeg-next"
+ 
+ [[package]]
+ name = "ffmpeg-next"
+-version = "6.1.1"
++version = "7.0.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "4e72c72e8dcf638fb0fb03f033a954691662b5dabeaa3f85a6607d101569fccd"
++checksum = "a681d69bf41d1c9edc7c6a2b09b69d0b96e9b916d200b7ec5b10de61f559eb31"
+ dependencies = [
+- "bitflags 1.3.2",
++ "bitflags",
+  "ffmpeg-sys-next",
+  "libc",
+ ]
+ 
+ [[package]]
+ name = "ffmpeg-sys-next"
+-version = "6.1.0"
++version = "7.0.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "c2529ad916d08c3562c754c21bc9b17a26c7882c0f5706cc2cd69472175f1620"
++checksum = "972a460dd8e901b737ce0482bf71a837e1751e3dd7c8f8b0a4ead808e7f174a5"
+ dependencies = [
+  "bindgen",
+  "cc",
+@@ -259,6 +259,15 @@ checksum = "9994b79e8c1a39b3166c63ae7823bb2b00831e2a96
+ checksum = "9994b79e8c1a39b3166c63ae7823bb2b00831e2a96a31399c50fe69df408eaeb"
+ 
+ [[package]]
++name = "itertools"
++version = "0.12.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
++dependencies = [
++ "either",
++]
++
++[[package]]
+ name = "itoa"
+ version = "1.0.10"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+@@ -322,7 +331,7 @@ dependencies = [
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
+ dependencies = [
+- "bitflags 2.4.2",
++ "bitflags",
+  "cfg-if",
+  "libc",
+ ]
+@@ -348,12 +357,6 @@ dependencies = [
+ ]
+ 
+ [[package]]
+-name = "peeking_take_while"
+-version = "0.1.2"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
+-
+-[[package]]
+ name = "pkg-config"
+ version = "0.3.30"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+@@ -427,7 +430,7 @@ dependencies = [
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949"
+ dependencies = [
+- "bitflags 2.4.2",
++ "bitflags",
+  "errno",
+  "libc",
+  "linux-raw-sys",
+@@ -463,7 +466,7 @@ dependencies = [
+ dependencies = [
+  "proc-macro2",
+  "quote",
+- "syn 2.0.49",
++ "syn",
+ ]
+ 
+ [[package]]
+@@ -516,17 +519,6 @@ name = "syn"
+ 
+ [[package]]
+ name = "syn"
+-version = "1.0.109"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+-dependencies = [
+- "proc-macro2",
+- "quote",
+- "unicode-ident",
+-]
+-
+-[[package]]
+-name = "syn"
+ version = "2.0.49"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496"
+@@ -553,7 +545,7 @@ dependencies = [
+ dependencies = [
+  "proc-macro2",
+  "quote",
+- "syn 2.0.49",
++ "syn",
+ ]
+ 
+ [[package]]
+@@ -594,7 +586,7 @@ dependencies = [
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f"
+ dependencies = [
+- "bitflags 2.4.2",
++ "bitflags",
+  "rustix",
+  "wayland-backend",
+  "wayland-scanner",
+@@ -606,7 +598,7 @@ dependencies = [
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4"
+ dependencies = [
+- "bitflags 2.4.2",
++ "bitflags",
+  "wayland-backend",
+  "wayland-client",
+  "wayland-scanner",
+@@ -618,7 +610,7 @@ dependencies = [
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6"
+ dependencies = [
+- "bitflags 2.4.2",
++ "bitflags",
+  "wayland-backend",
+  "wayland-client",
+  "wayland-protocols",
+@@ -787,6 +779,7 @@ dependencies = [
+  "clap",
+  "drm-fourcc",
+  "ffmpeg-next",
++ "ffmpeg-sys-next",
+  "human-size",
+  "libc",
+  "nix",
+--- Cargo.toml.orig	2024-02-16 05:09:17 UTC
++++ Cargo.toml
+@@ -28,7 +28,8 @@ wayland-protocols-wlr = { version = "0.2", features = 
+ wayland-protocols-wlr = { version = "0.2", features = ["client"] }
+ 
+ # ffmpeg-next does not support ffmpeg 6.1 yet, so grab from the 6.1 PR
+-ffmpeg-next = "6.1"
++ffmpeg-next = "7.0.1"
++ffmpeg-sys-next = "7.0.0" # need direct dep on -sys to get metadata to consume in build.rs
+ thiserror = "1.0.38"
+ drm-fourcc = "2.2.0"
+ human-size = "0.4.2"
+--- build.rs.orig	2024-05-20 06:35:34 UTC
++++ build.rs
+@@ -0,0 +1,12 @@
++use std::env;
++
++fn main() {
++    for (name, _value) in env::vars() {
++        if name.starts_with("DEP_FFMPEG_") {
++            println!(
++                r#"cargo:rustc-cfg=feature="{}""#,
++                name["DEP_FFMPEG_".len()..name.len()].to_lowercase()
++            );
++        }
++    }
++}
+\ No newline at end of file
+--- src/audio.rs.orig	2024-02-16 05:09:17 UTC
++++ src/audio.rs
+@@ -1,6 +1,6 @@ use std::{
+ use std::{
+     cmp::max,
+-    ffi::{c_int, CString},
++    ffi::{CStr, CString},
+     sync::{
+         atomic::{AtomicBool, Ordering},
+         mpsc::{channel, Receiver, RecvError, Sender, TryRecvError},
+@@ -13,7 +13,7 @@ use ffmpeg::{
+ use ffmpeg::{
+     codec::Context,
+     decoder, encoder,
+-    ffi::{av_find_input_format, av_get_default_channel_layout, AVChannelOrder},
++    ffi::{av_channel_layout_describe, av_find_input_format},
+     filter,
+     format::{self, context::Input, Sample},
+     frame, ChannelLayout, Dictionary, Format, Packet, Rational,
+@@ -220,6 +220,7 @@ impl AudioHandle {
+         let audio_decoder_rate = dec_audio.rate() as i32;
+         enc_audio.set_rate(audio_decoder_rate);
+         enc_audio.set_channel_layout(enc_audio_channel_layout);
++        #[cfg(not(feature = "ffmpeg_7_0"))] // in ffmpeg 7, this is handled by set_channel_layout
+         enc_audio.set_channels(enc_audio_channel_layout.channels());
+         let audio_encode_format = codec.formats().unwrap().next().unwrap();
+         enc_audio.set_format(audio_encode_format);
+@@ -322,24 +323,34 @@ fn audio_filter(
+ ) -> filter::Graph {
+     let mut g = ffmpeg::filter::graph::Graph::new();
+ 
+-    // let channel_format_str = avchannelformat_to_string(params.ch_layout);
+     let sample_format = input.format();
+ 
+     let ch_layout = unsafe { input.as_ptr().read().ch_layout };
+-    let ch_layout_mask = if ch_layout.order == AVChannelOrder::AV_CHANNEL_ORDER_NATIVE {
+-        unsafe { ch_layout.u.mask }
+-    } else {
+-        unsafe { av_get_default_channel_layout(input.channels() as c_int) as u64 }
++
++    let mut channel_layout_buf = [0u8; 128];
++    let channel_layout_specifier = unsafe {
++        let bytes = av_channel_layout_describe(
++            &ch_layout,
++            channel_layout_buf.as_mut_ptr().cast(),
++            channel_layout_buf.len(),
++        );
++        assert!(bytes > 0, "{:?}: {:?}", ch_layout.order, bytes);
++        std::str::from_utf8(
++            CStr::from_bytes_until_nul(&channel_layout_buf[..])
++                .unwrap()
++                .to_bytes(),
++        )
++        .unwrap()
+     };
+ 
+     g.add(
+         &filter::find("abuffer").unwrap(),
+         "in",
+         &format!(
+-            "sample_rate={}:sample_fmt={}:channel_layout={:#x}",
++            "sample_rate={}:sample_fmt={}:channel_layout={}",
+             input.rate(),
+             sample_format.name(),
+-            ch_layout_mask
++            channel_layout_specifier
+         ),
+     )
+     .unwrap();