/// 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 {
pub tb_num: u32,
/// Time base denominator. Ignored for audio.
pub tb_den: u32,
- /// Bitrate in kilobits per second.
+ /// Bitrate in bits per second.
pub bitrate: u32,
/// A collection of various boolean encoder settings like CBR mode.
///
/// // 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.
fn get_packet(&mut self, stream: NAStreamRef) -> DecoderResult<Option<NAPacket>>;
/// 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.