mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-01 17:23:48 +00:00
webrtcsink: Move videorate before videoconvert and videoscale
Since videorate has drop-only=true, this could reduce the number of frames to convert and scale. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2402>
This commit is contained in:
parent
44a632811e
commit
78c8d4df55
1 changed files with 6 additions and 6 deletions
|
@ -593,7 +593,7 @@ fn make_converter_for_video_caps(caps: &gst::Caps, codec: &Codec) -> Result<gst:
|
|||
|
||||
let ret = gst::Bin::default();
|
||||
|
||||
let (head, mut tail) = {
|
||||
let (mut head, tail) = {
|
||||
if let Some(feature) = caps.features(0) {
|
||||
if feature.contains(NVMM_MEMORY_FEATURE)
|
||||
// NVIDIA V4L2 encoders require NVMM memory as input and that requires using the
|
||||
|
@ -677,19 +677,19 @@ fn make_converter_for_video_caps(caps: &gst::Caps, codec: &Codec) -> Result<gst:
|
|||
}
|
||||
};
|
||||
|
||||
ret.add_pad(&gst::GhostPad::with_target(&head.static_pad("sink").unwrap()).unwrap())
|
||||
.unwrap();
|
||||
|
||||
if video_info.fps().numer() != 0 {
|
||||
let vrate = make_element("videorate", None)?;
|
||||
vrate.set_property("drop-only", true);
|
||||
vrate.set_property("skip-to-first", true);
|
||||
|
||||
ret.add(&vrate)?;
|
||||
tail.link(&vrate)?;
|
||||
tail = vrate;
|
||||
vrate.link(&head)?;
|
||||
head = vrate;
|
||||
}
|
||||
|
||||
ret.add_pad(&gst::GhostPad::with_target(&head.static_pad("sink").unwrap()).unwrap())
|
||||
.unwrap();
|
||||
|
||||
ret.add_pad(&gst::GhostPad::with_target(&tail.static_pad("src").unwrap()).unwrap())
|
||||
.unwrap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue