mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
scrap: use the same bitrate ratio control as vpx
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -186,7 +186,7 @@ fn run(sp: GenericService) -> ResultType<()> {
|
||||
codec_name,
|
||||
width,
|
||||
height,
|
||||
quallity: convert_quality_back(q),
|
||||
bitrate_ratio: q >> 8,
|
||||
}),
|
||||
None => EncoderCfg::VPX(VpxEncoderConfig {
|
||||
width: width as _,
|
||||
@@ -516,20 +516,6 @@ fn convert_quality(q: i32) -> i32 {
|
||||
}
|
||||
}
|
||||
|
||||
fn convert_quality_back(q: i32) -> ImageQuality {
|
||||
let q = q >> 8;
|
||||
if q == 100 * 2 / 3 {
|
||||
ImageQuality::Balanced
|
||||
} else if q == 100 / 2 {
|
||||
ImageQuality::Low
|
||||
} else if q == 100 {
|
||||
ImageQuality::Best
|
||||
} else {
|
||||
log::error!("Error convert quality:{}", q);
|
||||
ImageQuality::Balanced
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_image_quality(id: i32, q: Option<i32>) {
|
||||
match q {
|
||||
Some(q) => {
|
||||
|
||||
Reference in New Issue
Block a user