X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fcodecs%2Fmod.rs;h=5cf7d07b1eb1b230e5883e34f534d268e2f06ea7;hb=2757a0289c980aeba002609c777815b51ace8e56;hp=1072fc40ca2ad0d4b3952a2dad07950c879cd1e3;hpb=1ebf572dc8cdbf6e1440d90295b3e69eb76339df;p=nihav.git diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index 1072fc4..5cf7d07 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -210,6 +210,13 @@ pub const ENC_MODE_CBR: u64 = 1 << 0; /// Encoding parameter flag to force constant framerate mode. pub const ENC_MODE_CFR: u64 = 1 << 1; +/// Encoder supports constant bitrate mode. +pub const ENC_CAPS_CBR: u64 = 1 << 0; +/// Encoder supports skip frames. +pub const ENC_CAPS_SKIPFRAME: u64 = 1 << 1; +/// Encoder supports mid-stream parameters change. +pub const ENC_CAPS_PARAMCHANGE: u64 = 1 << 2; + /// Encoding parameters. #[derive(Clone,Copy,PartialEq)] pub struct EncodeParameters { @@ -300,6 +307,10 @@ pub trait NAEncoder: NAOptionHandler { /// // convert input into format defined in target_params, feed to the encoder, ... /// ``` fn negotiate_format(&self, encinfo: &EncodeParameters) -> EncoderResult; + /// Queries encoder capabilities. + /// + /// See `ENC_CAPS_*` for examples. + fn get_capabilities(&self) -> u64; /// Initialises the encoder. fn init(&mut self, stream_id: u32, encinfo: EncodeParameters) -> EncoderResult; /// Takes a single frame for encoding. @@ -374,6 +385,8 @@ pub trait NAPacketiser { fn get_packet(&mut self, stream: NAStreamRef) -> DecoderResult>; /// Resets the internal buffer. fn reset(&mut self); + /// Tells how much data is left in the internal buffer. + fn bytes_left(&self) -> usize; } /// Decoder information used during creating a packetiser for requested codec.