mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 23:11:01 +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/1276>
This commit is contained in:
parent
0331522128
commit
9707bb89e6
1 changed files with 12 additions and 1 deletions
|
@ -3035,7 +3035,18 @@ impl BaseWebRTCSink {
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.for_each(|(_, stream)| {
|
.for_each(|(_, 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());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue