Enable RTX in the Rust sendrecv example only for video

Chrome et al don't like RTX for audio streams.
This commit is contained in:
Sebastian Dröge 2019-07-09 14:50:19 +03:00
parent 8606b54671
commit a8fca4037d

View file

@ -475,21 +475,6 @@ impl App {
.unwrap();
}
let app_clone = self.downgrade();
self.0
.webrtcbin
.connect("on-new-transceiver", false, move |values| {
let _webrtc = values[0].get::<gst::Element>().unwrap();
let transceiver = values[1].get::<glib::Object>().unwrap();
let app = upgrade_weak!(app_clone, None);
transceiver.set_property("do-nack", &app.0.rtx).unwrap();
None
})
.unwrap();
// Whenever there is a new ICE candidate, send it to the peer
let app_clone = self.downgrade();
self.0
@ -523,6 +508,19 @@ impl App {
self.add_video_source()?;
self.add_audio_source()?;
// Enable RTX only for video, Chrome etc al fail SDP negotiation otherwise
if self.0.rtx {
let transceiver = self
.0
.webrtcbin
.emit("get-transceiver", &[&0i32])
.unwrap()
.unwrap()
.get::<glib::Object>()
.unwrap();
transceiver.set_property("do-nack", &true).unwrap();
}
Ok(())
}