mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-20 10:47:02 +00:00
24 lines
556 B
Rust
24 lines
556 B
Rust
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)
|
|
}
|
|
}
|
|
}
|