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:
Sebastian Dröge 2025-08-06 12:19:44 +03:00 committed by GStreamer Marge Bot
parent 0727e5a46c
commit 1b39356e72

View file

@ -404,21 +404,11 @@ impl<'a> VideoInfoBuilder<'a> {
} }
if let Some(offset) = self.offset { if let Some(offset) = self.offset {
if offset.len() != ((*info.finfo).n_planes as usize) { info.offset[..offset.len()].copy_from_slice(offset);
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]);
} }
if let Some(stride) = self.stride { if let Some(stride) = self.stride {
if stride.len() != ((*info.finfo).n_planes as usize) { info.stride[..stride.len()].copy_from_slice(stride);
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]);
} }
if let Some(multiview_mode) = self.multiview_mode { if let Some(multiview_mode) = self.multiview_mode {