streamer-rs 0.1.0

Backend-agnostic async library for streaming audio and video, with GStreamer as the first implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * SpinorML Ltd 🚀 AGPL-3.0 License - https://spinorml.com/license
 */

use async_trait::async_trait;

use crate::error::Result;
use crate::frame::{FrameData, VideoFrame};

#[async_trait]
pub trait VideoSink: Send {
    type Frame: FrameData;

    async fn start(&mut self) -> Result<()>;
    async fn write_frame(&mut self, frame: VideoFrame<Self::Frame>) -> Result<()>;
    async fn stop(&mut self) -> Result<()>;
}