mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-15 12:25:20 +00:00
webrtcsink: fix pipeline when input caps contain max-framerate
GstVideoInfo uses max-framerate to compute its fps, but this leads to issues in videorate when framerate is actually 0/1. Fix this by stripping away max-framerate from input caps Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1285>
This commit is contained in:
parent
fc75502ee4
commit
b4b2ca9a82
1 changed files with 12 additions and 1 deletions
|
@ -2351,7 +2351,18 @@ impl WebRTCSink {
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.for_each(|(_, mut stream)| {
|
.for_each(|(_, mut stream)| {
|
||||||
if stream.sink_pad.upcast_ref::<gst::Pad>() == pad {
|
if stream.sink_pad.upcast_ref::<gst::Pad>() == pad {
|
||||||
stream.in_caps = Some(e.caps().to_owned());
|
// We do not want VideoInfo to consider max-framerate
|
||||||
|
// when computing fps, so we strip it away here
|
||||||
|
let mut caps = e.caps().to_owned();
|
||||||
|
{
|
||||||
|
let mut_caps = caps.get_mut().unwrap();
|
||||||
|
if let Some(s) = mut_caps.structure_mut(0) {
|
||||||
|
if s.has_name("video/x-raw") {
|
||||||
|
s.remove_field("max-framerate");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stream.in_caps = Some(caps.to_owned());
|
||||||
} else if stream.in_caps.is_none() {
|
} else if stream.in_caps.is_none() {
|
||||||
all_pads_have_caps = false;
|
all_pads_have_caps = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue