remove u128 compare

This commit is contained in:
rustdesk 2022-12-26 17:44:29 +08:00
parent 633253647f
commit 0d0957cea5
6 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,7 @@ lazy_static! {
pub struct Capturer {
display: Display,
bgra: Vec<u8>,
saved_raw_data: Vec<u128>, // for faster compare and copy
saved_raw_data: Vec<u8>, // for faster compare and copy
}
impl Capturer {

View File

@ -44,8 +44,8 @@ pub mod record;
mod vpx;
#[inline]
pub fn would_block_if_equal(old: &mut Vec<u128>, b: &[u8]) -> std::io::Result<()> {
let b = unsafe { std::slice::from_raw_parts::<u128>(b.as_ptr() as _, b.len() / 16) };
pub fn would_block_if_equal(old: &mut Vec<u8>, b: &[u8]) -> std::io::Result<()> {
// does this really help?
if b == &old[..] {
return Err(std::io::ErrorKind::WouldBlock.into());
}

View File

@ -8,7 +8,7 @@ pub struct Capturer {
frame: Arc<Mutex<Option<quartz::Frame>>>,
use_yuv: bool,
i420: Vec<u8>,
saved_raw_data: Vec<u128>, // for faster compare and copy
saved_raw_data: Vec<u8>, // for faster compare and copy
}
impl Capturer {

View File

@ -50,7 +50,7 @@ pub struct Capturer {
rotated: Vec<u8>,
gdi_capturer: Option<CapturerGDI>,
gdi_buffer: Vec<u8>,
saved_raw_data: Vec<u128>, // for faster compare and copy
saved_raw_data: Vec<u8>, // for faster compare and copy
}
impl Capturer {

View File

@ -123,7 +123,7 @@ pub struct PipeWireRecorder {
appsink: AppSink,
width: usize,
height: usize,
saved_raw_data: Vec<u128>, // for faster compare and copy
saved_raw_data: Vec<u8>, // for faster compare and copy
}
impl PipeWireRecorder {

View File

@ -14,7 +14,7 @@ pub struct Capturer {
size: usize,
use_yuv: bool,
yuv: Vec<u8>,
saved_raw_data: Vec<u128>, // for faster compare and copy
saved_raw_data: Vec<u8>, // for faster compare and copy
}
impl Capturer {