mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-02 09:43:48 +00:00
webrtcsink: Don't reject caps events if the codec_data changes
We only care if actually incompatible changes are happening, which would be reflected by other caps fields. Use the same codec caps cleanup function as elsewhere for this purpose. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2315>
This commit is contained in:
parent
88dbe2dc4e
commit
7cd277e56b
1 changed files with 10 additions and 8 deletions
|
@ -4184,10 +4184,15 @@ impl BaseWebRTCSink {
|
||||||
|
|
||||||
/// Check if the caps of a sink pad can be changed from `current` to `new` without requiring a WebRTC renegotiation
|
/// Check if the caps of a sink pad can be changed from `current` to `new` without requiring a WebRTC renegotiation
|
||||||
fn input_caps_change_allowed(&self, current: &gst::CapsRef, new: &gst::CapsRef) -> bool {
|
fn input_caps_change_allowed(&self, current: &gst::CapsRef, new: &gst::CapsRef) -> bool {
|
||||||
let Some(current) = current.structure(0) else {
|
let mut current = cleanup_codec_caps(current.to_owned());
|
||||||
|
let current = current.get_mut().unwrap();
|
||||||
|
let mut new = cleanup_codec_caps(new.to_owned());
|
||||||
|
let new = new.get_mut().unwrap();
|
||||||
|
|
||||||
|
let Some(current) = current.structure_mut(0) else {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
let Some(new) = new.structure(0) else {
|
let Some(new) = new.structure_mut(0) else {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4195,9 +4200,6 @@ impl BaseWebRTCSink {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut current = current.to_owned();
|
|
||||||
let mut new = new.to_owned();
|
|
||||||
|
|
||||||
// Allow changes of fields which should not be part of the SDP, and so can be updated without requiring
|
// Allow changes of fields which should not be part of the SDP, and so can be updated without requiring
|
||||||
// a renegotiation.
|
// a renegotiation.
|
||||||
let caps_type = current.name();
|
let caps_type = current.name();
|
||||||
|
@ -4215,7 +4217,7 @@ impl BaseWebRTCSink {
|
||||||
new.remove_fields(VIDEO_ALLOWED_CHANGES.iter().copied());
|
new.remove_fields(VIDEO_ALLOWED_CHANGES.iter().copied());
|
||||||
|
|
||||||
// Multiview can be part of SDP, but missing field should be treated the same as mono view.
|
// Multiview can be part of SDP, but missing field should be treated the same as mono view.
|
||||||
fn remove_multiview(s: &mut gst::Structure) {
|
fn remove_multiview(s: &mut gst::StructureRef) {
|
||||||
let is_mono = match s.get::<VideoMultiviewMode>("multiview-mode") {
|
let is_mono = match s.get::<VideoMultiviewMode>("multiview-mode") {
|
||||||
Ok(mode) => mode == VideoMultiviewMode::Mono,
|
Ok(mode) => mode == VideoMultiviewMode::Mono,
|
||||||
Err(_) => true,
|
Err(_) => true,
|
||||||
|
@ -4224,8 +4226,8 @@ impl BaseWebRTCSink {
|
||||||
s.remove_fields(["multiview-mode", "multiview-flags"])
|
s.remove_fields(["multiview-mode", "multiview-flags"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
remove_multiview(&mut current);
|
remove_multiview(current);
|
||||||
remove_multiview(&mut new);
|
remove_multiview(new);
|
||||||
} else if caps_type.starts_with("audio/") {
|
} else if caps_type.starts_with("audio/") {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue