Merge pull request #3953 from 21pages/fps

client side fps control for reduce delay
This commit is contained in:
RustDesk
2023-04-07 19:02:08 +08:00
committed by GitHub
8 changed files with 147 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
use super::*;
use std::time::Duration;
pub const FPS: u8 = 30;
pub const MIN_FPS: u8 = 10;
pub const MIN_FPS: u8 = 1;
pub const MAX_FPS: u8 = 120;
trait Percent {
fn as_percent(&self) -> u32;
@@ -221,7 +221,9 @@ impl VideoQoS {
}
pub fn reset(&mut self) {
*self = Default::default();
self.fps = FPS;
self.user_fps = FPS;
self.updated = true;
}
pub fn check_abr_config(&mut self) -> bool {

View File

@@ -547,7 +547,7 @@ fn run(sp: GenericService) -> ResultType<()> {
check_uac_switch(c.privacy_mode_id, c._capturer_privacy_mode_id)?;
let mut video_qos = VIDEO_QOS.lock().unwrap();
if video_qos.check_if_updated() {
if video_qos.check_if_updated() && video_qos.target_bitrate > 0 {
log::debug!(
"qos is updated, target_bitrate:{}, fps:{}",
video_qos.target_bitrate,