1 pub mod h264_reader; 2 pub mod h264_writer; 3 use crate::error::Result; 4 5 pub mod ivf_reader; 6 pub mod ivf_writer; 7 pub mod ogg_reader; 8 pub mod ogg_writer; 9 pub mod sample_builder; 10 11 pub type ResetFn<R> = Box<dyn FnMut(usize) -> R>; 12 13 // Writer defines an interface to handle 14 // the creation of media files 15 pub trait Writer { 16 // Add the content of an RTP packet to the media write_rtp(&mut self, pkt: &rtp::packet::Packet) -> Result<()>17 fn write_rtp(&mut self, pkt: &rtp::packet::Packet) -> Result<()>; 18 // close the media 19 // Note: close implementation must be idempotent close(&mut self) -> Result<()>20 fn close(&mut self) -> Result<()>; 21 } 22