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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1970>
This commit is contained in:
Taruntej Kanakamalla 2024-12-05 17:23:26 +05:30
parent be6074f4f4
commit c9a0731e61

View file

@ -762,8 +762,8 @@ fn configure_encoder(enc: &gst::Element, start_bitrate: u32) {
"openh264enc" => { "openh264enc" => {
enc.set_property("bitrate", start_bitrate); enc.set_property("bitrate", start_bitrate);
enc.set_property("gop-size", 2560u32); enc.set_property("gop-size", 2560u32);
enc.set_property("rate-control", 1); enc.set_property_from_str("rate-control", "bitrate");
enc.set_property("complexity", 0); enc.set_property_from_str("complexity", "low");
enc.set_property("background-detection", false); enc.set_property("background-detection", false);
enc.set_property("scene-change-detection", false); enc.set_property("scene-change-detection", false);
} }