mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-23 05:00:59 +03:00
disable hardware encoding if encoding fails too many times (#8327)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -76,6 +76,8 @@ pub trait EncoderApi {
|
||||
fn latency_free(&self) -> bool;
|
||||
|
||||
fn is_hardware(&self) -> bool;
|
||||
|
||||
fn disable(&self);
|
||||
}
|
||||
|
||||
pub struct Encoder {
|
||||
@@ -145,7 +147,6 @@ impl Encoder {
|
||||
Err(e) => {
|
||||
log::error!("new hw encoder failed: {e:?}, clear config");
|
||||
HwCodecConfig::clear(false, true);
|
||||
Self::update(EncodingUpdate::Check);
|
||||
*ENCODE_CODEC_FORMAT.lock().unwrap() = CodecFormat::VP9;
|
||||
Err(e)
|
||||
}
|
||||
@@ -158,7 +159,6 @@ impl Encoder {
|
||||
Err(e) => {
|
||||
log::error!("new vram encoder failed: {e:?}, clear config");
|
||||
HwCodecConfig::clear(true, true);
|
||||
Self::update(EncodingUpdate::Check);
|
||||
*ENCODE_CODEC_FORMAT.lock().unwrap() = CodecFormat::VP9;
|
||||
Err(e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user