mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-01 01:13:48 +00:00
video-info: Remove stride/offset checks
For formats like DMA_DRM it does not work and we'll have to trust the caller to set reasonable values here, just like we already do with other values. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/561 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1757>
This commit is contained in:
parent
0727e5a46c
commit
1b39356e72
1 changed files with 2 additions and 12 deletions
|
@ -404,21 +404,11 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
}
|
||||
|
||||
if let Some(offset) = self.offset {
|
||||
if offset.len() != ((*info.finfo).n_planes as usize) {
|
||||
return Err(glib::bool_error!("Failed to build VideoInfo"));
|
||||
}
|
||||
|
||||
let n_planes = (*info.finfo).n_planes as usize;
|
||||
info.offset[..n_planes].copy_from_slice(&offset[..n_planes]);
|
||||
info.offset[..offset.len()].copy_from_slice(offset);
|
||||
}
|
||||
|
||||
if let Some(stride) = self.stride {
|
||||
if stride.len() != ((*info.finfo).n_planes as usize) {
|
||||
return Err(glib::bool_error!("Failed to build VideoInfo"));
|
||||
}
|
||||
|
||||
let n_planes = (*info.finfo).n_planes as usize;
|
||||
info.stride[..n_planes].copy_from_slice(&stride[..n_planes]);
|
||||
info.stride[..stride.len()].copy_from_slice(stride);
|
||||
}
|
||||
|
||||
if let Some(multiview_mode) = self.multiview_mode {
|
||||
|
|
Loading…
Reference in a new issue