diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2023-03-14 11:11:31 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2023-03-14 11:11:31 +0100 |
commit | 2757a0289c980aeba002609c777815b51ace8e56 (patch) | |
tree | 0872e7aa66fb001aa034b44f16ae1dcdfec3293f /nihav-core | |
parent | 5f9bf7648f667952b787c77afde07d23ac7c01de (diff) | |
download | nihav-2757a0289c980aeba002609c777815b51ace8e56.tar.gz |
introduce a way for encoder to manifest its capabilities
Diffstat (limited to 'nihav-core')
-rw-r--r-- | nihav-core/src/codecs/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index b6a1820..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<EncodeParameters>; + /// 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<NAStreamRef>; /// Takes a single frame for encoding. |