mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +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,21 +271,43 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
unsafe {
|
||||
let mut info = mem::uninitialized();
|
||||
|
||||
gst_video_sys::gst_video_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
self.width,
|
||||
self.height,
|
||||
);
|
||||
#[cfg(not(feature = "v1_16"))]
|
||||
{
|
||||
gst_video_sys::gst_video_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
self.width,
|
||||
self.height,
|
||||
);
|
||||
|
||||
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(interlace_mode) = self.interlace_mode {
|
||||
info.interlace_mode = interlace_mode.to_glib();
|
||||
}
|
||||
|
||||
if let Some(flags) = self.flags {
|
||||
info.flags = flags.to_glib();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue