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