remove u128 compare
This commit is contained in:
parent
633253647f
commit
0d0957cea5
@ -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 {
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user