mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-13 11:04:25 +08:00
refactor: 降低 hwcodec 探测日志噪音
This commit is contained in:
@@ -32,14 +32,14 @@ pub extern "C" fn hwcodec_av_log_callback(level: i32, message: *const std::os::r
|
||||
if let Ok(str_slice) = c_str.to_str() {
|
||||
let string = String::from(str_slice);
|
||||
if level == AV_LOG_ERROR as i32 {
|
||||
log::error!("{}", string);
|
||||
if string.contains(could_not_find_ref_with_poc) {
|
||||
hwcodec_set_flag_could_not_find_ref_with_poc();
|
||||
}
|
||||
log::debug!("{}", string);
|
||||
} else if level == AV_LOG_PANIC as i32 || level == AV_LOG_FATAL as i32 {
|
||||
log::error!("{}", string);
|
||||
} else if level == AV_LOG_WARNING as i32 {
|
||||
log::warn!("{}", string);
|
||||
log::debug!("{}", string);
|
||||
} else if level == AV_LOG_INFO as i32 {
|
||||
log::info!("{}", string);
|
||||
} else if level == AV_LOG_VERBOSE as i32 || level == AV_LOG_DEBUG as i32 {
|
||||
|
||||
@@ -343,7 +343,7 @@ fn log_failed_probe_attempt(
|
||||
}
|
||||
|
||||
fn validate_candidate(codec: &CodecInfo, ctx: &EncodeContext, yuv: &[u8]) -> bool {
|
||||
use log::{debug, warn};
|
||||
use log::debug;
|
||||
|
||||
debug!("Testing encoder: {}", codec.name);
|
||||
|
||||
@@ -395,7 +395,7 @@ fn validate_candidate(codec: &CodecInfo, ctx: &EncodeContext, yuv: &[u8]) -> boo
|
||||
}
|
||||
Err(err) => {
|
||||
last_err = Some(err);
|
||||
warn!(
|
||||
debug!(
|
||||
"Encoder {} test attempt {} returned error: {}",
|
||||
codec.name, attempt_no, err
|
||||
);
|
||||
@@ -412,10 +412,7 @@ fn validate_candidate(codec: &CodecInfo, ctx: &EncodeContext, yuv: &[u8]) -> boo
|
||||
);
|
||||
false
|
||||
}
|
||||
Err(_) => {
|
||||
warn!("Failed to create encoder {}", codec.name);
|
||||
false
|
||||
}
|
||||
Err(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,7 +540,7 @@ impl Encoder {
|
||||
if codec.is_null() {
|
||||
let message = encoder_last_error_message();
|
||||
if !message.is_empty() {
|
||||
log::error!("ffmpeg_ram_new_encoder failed: {}", message);
|
||||
log::debug!("ffmpeg_ram_new_encoder failed: {}", message);
|
||||
}
|
||||
return Err(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user