From e1cca97728dc210dfab56c52eb8c77f6784019ec Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 1 Aug 2024 15:42:40 +0300 Subject: [PATCH] video/gtk4: Move the dmabuf cfg to the correct bracket level This was defined one bracket above, which was causing the gst-gl codepath below to also be disabled when there was no dmabuf feature enabled. This was also resulting in the following warning as we were never creating the MappedFrame::GL vartiant due to this ``` warning: unused variable: `wrapped_context` --> video/gtk4/src/sink/frame.rs:541:85 | 541 | ...", feature = "gst-gl"))] wrapped_context: Option< | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_wrapped_context` | = note: `#[warn(unused_variables)]` on by default warning: variant `GL` is never constructed --> video/gtk4/src/sink/frame.rs:80:5 | 74 | enum MappedFrame { | ----------- variant in this enum ... ``` Move the cfg to the appropriate place where it encaplsulates only the dmabuf related code. Part-of: --- video/gtk4/src/sink/frame.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/gtk4/src/sink/frame.rs b/video/gtk4/src/sink/frame.rs index a2607748..65b0c007 100644 --- a/video/gtk4/src/sink/frame.rs +++ b/video/gtk4/src/sink/frame.rs @@ -483,10 +483,10 @@ impl Frame { #[allow(unused_mut)] let mut frame = None; - #[cfg(all(target_os = "linux", feature = "dmabuf"))] { // Check we received a buffer with dmabuf memory and if so do some checks before // passing it onwards + #[cfg(all(target_os = "linux", feature = "dmabuf"))] if frame.is_none() && buffer .peek_memory(0)