mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-02-18 03:55:36 +00:00
Fix various clippy warnings in gstreamer-video
This commit is contained in:
parent
e0e0f56b52
commit
a0ba290d4d
2 changed files with 6 additions and 8 deletions
|
@ -138,11 +138,11 @@ impl VideoFormatInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn scale_width(&self, component: u8, width: u32) -> u32 {
|
pub fn scale_width(&self, component: u8, width: u32) -> u32 {
|
||||||
(-((-(width as i64)) >> self.w_sub()[component as usize])) as u32
|
(-((-(i64::from(width))) >> self.w_sub()[component as usize])) as u32
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn scale_height(&self, component: u8, height: u32) -> u32 {
|
pub fn scale_height(&self, component: u8, height: u32) -> u32 {
|
||||||
(-((-(height as i64)) >> self.h_sub()[component as usize])) as u32
|
(-((-(i64::from(height))) >> self.h_sub()[component as usize])) as u32
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: pack/unpack
|
// TODO: pack/unpack
|
||||||
|
|
|
@ -242,9 +242,8 @@ impl<'a> VideoInfoBuilder<'a> {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in 0..((*info.finfo).n_planes as usize) {
|
let n_planes = (*info.finfo).n_planes as usize;
|
||||||
info.offset[i] = offset[i];
|
info.offset[..n_planes].copy_from_slice(&offset[..n_planes]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(stride) = self.stride {
|
if let Some(stride) = self.stride {
|
||||||
|
@ -252,9 +251,8 @@ impl<'a> VideoInfoBuilder<'a> {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in 0..((*info.finfo).n_planes as usize) {
|
let n_planes = (*info.finfo).n_planes as usize;
|
||||||
info.stride[i] = stride[i];
|
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 {
|
||||||
|
|
Loading…
Reference in a new issue