mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-12 18:44:25 +08:00
fix: 完善 RK3588 HDMI RX 信号检测与自动恢复
- 统一使用 QUERY_DV_TIMINGS 判断 HDMI RX 输入状态 - 增加 source-following 设备状态 API 与前端只读展示 - 支持长时间无信号后的 MJPEG/WebRTC 自动恢复 - 修复模式切换时采集设备尚未释放导致的 EBUSY - 取消陈旧 WebRTC 重连并统一采集恢复策略 - 移除视频输入状态区域的冗余标题
This commit is contained in:
@@ -44,7 +44,7 @@ pub struct SetupRequest {
|
||||
|
||||
pub async fn setup_init(
|
||||
State(state): State<Arc<AppState>>,
|
||||
Json(req): Json<SetupRequest>,
|
||||
Json(mut req): Json<SetupRequest>,
|
||||
) -> Result<Json<LoginResponse>> {
|
||||
// Check if already initialized
|
||||
if state.config.is_initialized() {
|
||||
@@ -65,6 +65,37 @@ pub async fn setup_init(
|
||||
));
|
||||
}
|
||||
|
||||
if let Some(path) = req.video_device.as_deref() {
|
||||
let source_following = state
|
||||
.stream_manager
|
||||
.list_devices()
|
||||
.await
|
||||
.ok()
|
||||
.and_then(|devices| {
|
||||
devices
|
||||
.into_iter()
|
||||
.find(|device| device.path.to_string_lossy() == path)
|
||||
})
|
||||
.is_some_and(|device| {
|
||||
device.control_mode == crate::video::device::VideoControlMode::SourceFollowing
|
||||
});
|
||||
if source_following {
|
||||
if req.video_format.is_some()
|
||||
|| req.video_width.is_some()
|
||||
|| req.video_height.is_some()
|
||||
|| req.video_fps.is_some()
|
||||
{
|
||||
tracing::debug!(
|
||||
"Ignoring setup-supplied format, resolution, and FPS for source-following video input"
|
||||
);
|
||||
}
|
||||
req.video_format = None;
|
||||
req.video_width = None;
|
||||
req.video_height = None;
|
||||
req.video_fps = None;
|
||||
}
|
||||
}
|
||||
|
||||
let old_config = state.config.get();
|
||||
|
||||
// Create single system user
|
||||
|
||||
Reference in New Issue
Block a user