mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-03-15 15:36:44 +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:
@@ -93,10 +93,7 @@ impl H264Pipeline {
|
||||
pub fn new(config: H264PipelineConfig) -> Result<Self> {
|
||||
info!(
|
||||
"Creating H264 pipeline: {}x{} @ {} kbps, {} fps",
|
||||
config.resolution.width,
|
||||
config.resolution.height,
|
||||
config.bitrate_kbps,
|
||||
config.fps
|
||||
config.resolution.width, config.resolution.height, config.bitrate_kbps, config.fps
|
||||
);
|
||||
|
||||
// Determine encoder input format based on pipeline input
|
||||
@@ -154,7 +151,7 @@ impl H264Pipeline {
|
||||
// MJPEG/JPEG input - not supported (requires libjpeg for decoding)
|
||||
PixelFormat::Mjpeg | PixelFormat::Jpeg => {
|
||||
return Err(AppError::VideoError(
|
||||
"MJPEG input format not supported in this build".to_string()
|
||||
"MJPEG input format not supported in this build".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -216,7 +213,10 @@ impl H264Pipeline {
|
||||
}
|
||||
|
||||
let _ = self.running.send(true);
|
||||
info!("Starting H264 pipeline (input format: {})", self.config.input_format);
|
||||
info!(
|
||||
"Starting H264 pipeline (input format: {})",
|
||||
self.config.input_format
|
||||
);
|
||||
|
||||
let encoder = self.encoder.lock().await.take();
|
||||
let nv12_converter = self.nv12_converter.lock().await.take();
|
||||
|
||||
Reference in New Issue
Block a user