frame/video: get linesize through self.stride()
This commit is contained in:
parent
27d1e7a3fa
commit
8b4693d04c
@ -298,7 +298,7 @@ impl Video {
|
|||||||
unsafe {
|
unsafe {
|
||||||
slice::from_raw_parts(
|
slice::from_raw_parts(
|
||||||
mem::transmute((*self.as_ptr()).data[index]),
|
mem::transmute((*self.as_ptr()).data[index]),
|
||||||
(*self.as_ptr()).linesize[index] as usize * self.plane_height(index) as usize / mem::size_of::<T>())
|
self.stride(index) * self.plane_height(index) as usize / mem::size_of::<T>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ impl Video {
|
|||||||
unsafe {
|
unsafe {
|
||||||
slice::from_raw_parts_mut(
|
slice::from_raw_parts_mut(
|
||||||
mem::transmute((*self.as_mut_ptr()).data[index]),
|
mem::transmute((*self.as_mut_ptr()).data[index]),
|
||||||
(*self.as_ptr()).linesize[index] as usize * self.plane_height(index) as usize / mem::size_of::<T>())
|
self.stride(index) * self.plane_height(index) as usize / mem::size_of::<T>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ impl Video {
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
slice::from_raw_parts((*self.as_ptr()).data[index],
|
slice::from_raw_parts((*self.as_ptr()).data[index],
|
||||||
(*self.as_ptr()).linesize[index] as usize * self.plane_height(index) as usize)
|
self.stride(index) * self.plane_height(index) as usize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ impl Video {
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
slice::from_raw_parts_mut((*self.as_mut_ptr()).data[index],
|
slice::from_raw_parts_mut((*self.as_mut_ptr()).data[index],
|
||||||
(*self.as_ptr()).linesize[index] as usize * self.plane_height(index) as usize)
|
self.stride(index) * self.plane_height(index) as usize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user