mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 14:59:02 +08:00
auto codec, h265 > h264 > vp9/vp8 (#8032)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
a7499c2de8
commit
7e09809ad8
@ -267,13 +267,21 @@ impl Encoder {
|
||||
.unwrap_or((PreferCodec::Auto.into(), 0));
|
||||
let preference = most_frequent.enum_value_or(PreferCodec::Auto);
|
||||
|
||||
#[allow(unused_mut)]
|
||||
// auto: h265 > h264 > vp9/vp8
|
||||
let mut auto_codec = CodecFormat::VP9;
|
||||
let mut system = System::new();
|
||||
system.refresh_memory();
|
||||
if vp8_useable && system.total_memory() <= 4 * 1024 * 1024 * 1024 {
|
||||
// 4 Gb
|
||||
auto_codec = CodecFormat::VP8
|
||||
if h264_useable {
|
||||
auto_codec = CodecFormat::H264;
|
||||
}
|
||||
if h265_useable {
|
||||
auto_codec = CodecFormat::H265;
|
||||
}
|
||||
if auto_codec == CodecFormat::VP9 {
|
||||
let mut system = System::new();
|
||||
system.refresh_memory();
|
||||
if vp8_useable && system.total_memory() <= 4 * 1024 * 1024 * 1024 {
|
||||
// 4 Gb
|
||||
auto_codec = CodecFormat::VP8
|
||||
}
|
||||
}
|
||||
|
||||
*format = match preference {
|
||||
|
Loading…
Reference in New Issue
Block a user