refactor: convert to workspace

This commit is contained in:
2025-01-29 11:48:57 +00:00
parent 20c9d107b7
commit 9045bb93e4
56 changed files with 6215 additions and 1123 deletions

View File

@ -0,0 +1,30 @@
use anyhow::Result;
use ffmpeg_rs_raw::ffmpeg_sys_the_third::AVPacket;
use uuid::Uuid;
use crate::egress::{Egress, EgressResult};
use crate::mux::HlsMuxer;
/// Alias the muxer directly
pub type HlsEgress = HlsMuxer;
impl Egress for HlsMuxer {
unsafe fn process_pkt(
&mut self,
packet: *mut AVPacket,
variant: &Uuid,
) -> Result<EgressResult> {
if let Some(ns) = self.mux_packet(packet, variant)? {
Ok(EgressResult::NewSegment(ns))
} else {
Ok(EgressResult::None)
}
}
unsafe fn reset(&mut self) -> Result<()> {
for var in &mut self.variants {
var.reset()?
}
Ok(())
}
}