mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -49,7 +49,7 @@ use scrap::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
common::{self, is_keyboard_mode_supported},
|
||||
common::{self, is_keyboard_mode_supported, STRIDE_ALIGN},
|
||||
server::video_service::{SCRAP_X11_REF_URL, SCRAP_X11_REQUIRED},
|
||||
};
|
||||
|
||||
@@ -949,7 +949,7 @@ impl VideoHandler {
|
||||
let fmt = ImageFormat::ABGR;
|
||||
#[cfg(not(all(target_os = "windows", feature = "flutter_texture_render")))]
|
||||
let fmt = ImageFormat::ARGB;
|
||||
let res = self.decoder.handle_video_frame(frame, fmt, &mut self.rgb);
|
||||
let res = self.decoder.handle_video_frame(frame, STRIDE_ALIGN, fmt, &mut self.rgb);
|
||||
if self.record {
|
||||
self.recorder
|
||||
.lock()
|
||||
|
||||
@@ -39,6 +39,11 @@ pub const CLIPBOARD_INTERVAL: u64 = 333;
|
||||
|
||||
pub const SYNC_PEER_INFO_DISPLAYS: i32 = 1;
|
||||
|
||||
#[cfg(all(target_os = "macos", feature = "flutter_texture_render"))]
|
||||
pub const STRIDE_ALIGN: usize = 16;
|
||||
#[cfg(not(all(target_os = "macos", feature = "flutter_texture_render")))]
|
||||
pub const STRIDE_ALIGN: usize = 1;
|
||||
|
||||
// the executable name of the portable version
|
||||
pub const PORTABLE_APPNAME_RUNTIME_ENV_KEY: &str = "RUSTDESK_APPNAME";
|
||||
|
||||
|
||||
@@ -206,7 +206,9 @@ impl VideoRenderer {
|
||||
self.width = width;
|
||||
self.height = height;
|
||||
self.data_len = if width > 0 && height > 0 {
|
||||
(width * height * 4) as usize
|
||||
let sa1 = crate::common::STRIDE_ALIGN - 1;
|
||||
let w = (width as usize + sa1) & !sa1;
|
||||
w * (height as usize) * 4
|
||||
} else {
|
||||
0
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user