From f4d2bd1a5d2919eb503fe461419b763f67308a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 28 Nov 2024 23:11:20 +0200 Subject: [PATCH] webrtcsink: Set caps-change-mode=delayed on encoder capsfilter Otherwise when changing the target caps (e.g. for reducing quality) there is a race condition between buffers between the converter elements and renegotiation. For example, videoconvertscale might've output a 1920x1080 buffer, then the capsfilter is configured to 1280x720, the buffer arrives in videorate, videorate notices that renegotiation is pending, tries to renegotiate and ends up with EMPTY caps because it can only change the framerate but not the resolution. Part-of: --- net/webrtc/src/utils.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/net/webrtc/src/utils.rs b/net/webrtc/src/utils.rs index 4f9a1e3e..8620d808 100644 --- a/net/webrtc/src/utils.rs +++ b/net/webrtc/src/utils.rs @@ -716,6 +716,7 @@ impl Codec { gst::ElementFactory::make("capsfilter") .property("caps", &caps) + .property_from_str("caps-change-mode", "delayed") .build() .with_context(|| "Creating capsfilter caps") }