mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-22 17:08:18 +00:00
webrtcsink: don't panic on failure to request pad from webrtcbin
webrtcbin will refuse pad requests for all sorts of reasons, and should be logging an error when doing so, simply post an error message and let the application deal with it, the reason for the refusal should hopefully be available in the logs to the user. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1399>
This commit is contained in:
parent
d644bcd79a
commit
cf1c7600a2
1 changed files with 18 additions and 6 deletions
|
@ -1472,9 +1472,15 @@ impl BaseWebRTCSink {
|
|||
let ssrc = BaseWebRTCSink::generate_ssrc(element, webrtc_pads);
|
||||
let media_idx = webrtc_pads.len() as i32;
|
||||
|
||||
let pad = webrtcbin
|
||||
.request_pad_simple(&format!("sink_{}", media_idx))
|
||||
.unwrap();
|
||||
let Some(pad) = webrtcbin.request_pad_simple(&format!("sink_{}", media_idx)) else {
|
||||
gst::error!(CAT, obj: element, "Failed to request pad from webrtcbin");
|
||||
gst::element_error!(
|
||||
element,
|
||||
gst::StreamError::Failed,
|
||||
["Failed to request pad from webrtcbin"]
|
||||
);
|
||||
return;
|
||||
};
|
||||
|
||||
let transceiver = pad.property::<gst_webrtc::WebRTCRTPTransceiver>("transceiver");
|
||||
|
||||
|
@ -1567,9 +1573,15 @@ impl BaseWebRTCSink {
|
|||
payloader_caps
|
||||
);
|
||||
|
||||
let pad = webrtcbin
|
||||
.request_pad_simple(&format!("sink_{}", media_idx))
|
||||
.unwrap();
|
||||
let Some(pad) = webrtcbin.request_pad_simple(&format!("sink_{}", media_idx)) else {
|
||||
gst::error!(CAT, obj: element, "Failed to request pad from webrtcbin");
|
||||
gst::element_error!(
|
||||
element,
|
||||
gst::StreamError::Failed,
|
||||
["Failed to request pad from webrtcbin"]
|
||||
);
|
||||
return;
|
||||
};
|
||||
|
||||
let transceiver = pad.property::<gst_webrtc::WebRTCRTPTransceiver>("transceiver");
|
||||
|
||||
|
|
Loading…
Reference in a new issue