From f6e97a06f59c5eaadd681b88cfb9078e4f5a1b65 Mon Sep 17 00:00:00 2001 From: mofeng-git Date: Mon, 6 Jul 2026 20:51:58 +0800 Subject: [PATCH] =?UTF-8?q?del:=20=E5=88=A0=E9=99=A4=20MJPEG=20=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A0=BC=E5=BC=8F=E8=87=AA=E5=8A=A8=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/video/stream_manager.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/video/stream_manager.rs b/src/video/stream_manager.rs index 3ee22698..d591cfc8 100644 --- a/src/video/stream_manager.rs +++ b/src/video/stream_manager.rs @@ -37,7 +37,6 @@ use crate::events::{EventBus, SystemEvent, VideoDeviceInfo}; use crate::hid::HidController; use crate::stream::MjpegStreamHandler; use crate::video::codec_constraints::StreamCodecConstraints; -use crate::video::device::is_csi_hdmi_bridge; use crate::video::format::{PixelFormat, Resolution}; use crate::video::streamer::{Streamer, StreamerState, StreamerStats}; use crate::video::traits::VideoOutput; @@ -439,33 +438,6 @@ impl VideoStreamManager { StreamMode::Mjpeg => { info!("Starting MJPEG streaming"); - // Auto-switch to MJPEG format if device supports it - if let Some(device) = self.streamer.current_device().await { - let (current_format, resolution, fps) = - self.streamer.current_video_config().await; - let available_formats: Vec = - device.formats.iter().map(|f| f.format).collect(); - - // If current format is not MJPEG and device supports MJPEG, switch to it - if !is_csi_hdmi_bridge(&device) - && current_format != PixelFormat::Mjpeg - && available_formats.contains(&PixelFormat::Mjpeg) - { - info!("Auto-switching to MJPEG format for MJPEG mode"); - let device_path = device.path.to_string_lossy().to_string(); - if let Err(e) = self - .streamer - .apply_video_config(&device_path, PixelFormat::Mjpeg, resolution, fps) - .await - { - warn!( - "Failed to auto-switch to MJPEG format: {}, keeping current format", - e - ); - } - } - } - if let Err(e) = self.streamer.start().await { error!("Failed to start MJPEG streamer: {}", e); return Err(e);