refactor: 删除部分多余的代码和注释

This commit is contained in:
mofeng-git
2026-05-01 17:31:04 +08:00
parent 74035f8e12
commit d8e7de74a6
165 changed files with 2960 additions and 9917 deletions

View File

@@ -39,8 +39,8 @@ use crate::stream::MjpegStreamHandler;
use crate::video::codec_constraints::StreamCodecConstraints;
use crate::video::format::{PixelFormat, Resolution};
use crate::video::is_csi_hdmi_bridge;
use crate::video::streamer::{Streamer, StreamerStats, StreamerState};
use crate::webrtc::WebRtcStreamer;
use crate::video::streamer::{Streamer, StreamerState, StreamerStats};
use crate::video::traits::VideoOutput;
/// Video stream manager configuration
#[derive(Debug, Clone)]
@@ -95,8 +95,8 @@ pub struct VideoStreamManager {
mode: RwLock<StreamMode>,
/// MJPEG streamer (handles video capture and MJPEG distribution)
streamer: Arc<Streamer>,
/// WebRTC streamer (unified WebRTC manager with multi-codec support)
webrtc_streamer: Arc<WebRtcStreamer>,
/// WebRTC output (unified WebRTC manager with multi-codec support)
webrtc_streamer: Arc<dyn VideoOutput>,
/// Event bus for notifications
events: RwLock<Option<Arc<EventBus>>>,
/// Configuration store
@@ -111,7 +111,7 @@ impl VideoStreamManager {
/// Create a new video stream manager with WebRtcStreamer
pub fn with_webrtc_streamer(
streamer: Arc<Streamer>,
webrtc_streamer: Arc<WebRtcStreamer>,
webrtc_streamer: Arc<dyn VideoOutput>,
) -> Arc<Self> {
Arc::new(Self {
mode: RwLock::new(StreamMode::Mjpeg),
@@ -175,11 +175,6 @@ impl VideoStreamManager {
self.streamer.clone()
}
/// Get the WebRTC streamer (unified interface with multi-codec support)
pub fn webrtc_streamer(&self) -> Arc<WebRtcStreamer> {
self.webrtc_streamer.clone()
}
/// Get the MJPEG stream handler
pub fn mjpeg_handler(&self) -> Arc<MjpegStreamHandler> {
self.streamer.mjpeg_handler()
@@ -812,6 +807,16 @@ impl VideoStreamManager {
self.webrtc_streamer.get_pipeline_config().await
}
/// Get current video codec type
pub async fn current_video_codec(&self) -> crate::video::encoder::VideoCodecType {
self.webrtc_streamer.current_video_codec().await
}
/// Check if hardware encoding is in use
pub async fn is_hardware_encoding(&self) -> bool {
self.webrtc_streamer.is_hardware_encoding().await
}
/// Set video codec for the shared video pipeline
///
/// This allows external consumers (like RustDesk) to set the video codec