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/1764>
This commit is contained in:
Sebastian Dröge 2025-08-06 12:19:44 +03:00 committed by Backport Bot
parent baa81b0652
commit 5532d2f10f

View file

@ -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 {