fix qos and add auto_adjust_fps

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-07-25 15:46:29 +08:00
parent 28ef64cba1
commit e70f3f2125
5 changed files with 55 additions and 14 deletions

View File

@@ -663,6 +663,7 @@ message Misc {
PluginRequest plugin_request = 25;
PluginFailure plugin_failure = 26;
uint32 full_speed_fps = 27;
uint32 auto_adjust_fps = 28;
}
}

View File

@@ -535,11 +535,10 @@ pub fn codec_thread_num() -> usize {
info = format!("cpu loadavg:{}", avg.one);
res = (((max as f64) - avg.one) * 0.5).round() as usize;
}
res = if res > 0 && res <= max / 2 {
res
} else {
std::cmp::max(1, max / 2)
};
res = std::cmp::min(res, max / 2);
if res == 0 {
res = 1;
}
// avoid frequent log
let log = match THREAD_LOG_TIME.lock().unwrap().clone() {
Some(instant) => instant.elapsed().as_secs() > 1,