perf(rustdesk): 优化视频流性能和修复管道重启问题

- 使用 bounded channel(4) 替代 unbounded channel 提供背压控制
- 配置 protobuf 使用 bytes::Bytes 类型实现零拷贝
- 添加 encode_frame_bytes_zero_copy 方法避免帧数据拷贝
- 预分配 128KB 发送缓冲区减少内存分配
- 添加 write_frame_buffered 函数复用缓冲区
- 修复视频管道重启后 RustDesk 连接不恢复的问题
- 实现双层循环自动重新订阅新管道
- 修复 WebRTC set_bitrate_preset 中 video_frame_tx 被清除的问题
- 删除冗余的 RegisterPeer 日志
This commit is contained in:
mofeng-git
2026-01-02 18:53:05 +08:00
parent 28ecf951df
commit 427751da24
6 changed files with 185 additions and 80 deletions

View File

@@ -36,6 +36,12 @@ fn compile_protos() {
prost_build::Config::new()
.out_dir(&out_dir)
// Use bytes::Bytes for video/audio frame data to enable zero-copy
.bytes([
"EncodedVideoFrame.data",
"AudioFrame.data",
"CursorData.colors",
])
.compile_protos(
&["protos/rendezvous.proto", "protos/message.proto"],
&["protos/"],