mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 04:51:09 +00:00
video-info: Use gst_video_info_set_interlaced_format() when building for 1.16 and having an interlace-mode set
This ensures that the plane information is filled correctly.
This commit is contained in:
parent
6871e501db
commit
38f3d3eff2
1 changed files with 32 additions and 10 deletions
|
@ -271,6 +271,8 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
unsafe {
|
||||
let mut info = mem::uninitialized();
|
||||
|
||||
#[cfg(not(feature = "v1_16"))]
|
||||
{
|
||||
gst_video_sys::gst_video_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
|
@ -278,13 +280,33 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
self.height,
|
||||
);
|
||||
|
||||
if info.finfo.is_null() || info.width <= 0 || info.height <= 0 {
|
||||
return None;
|
||||
}
|
||||
|
||||
if let Some(interlace_mode) = self.interlace_mode {
|
||||
info.interlace_mode = interlace_mode.to_glib();
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "v1_16")]
|
||||
{
|
||||
if let Some(interlace_mode) = self.interlace_mode {
|
||||
gst_video_sys::gst_video_info_set_interlaced_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
interlace_mode.to_glib(),
|
||||
self.width,
|
||||
self.height,
|
||||
);
|
||||
} else {
|
||||
gst_video_sys::gst_video_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
self.width,
|
||||
self.height,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if info.finfo.is_null() || info.width <= 0 || info.height <= 0 {
|
||||
return None;
|
||||
}
|
||||
|
||||
if let Some(flags) = self.flags {
|
||||
info.flags = flags.to_glib();
|
||||
|
|
Loading…
Reference in a new issue