From c9a0731e6186736b03c49823aadfa2b51ca770a0 Mon Sep 17 00:00:00 2001 From: Taruntej Kanakamalla Date: Thu, 5 Dec 2024 17:23:26 +0530 Subject: [PATCH] webrtc: use the nick to set enum type properties on openh264enc The properties `rate-control` and `complexity` are of enum types and passing a gint value is resulting in a panic. So pass the corresponding nick of the enum value instead Part-of: --- net/webrtc/src/webrtcsink/imp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index 2330d3db..8927bb67 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -762,8 +762,8 @@ fn configure_encoder(enc: &gst::Element, start_bitrate: u32) { "openh264enc" => { enc.set_property("bitrate", start_bitrate); enc.set_property("gop-size", 2560u32); - enc.set_property("rate-control", 1); - enc.set_property("complexity", 0); + enc.set_property_from_str("rate-control", "bitrate"); + enc.set_property_from_str("complexity", "low"); enc.set_property("background-detection", false); enc.set_property("scene-change-detection", false); }