feat(codec): log which AV1 encoder a session uses

Emit an explicit "AV1 encoder: svt-av1" / "AV1 encoder: aom" line at the
point the encoder is actually built, plus the reason ("i444" /
"unsupported resolution") when a 64-bit host falls back to aom for AV1.
Avoids relying on parsing Debug output or SVT's own stderr banner.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Wf7v1KJM6mbhiYxWSz4PH
This commit is contained in:
rustdesk
2026-07-23 17:52:15 +08:00
parent 1ac684db0d
commit 8eda19247c
2 changed files with 31 additions and 15 deletions

View File

@@ -146,17 +146,23 @@ impl Encoder {
EncoderCfg::VPX(_) => Ok(Encoder {
codec: Box::new(VpxEncoder::new(config, i444)?),
}),
EncoderCfg::AOM(_) => Ok(Encoder {
codec: Box::new(AomEncoder::new(config, i444)?),
}),
EncoderCfg::AOM(_) => {
log::info!("AV1 encoder: aom");
Ok(Encoder {
codec: Box::new(AomEncoder::new(config, i444)?),
})
}
#[cfg(target_pointer_width = "64")]
EncoderCfg::SVTAV1(svt) => match SvtAv1Encoder::new(EncoderCfg::SVTAV1(svt), i444) {
Ok(codec) => Ok(Encoder {
codec: Box::new(codec),
}),
Ok(codec) => {
log::info!("AV1 encoder: svt-av1");
Ok(Encoder {
codec: Box::new(codec),
})
}
Err(e) => {
// Same wire format, aom keeps the negotiated AV1 session alive.
log::error!("new svt-av1 encoder failed: {e:?}, fallback to aom");
log::error!("AV1 encoder: svt-av1 init failed ({e:?}), using aom");
let aom = EncoderCfg::AOM(AomEncoderConfig {
width: svt.width,
height: svt.height,