mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-28 16:41:52 +08:00
feat(video): 事务化切换与前端统一编排,增强视频输入格式支持
- 后端:切换事务+transition_id,/stream/mode 返回 switching/transition_id 与实际 codec - 事件:新增 mode_switching/mode_ready,config/webrtc_ready/mode_changed 关联事务 - 编码/格式:扩展 NV21/NV16/NV24/RGB/BGR 输入与转换链路,RKMPP direct input 优化 - 前端:useVideoSession 统一切换,失败回退真实切回 MJPEG,菜单格式同步修复 - 清理:useVideoStream 降级为 MJPEG-only
This commit is contained in:
@@ -69,10 +69,7 @@ impl PunchHoleHandler {
|
||||
///
|
||||
/// Tries direct connection first, falls back to relay if needed.
|
||||
/// Returns true if direct connection succeeded, false if relay is needed.
|
||||
pub async fn handle_punch_hole(
|
||||
&self,
|
||||
peer_addr: Option<SocketAddr>,
|
||||
) -> bool {
|
||||
pub async fn handle_punch_hole(&self, peer_addr: Option<SocketAddr>) -> bool {
|
||||
let peer_addr = match peer_addr {
|
||||
Some(addr) => addr,
|
||||
None => {
|
||||
@@ -84,7 +81,11 @@ impl PunchHoleHandler {
|
||||
match try_direct_connection(peer_addr).await {
|
||||
PunchResult::DirectConnection(stream) => {
|
||||
// Direct connection succeeded, accept it
|
||||
match self.connection_manager.accept_connection(stream, peer_addr).await {
|
||||
match self
|
||||
.connection_manager
|
||||
.accept_connection(stream, peer_addr)
|
||||
.await
|
||||
{
|
||||
Ok(_) => {
|
||||
info!("P2P direct connection established with {}", peer_addr);
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user