mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-22 18:16:28 +00:00
webrtcsrc: make updated transceiver retrieval backward compatible
In 1.24 and before transceivers for remote sendonly medias are only created at answer time. If that is the case, we can add the transceiver ourself, it will get associated when creating the answer. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1853>
This commit is contained in:
parent
82d0eaf438
commit
ef06421a25
1 changed files with 7 additions and 2 deletions
|
@ -844,10 +844,15 @@ impl Session {
|
|||
obj = element,
|
||||
"Getting transceiver for {stream_id} and index {i} with caps: {caps:#?}"
|
||||
);
|
||||
let transceiver = webrtcbin.emit_by_name::<gst_webrtc::WebRTCRTPTransceiver>(
|
||||
let transceiver = webrtcbin.emit_by_name::<Option<gst_webrtc::WebRTCRTPTransceiver>>(
|
||||
"get-transceiver",
|
||||
&[&(i as i32)],
|
||||
);
|
||||
).unwrap_or_else(|| {
|
||||
gst::warning!(CAT, "Transceiver for idx {i} does not exist, GStreamer <= 1.24, adding it ourself");
|
||||
webrtcbin.emit_by_name::<gst_webrtc::WebRTCRTPTransceiver>(
|
||||
"add-transceiver",
|
||||
&[&gst_webrtc::WebRTCRTPTransceiverDirection::Recvonly, &caps])
|
||||
});
|
||||
|
||||
transceiver.set_property("do_nack", do_retransmission);
|
||||
transceiver.set_property("fec-type", gst_webrtc::WebRTCFECType::UlpRed);
|
||||
|
|
Loading…
Reference in a new issue