webrtcsink: initial support for vpuenc_h264 encoder for imx8mp, default values set to cover a common streaming scenario

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1639>
This commit is contained in:
leonardo salvatore 2024-06-25 15:47:29 +02:00 committed by GStreamer Marge Bot
parent 718e757669
commit f303992e0c

View file

@ -785,6 +785,10 @@ fn configure_encoder(enc: &gst::Element, start_bitrate: u32) {
enc.set_property("max-key-frame-interval", 715827882);
enc.set_property("speed-preset", 10);
}
"vpuenc_h264" => {
enc.set_property("bitrate", start_bitrate / 1000);
enc.set_property("gop-size", 2560u32);
}
_ => (),
}
}
@ -988,6 +992,7 @@ impl VideoEncoder {
| "nvav1enc"
| "av1enc"
| "rav1enc"
| "vpuenc_h264"
)
}
@ -996,7 +1001,7 @@ impl VideoEncoder {
"vp8enc" | "vp9enc" => self.element.property::<i32>("target-bitrate"),
"av1enc" => (self.element.property::<u32>("target-bitrate") * 1000) as i32,
"x264enc" | "nvh264enc" | "vaapih264enc" | "vaapivp8enc" | "qsvh264enc"
| "nvav1enc" => (self.element.property::<u32>("bitrate") * 1000) as i32,
| "nvav1enc" | "vpuenc_h264" => (self.element.property::<u32>("bitrate") * 1000) as i32,
"nvv4l2h264enc" | "nvv4l2vp8enc" | "nvv4l2vp9enc" | "rav1enc" => {
(self.element.property::<u32>("bitrate")) as i32
}
@ -1031,7 +1036,7 @@ impl VideoEncoder {
.element
.set_property("target-bitrate", (bitrate / 1000) as u32),
"x264enc" | "nvh264enc" | "vaapih264enc" | "vaapivp8enc" | "qsvh264enc"
| "nvav1enc" => {
| "nvav1enc" | "vpuenc_h264" => {
self.element
.set_property("bitrate", (bitrate / 1000) as u32);
}