refactor: 降低 hwcodec 探测日志噪音

This commit is contained in:
mofeng-git
2026-08-26 12:04:52 +08:00
parent 0054100414
commit f101ddb918
4 changed files with 16 additions and 16 deletions

View File

@@ -120,7 +120,8 @@ bool set_lantency_free(void *priv_data, const std::string &name) {
}
if (name.find("amf") != std::string::npos) {
if ((ret = av_opt_set(priv_data, "query_timeout", "1000", 0)) < 0) {
LOG_WARN(std::string("amf query_timeout option is unavailable, ret = ") + av_err2str(ret));
LOG_DEBUG(std::string("amf query_timeout option is unavailable, ret = ") +
av_err2str(ret));
}
}
if (name.find("qsv") != std::string::npos) {
@@ -139,7 +140,8 @@ bool set_lantency_free(void *priv_data, const std::string &name) {
if (name.find("rkmpp") != std::string::npos) {
// Set async_depth to 1 for minimal buffering (0 = synchronous, higher = more buffering)
if ((ret = av_opt_set(priv_data, "async_depth", "1", 0)) < 0) {
LOG_WARN(std::string("rkmpp set async_depth failed, ret = ") + av_err2str(ret));
LOG_DEBUG(std::string("rkmpp async_depth option is unavailable, ret = ") +
av_err2str(ret));
// Not fatal - older FFmpeg versions may not support this option
}
}
@@ -147,11 +149,13 @@ bool set_lantency_free(void *priv_data, const std::string &name) {
if (name.find("v4l2m2m") != std::string::npos) {
// Minimize number of output buffers for lower latency
if ((ret = av_opt_set_int(priv_data, "num_output_buffers", 4, 0)) < 0) {
LOG_WARN(std::string("v4l2m2m set num_output_buffers failed, ret = ") + av_err2str(ret));
LOG_DEBUG(std::string("v4l2m2m num_output_buffers option is unavailable, ret = ") +
av_err2str(ret));
// Not fatal
}
if ((ret = av_opt_set_int(priv_data, "num_capture_buffers", 4, 0)) < 0) {
LOG_WARN(std::string("v4l2m2m set num_capture_buffers failed, ret = ") + av_err2str(ret));
LOG_DEBUG(std::string("v4l2m2m num_capture_buffers option is unavailable, ret = ") +
av_err2str(ret));
// Not fatal
}
}