pub trait Encoder: Send {
// Required methods
fn get_extradata(&self) -> Option<Vec<u8>>;
fn send_frame(&mut self, pkt: &ArcFrame) -> Result<()>;
fn receive_packet(&mut self) -> Result<Packet>;
fn flush(&mut self) -> Result<()>;
fn configure(&mut self) -> Result<()>;
fn set_option(&mut self, key: &str, val: Value<'_>) -> Result<()>;
fn set_params(&mut self, params: &CodecParams) -> Result<()>;
fn get_params(&self) -> Result<CodecParams>;
}Expand description
Used to interact with an encoder.
Required Methods§
Sourcefn get_extradata(&self) -> Option<Vec<u8>>
fn get_extradata(&self) -> Option<Vec<u8>>
Returns the extra data added by an encoder to a codec.
Sourcefn send_frame(&mut self, pkt: &ArcFrame) -> Result<()>
fn send_frame(&mut self, pkt: &ArcFrame) -> Result<()>
Sends to the encoder a frame to be encoded.
Sourcefn receive_packet(&mut self) -> Result<Packet>
fn receive_packet(&mut self) -> Result<Packet>
Returns an encoded packet.
Sourcefn set_params(&mut self, params: &CodecParams) -> Result<()>
fn set_params(&mut self, params: &CodecParams) -> Result<()>
Sets the parameters associated to a determined codec.
Sourcefn get_params(&self) -> Result<CodecParams>
fn get_params(&self) -> Result<CodecParams>
Gets the parameters associated to a determined codec.