MCPcopy Create free account
hub / github.com/RustCV/RustCV / Stream

Interface Stream

rustcv-core/src/traits.rs:107–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105/// 必须是 Send,以便在 Tokio 任务中运行
106#[async_trait]
107pub trait Stream: Send {
108 /// 启动采集 (Alloc buffers, Start DMA)
109 async fn start(&mut self) -> Result<()>;
110
111 /// 停止采集 (Release bandwidth)
112 async fn stop(&mut self) -> Result<()>;
113
114 /// 获取下一帧
115 /// 注意:这里返回的 Frame 生命周期绑定到 self (Stream)
116 /// 实现 Ring Buffer 的借用语义
117 async fn next_frame(&mut self) -> Result<Frame<'_>>;
118
119 /// 【逃生舱口】直接注入虚拟帧 (用于仿真)
120 #[cfg(feature = "simulation")]
121 async fn inject_frame(&mut self, frame: Frame<'_>) -> Result<()>;
122}
123
124/// 3. 控制面聚合体
125#[allow(missing_debug_implementations)]

Callers

nothing calls this directly

Implementers 4

stream.rsrustcv-backend-avf/src/stream.rs
stream.rsrustcv-backend-msmf/src/stream.rs
stream.rsrustcv-backend-v4l2/src/stream.rs
traits.rsrustcv-core/src/traits.rs

Calls

no outgoing calls

Tested by

no test coverage detected