mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-28 08:31:52 +08:00
refactor: 清理死代码和优化日志级别
- 删除未使用的函数和常量 - create_public_key_message (rustdesk/connection) - decode_audio_packet, AudioPacketHeader (web/audio_ws) - io_error_to_hid_error, close_device, close_all_devices (hid) - shutdown_rx (rustdesk/mod) - CONNECT_TIMEOUT_MS, RESP_ERR_SEND_FAILED - 调整日志级别 - Session lagged: warn -> debug - 移除 H264 NAL trace 日志 - 移除 Frame distribution lagged trace 日志 - 移除 absolute mouse report trace 日志 - 优化 broadcast channel 缓冲区大小 8 -> 16 - 修复条件编译 - static_files.rs: 添加 debug_assertions 条件
This commit is contained in:
@@ -136,6 +136,26 @@ bool set_lantency_free(void *priv_data, const std::string &name) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// RKMPP (Rockchip MPP) hardware encoder - minimize buffer latency
|
||||
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));
|
||||
// Not fatal - older FFmpeg versions may not support this option
|
||||
}
|
||||
}
|
||||
// V4L2 M2M hardware encoder - minimize buffer latency
|
||||
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", 2, 0)) < 0) {
|
||||
LOG_WARN(std::string("v4l2m2m set num_output_buffers failed, ret = ") + av_err2str(ret));
|
||||
// Not fatal
|
||||
}
|
||||
if ((ret = av_opt_set_int(priv_data, "num_capture_buffers", 2, 0)) < 0) {
|
||||
LOG_WARN(std::string("v4l2m2m set num_capture_buffers failed, ret = ") + av_err2str(ret));
|
||||
// Not fatal
|
||||
}
|
||||
}
|
||||
if (name.find("videotoolbox") != std::string::npos) {
|
||||
if ((ret = av_opt_set_int(priv_data, "realtime", 1, 0)) < 0) {
|
||||
LOG_ERROR(std::string("videotoolbox set realtime failed, ret = ") + av_err2str(ret));
|
||||
|
||||
Reference in New Issue
Block a user