add playout service: HLS streaming, FFmpeg, SegmentStore port (#9)

This commit is contained in:
2026-07-12 13:58:09 +02:00
parent de7f3092d2
commit 1b3ecc10e1
13 changed files with 1022 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
pub mod filesystem;
pub mod memory;
use async_trait::async_trait;
use bytes::Bytes;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum SegmentStoreError {
#[error("segment not found: {0}")]
NotFound(String),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
}
pub type SegmentStoreResult<T> = Result<T, SegmentStoreError>;
#[async_trait]
pub trait SegmentStore: Send + Sync {
async fn write_segment(&self, channel_id: &str, name: &str, data: Bytes)
-> SegmentStoreResult<()>;
async fn read_segment(&self, channel_id: &str, name: &str) -> SegmentStoreResult<Bytes>;
async fn list_segments(&self, channel_id: &str) -> SegmentStoreResult<Vec<String>>;
async fn delete_segment(&self, channel_id: &str, name: &str) -> SegmentStoreResult<()>;
}