mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-03 11:31:53 +08:00
feat(webrtc): 添加公共ICE服务器支持和优化HID延迟
- 重构ICE配置:将TURN配置改为统一的ICE配置,支持STUN和多TURN URL - 添加公共ICE服务器:类似RustDesk,用户留空时使用编译时配置的公共服务器 - 优化DataChannel HID消息:使用tokio::spawn立即处理,避免依赖webrtc-rs轮询 - 添加WebRTCReady事件:客户端等待此事件后再建立连接 - 初始化时启动音频流,确保WebRTC可订阅 - 移除多余的trace/debug日志减少开销 - 更新前端配置界面支持公共ICE服务器显示
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
//! Consumer control event (type 0x03):
|
||||
//! - Bytes 1-2: Usage code (u16 LE)
|
||||
|
||||
use tracing::{debug, warn};
|
||||
use tracing::warn;
|
||||
|
||||
use super::types::ConsumerEvent;
|
||||
use super::{
|
||||
@@ -115,11 +115,6 @@ fn parse_keyboard_message(data: &[u8]) -> Option<HidChannelEvent> {
|
||||
right_meta: modifiers_byte & 0x80 != 0,
|
||||
};
|
||||
|
||||
debug!(
|
||||
"Parsed keyboard: {:?} key=0x{:02X} modifiers=0x{:02X}",
|
||||
event_type, key, modifiers_byte
|
||||
);
|
||||
|
||||
Some(HidChannelEvent::Keyboard(KeyboardEvent {
|
||||
event_type,
|
||||
key,
|
||||
@@ -168,11 +163,6 @@ fn parse_mouse_message(data: &[u8]) -> Option<HidChannelEvent> {
|
||||
_ => (None, 0i8),
|
||||
};
|
||||
|
||||
debug!(
|
||||
"Parsed mouse: {:?} x={} y={} button={:?} scroll={}",
|
||||
event_type, x, y, button, scroll
|
||||
);
|
||||
|
||||
Some(HidChannelEvent::Mouse(MouseEvent {
|
||||
event_type,
|
||||
x,
|
||||
@@ -191,8 +181,6 @@ fn parse_consumer_message(data: &[u8]) -> Option<HidChannelEvent> {
|
||||
|
||||
let usage = u16::from_le_bytes([data[0], data[1]]);
|
||||
|
||||
debug!("Parsed consumer: usage=0x{:04X}", usage);
|
||||
|
||||
Some(HidChannelEvent::Consumer(ConsumerEvent { usage }))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user