webrtcsink: reset default values when disabling congestion control

This commit is contained in:
Mathieu Duponchelle 2021-12-10 03:33:02 +01:00
parent d230345d90
commit a4df10b112
2 changed files with 5 additions and 2 deletions

View file

@ -111,8 +111,6 @@ async fn run(args: Args) -> Result<(), Error> {
let listener = try_socket.expect("Failed to bind");
info!("Listening on: {}", addr);
info!("Disable FEC: {}", args.disable_fec);
let pipeline_str = format!(
"webrtcsink name=ws do-retransmission={} do-fec={} congestion-control={} \
uridecodebin name=d uri={} \

View file

@ -2217,6 +2217,11 @@ impl ObjectImpl for WebRTCSink {
match new_heuristic {
WebRTCSinkCongestionControl::Disabled => {
consumer.congestion_controller.take();
for encoder in &mut consumer.encoders {
encoder
.set_bitrate(&self.instance(), consumer.max_bitrate as i32);
encoder.transceiver.set_property("fec-percentage", 50u32);
}
}
WebRTCSinkCongestionControl::Homegrown => {
let _ = consumer.congestion_controller.insert(