fix: 修复无信号状态同步与采集管线阻塞

- 使用非阻塞 V4L2 句柄并类型化采集错误
- 完善视频管线生命周期,避免复用停止中的管线
- 区分音视频事件并支持 REST/WebSocket 状态快照
- 修复信号丢失后保留最后一帧及刷新后黑屏问题
- 优化无信号提示、状态展示优先级及相关界面细节
- 降低重复 OTG 错误日志级别
This commit is contained in:
mofeng-git
2026-07-30 22:43:59 +08:00
parent ce1712ff2e
commit 6fdcf5c7c9
24 changed files with 406 additions and 165 deletions

View File

@@ -12,7 +12,7 @@ use super::device::{enumerate_audio_devices, AudioDeviceInfo};
use super::monitor::AudioHealthMonitor;
use super::streamer::{AudioStreamState, AudioStreamer, AudioStreamerConfig};
use super::types::AudioControllerConfig;
use crate::events::{EventBus, StreamDeviceLostKind, SystemEvent};
use crate::events::{EventBus, StreamKind, SystemEvent};
const RETRY_DELAY: std::time::Duration = std::time::Duration::from_secs(1);
@@ -286,6 +286,7 @@ impl AudioRecovery {
) {
if let Some(bus) = self.inner.event_bus.read().await.as_ref() {
bus.publish(SystemEvent::StreamStateChanged {
kind: StreamKind::Audio,
state: state.to_string(),
device,
reason: reason.map(str::to_string),
@@ -298,7 +299,7 @@ impl AudioRecovery {
async fn publish_device_lost(&self, device: &str, reason: &str) {
if let Some(bus) = self.inner.event_bus.read().await.as_ref() {
bus.publish(SystemEvent::StreamDeviceLost {
kind: StreamDeviceLostKind::Audio,
kind: StreamKind::Audio,
device: device.to_string(),
reason: reason.to_string(),
});