Trait adder_codec_rs::Codec
source · pub trait Codec {
Show 21 methods
fn new() -> Self;
fn get_source_type(&self) -> SourceType;
fn write_eof(&mut self) -> Result<(), StreamError>;
fn flush_writer(&mut self) -> Result<()>;
fn close_writer(&mut self) -> Result<(), Box<dyn Error>>;
fn close_reader(&mut self);
fn set_output_stream(&mut self, stream: Option<BufWriter<File>>);
fn has_output_stream(&self) -> bool;
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, Box<dyn Error>>;
fn get_eof_position(&mut self) -> Result<u64, Box<dyn Error>>;
fn encode_header(
&mut self,
plane_size: PlaneSize,
tps: u32,
ref_interval: u32,
delta_t_max: u32,
codec_version: u8,
source_camera: SourceCamera
) -> Result<(), Box<dyn Error>>;
fn decode_header(&mut self) -> Result<usize, Box<dyn Error>>;
fn encode_event(&mut self, event: &Event) -> Result<(), StreamError>;
fn encode_events(&mut self, events: &[Event]) -> Result<(), StreamError>;
fn encode_events_events(
&mut self,
events: &[Vec<Event>]
) -> Result<(), StreamError>;
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
sourcefn write_eof(&mut self) -> Result<(), StreamError>
fn write_eof(&mut self) -> Result<(), StreamError>
sourcefn flush_writer(&mut self) -> Result<()>
fn flush_writer(&mut self) -> Result<()>
sourcefn close_reader(&mut self)
fn close_reader(&mut self)
Close the stream reader safely
fn set_output_stream(&mut self, stream: Option<BufWriter<File>>)
fn has_output_stream(&self) -> bool
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>
sourcefn set_input_stream_position_from_end(
&mut self,
pos: i64
) -> Result<(), StreamError>
fn set_input_stream_position_from_end(
&mut self,
pos: i64
) -> Result<(), StreamError>
Go to this position (as a byte address) in the input stream, relative to the end of the stream
Errors
- If the stream cannot be seeked to the given position
- If the stream is not seekable
- If the stream is not open