mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -184,9 +184,9 @@ fn run(sp: GenericService) -> ResultType<()> {
|
||||
let encoder_cfg = match Encoder::current_hw_encoder_name() {
|
||||
Some(codec_name) => EncoderCfg::HW(HwEncoderConfig {
|
||||
codec_name,
|
||||
fps,
|
||||
width,
|
||||
height,
|
||||
quallity: convert_quality_back(q),
|
||||
}),
|
||||
None => EncoderCfg::VPX(VpxEncoderConfig {
|
||||
width: width as _,
|
||||
@@ -516,6 +516,20 @@ 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