change codec cpu usage to 0

This commit is contained in:
rustdesk 2021-12-24 12:40:47 +08:00
parent 885d8a4586
commit 8d90c5a93b
2 changed files with 2 additions and 6 deletions

View File

@ -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(),
}
}

View File

@ -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),
}