mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-13 02:54:26 +08:00
fix: 修复无信号状态同步与采集管线阻塞
- 使用非阻塞 V4L2 句柄并类型化采集错误 - 完善视频管线生命周期,避免复用停止中的管线 - 区分音视频事件并支持 REST/WebSocket 状态快照 - 修复信号丢失后保留最后一帧及刷新后黑屏问题 - 优化无信号提示、状态展示优先级及相关界面细节 - 降低重复 OTG 错误日志级别
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { toast } from 'vue-sonner'
|
||||
import { useSystemStore } from '@/stores/system'
|
||||
import type { StreamDeviceLostEventData } from '@/types/websocket'
|
||||
import type { StreamDeviceLostEventData, StreamStateChangedEventData } from '@/types/websocket'
|
||||
import { useWebSocket } from '@/composables/useWebSocket'
|
||||
import { isAudioStreamDeviceLostPayload } from '@/lib/streamSignal'
|
||||
|
||||
@@ -13,12 +13,7 @@ export interface ConsoleEventHandlers {
|
||||
onStreamModeSwitching?: (data: { transition_id: string; to_mode: string; from_mode: string }) => void
|
||||
onStreamModeReady?: (data: { transition_id: string; mode: string }) => void
|
||||
onWebRTCReady?: (data: { codec: string; hardware: boolean; transition_id?: string }) => void
|
||||
onStreamStateChanged?: (data: {
|
||||
state: string
|
||||
device?: string | null
|
||||
reason?: string | null
|
||||
next_retry_ms?: number | null
|
||||
}) => void
|
||||
onStreamStateChanged?: (data: StreamStateChangedEventData) => void
|
||||
onStreamDeviceLost?: (data: StreamDeviceLostEventData) => void
|
||||
onStreamReconnecting?: (data: { device: string; attempt: number }) => void
|
||||
onStreamRecovered?: (data: { device: string }) => void
|
||||
@@ -57,12 +52,7 @@ export function useConsoleEvents(handlers: ConsoleEventHandlers) {
|
||||
handlers.onStreamRecovered?.(_data)
|
||||
}
|
||||
|
||||
function handleStreamStateChangedForward(data: {
|
||||
state: string
|
||||
device?: string | null
|
||||
reason?: string | null
|
||||
next_retry_ms?: number | null
|
||||
}) {
|
||||
function handleStreamStateChangedForward(data: StreamStateChangedEventData) {
|
||||
handlers.onStreamStateChanged?.(data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user