improve video, ignore same image

This commit is contained in:
rustdesk
2022-04-24 02:50:28 +08:00
parent 264db496ff
commit 4d5d0a4c62
6 changed files with 37 additions and 8 deletions

View File

@@ -29,10 +29,12 @@ impl Frame {
}
}
#[inline]
pub fn inner(&self) -> &[u8] {
self.inner
}
pub fn nv12_to_i420<'a>(&'a mut self, w: usize, h: usize, i420: &'a mut Vec<u8>) {
if self.inner.is_empty() {
return;
}
unsafe {
let plane0 = IOSurfaceGetBaseAddressOfPlane(self.surface, 0);
let stride0 = IOSurfaceGetBytesPerRowOfPlane(self.surface, 0);