From 8d90c5a93b662ea27916635b534812996d84281c Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 24 Dec 2021 12:40:47 +0800 Subject: [PATCH] change codec cpu usage to 0 --- src/client.rs | 2 +- src/server/video_service.rs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/client.rs b/src/client.rs index b4116a945..1001d1e9a 100644 --- a/src/client.rs +++ b/src/client.rs @@ -582,7 +582,7 @@ pub struct VideoHandler { impl VideoHandler { pub fn new() -> Self { VideoHandler { - decoder: Decoder::new(VideoCodecId::VP9, 1).unwrap(), + decoder: Decoder::new(VideoCodecId::VP9, 0).unwrap(), rgb: Default::default(), } } diff --git a/src/server/video_service.rs b/src/server/video_service.rs index 4d8f6dbe4..1fb549242 100644 --- a/src/server/video_service.rs +++ b/src/server/video_service.rs @@ -188,11 +188,7 @@ fn run(sp: GenericService) -> ResultType<()> { speed, }; let mut vpx; - let mut n = ((width * height) as f64 / (1920 * 1080) as f64).round() as u32; - if n < 1 { - n = 1; - } - match Encoder::new(&cfg, n) { + match Encoder::new(&cfg, 0) { Ok(x) => vpx = x, Err(err) => bail!("Failed to create encoder: {}", err), }