Differentiate stride align between encoding and decoding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
c8ae6a3ba3
commit
0c3ccb3f60
@ -49,7 +49,7 @@ use scrap::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
common::{self, is_keyboard_mode_supported, STRIDE_ALIGN},
|
common::{self, is_keyboard_mode_supported, STRIDE_ALIGN_RGBA_OUTPUT},
|
||||||
server::video_service::{SCRAP_X11_REF_URL, SCRAP_X11_REQUIRED},
|
server::video_service::{SCRAP_X11_REF_URL, SCRAP_X11_REQUIRED},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -944,7 +944,7 @@ impl VideoHandler {
|
|||||||
}
|
}
|
||||||
match &vf.union {
|
match &vf.union {
|
||||||
Some(frame) => {
|
Some(frame) => {
|
||||||
let res = self.decoder.handle_video_frame(frame, STRIDE_ALIGN, ImageFormat::ARGB, &mut self.rgb);
|
let res = self.decoder.handle_video_frame(frame, STRIDE_ALIGN_RGBA_OUTPUT, ImageFormat::ARGB, &mut self.rgb);
|
||||||
if self.record {
|
if self.record {
|
||||||
self.recorder
|
self.recorder
|
||||||
.lock()
|
.lock()
|
||||||
|
@ -42,9 +42,9 @@ pub const SYNC_PEER_INFO_DISPLAYS: i32 = 1;
|
|||||||
#[cfg(all(target_os = "macos", feature = "flutter_texture_render"))]
|
#[cfg(all(target_os = "macos", feature = "flutter_texture_render"))]
|
||||||
// https://developer.apple.com/forums/thread/712709
|
// https://developer.apple.com/forums/thread/712709
|
||||||
// Memory alignment should be multiple of 64.
|
// Memory alignment should be multiple of 64.
|
||||||
pub const STRIDE_ALIGN: usize = 64;
|
pub const STRIDE_ALIGN_RGBA_OUTPUT: usize = 64;
|
||||||
#[cfg(not(all(target_os = "macos", feature = "flutter_texture_render")))]
|
#[cfg(not(all(target_os = "macos", feature = "flutter_texture_render")))]
|
||||||
pub const STRIDE_ALIGN: usize = 1;
|
pub const STRIDE_ALIGN_RGBA_OUTPUT: usize = 1;
|
||||||
|
|
||||||
// the executable name of the portable version
|
// the executable name of the portable version
|
||||||
pub const PORTABLE_APPNAME_RUNTIME_ENV_KEY: &str = "RUSTDESK_APPNAME";
|
pub const PORTABLE_APPNAME_RUNTIME_ENV_KEY: &str = "RUSTDESK_APPNAME";
|
||||||
|
@ -206,7 +206,7 @@ impl VideoRenderer {
|
|||||||
self.width = width;
|
self.width = width;
|
||||||
self.height = height;
|
self.height = height;
|
||||||
self.data_len = if width > 0 && height > 0 {
|
self.data_len = if width > 0 && height > 0 {
|
||||||
let sa1 = crate::common::STRIDE_ALIGN - 1;
|
let sa1 = crate::common::STRIDE_ALIGN_RGBA_OUTPUT - 1;
|
||||||
let row_bytes = (width as usize * 4 + sa1) & !sa1;
|
let row_bytes = (width as usize * 4 + sa1) & !sa1;
|
||||||
row_bytes * height as usize
|
row_bytes * height as usize
|
||||||
} else {
|
} else {
|
||||||
@ -226,7 +226,7 @@ impl VideoRenderer {
|
|||||||
rgba.len() as _,
|
rgba.len() as _,
|
||||||
self.width as _,
|
self.width as _,
|
||||||
self.height as _,
|
self.height as _,
|
||||||
crate::common::STRIDE_ALIGN as _,
|
crate::common::STRIDE_ALIGN_RGBA_OUTPUT as _,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user