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:
mofeng-git
2026-01-11 10:41:57 +08:00
parent 9feb74b72c
commit 206594e292
110 changed files with 3955 additions and 2251 deletions

View File

@@ -55,7 +55,10 @@ impl LedSensor {
.map_err(|e| AppError::Internal(format!("LED GPIO chip failed: {}", e)))?;
let line = chip.get_line(self.config.gpio_pin).map_err(|e| {
AppError::Internal(format!("LED GPIO line {} failed: {}", self.config.gpio_pin, e))
AppError::Internal(format!(
"LED GPIO line {} failed: {}",
self.config.gpio_pin, e
))
})?;
let handle = line

View File

@@ -52,8 +52,8 @@ mod wol;
pub use controller::{AtxController, AtxControllerConfig};
pub use executor::timing;
pub use types::{
ActiveLevel, AtxAction, AtxDevices, AtxDriverType, AtxKeyConfig, AtxLedConfig,
AtxPowerRequest, AtxState, PowerStatus,
ActiveLevel, AtxAction, AtxDevices, AtxDriverType, AtxKeyConfig, AtxLedConfig, AtxPowerRequest,
AtxState, PowerStatus,
};
pub use wol::send_wol;

View File

@@ -22,7 +22,10 @@ fn parse_mac_address(mac: &str) -> Result<[u8; 6]> {
} else if mac.contains('-') {
mac.split('-').collect()
} else {
return Err(AppError::Config(format!("Invalid MAC address format: {}", mac)));
return Err(AppError::Config(format!(
"Invalid MAC address format: {}",
mac
)));
};
if parts.len() != 6 {
@@ -34,9 +37,8 @@ fn parse_mac_address(mac: &str) -> Result<[u8; 6]> {
let mut bytes = [0u8; 6];
for (i, part) in parts.iter().enumerate() {
bytes[i] = u8::from_str_radix(part, 16).map_err(|_| {
AppError::Config(format!("Invalid MAC address byte: {}", part))
})?;
bytes[i] = u8::from_str_radix(part, 16)
.map_err(|_| AppError::Config(format!("Invalid MAC address byte: {}", part)))?;
}
Ok(bytes)