Trait adder_codec_rs::Codec
source · pub trait Codec {
Show 20 methods
fn new() -> Self;
fn get_source_type(&self) -> SourceType;
fn write_eof(&mut self);
fn flush_writer(&mut self);
fn close_writer(&mut self);
fn close_reader(&mut self);
fn set_output_stream(&mut self, stream: Option<BufWriter<File>>);
fn set_input_stream(&mut self, stream: Option<BufReader<File>>);
fn set_input_stream_position(&mut self, pos: u64) -> Result<(), StreamError>;
fn set_input_stream_position_from_end(
&mut self,
pos: i64
) -> Result<(), StreamError>;
fn get_input_stream_position(&mut self) -> Result<u64, StreamError>;
fn get_eof_position(&mut self) -> Result<u64, StreamError>;
fn encode_header(
&mut self,
width: u16,
height: u16,
tps: u32,
ref_interval: u32,
delta_t_max: u32,
channels: u8,
codec_version: u8,
source_camera: SourceCamera
);
fn decode_header(&mut self) -> Result<usize, StreamError>;
fn encode_event(&mut self, event: &Event);
fn encode_events(&mut self, events: &[Event]);
fn encode_events_events(&mut self, events: &[Vec<Event>]);
fn decode_event(&mut self) -> Result<Event, StreamError>;
fn open_writer<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> { ... }
fn open_reader<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> { ... }
}
Required Methods§
fn new() -> Self
fn get_source_type(&self) -> SourceType
fn write_eof(&mut self)
sourcefn flush_writer(&mut self)
fn flush_writer(&mut self)
Flush the stream so that program can be exited safely
fn close_writer(&mut self)
sourcefn close_reader(&mut self)
fn close_reader(&mut self)
Close the stream so that program can be exited safely
fn set_output_stream(&mut self, stream: Option<BufWriter<File>>)
fn set_input_stream(&mut self, stream: Option<BufReader<File>>)
sourcefn set_input_stream_position(&mut self, pos: u64) -> Result<(), StreamError>
fn set_input_stream_position(&mut self, pos: u64) -> Result<(), StreamError>
Go to this position (as a byte address) in the input stream. Returns a StreamError if not aligned to an Event