remove u128 compare
This commit is contained in:
parent
633253647f
commit
0d0957cea5
@ -13,7 +13,7 @@ lazy_static! {
|
|||||||
pub struct Capturer {
|
pub struct Capturer {
|
||||||
display: Display,
|
display: Display,
|
||||||
bgra: Vec<u8>,
|
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 {
|
impl Capturer {
|
||||||
|
@ -44,8 +44,8 @@ pub mod record;
|
|||||||
mod vpx;
|
mod vpx;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn would_block_if_equal(old: &mut Vec<u128>, b: &[u8]) -> std::io::Result<()> {
|
pub fn would_block_if_equal(old: &mut Vec<u8>, b: &[u8]) -> std::io::Result<()> {
|
||||||
let b = unsafe { std::slice::from_raw_parts::<u128>(b.as_ptr() as _, b.len() / 16) };
|
// does this really help?
|
||||||
if b == &old[..] {
|
if b == &old[..] {
|
||||||
return Err(std::io::ErrorKind::WouldBlock.into());
|
return Err(std::io::ErrorKind::WouldBlock.into());
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ pub struct Capturer {
|
|||||||
frame: Arc<Mutex<Option<quartz::Frame>>>,
|
frame: Arc<Mutex<Option<quartz::Frame>>>,
|
||||||
use_yuv: bool,
|
use_yuv: bool,
|
||||||
i420: Vec<u8>,
|
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 {
|
impl Capturer {
|
||||||
|
@ -50,7 +50,7 @@ pub struct Capturer {
|
|||||||
rotated: Vec<u8>,
|
rotated: Vec<u8>,
|
||||||
gdi_capturer: Option<CapturerGDI>,
|
gdi_capturer: Option<CapturerGDI>,
|
||||||
gdi_buffer: Vec<u8>,
|
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 {
|
impl Capturer {
|
||||||
|
@ -123,7 +123,7 @@ pub struct PipeWireRecorder {
|
|||||||
appsink: AppSink,
|
appsink: AppSink,
|
||||||
width: usize,
|
width: usize,
|
||||||
height: 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 {
|
impl PipeWireRecorder {
|
||||||
|
@ -14,7 +14,7 @@ pub struct Capturer {
|
|||||||
size: usize,
|
size: usize,
|
||||||
use_yuv: bool,
|
use_yuv: bool,
|
||||||
yuv: Vec<u8>,
|
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 {
|
impl Capturer {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user