Struct libav_ng::avcodec::CodecContext

source ·
pub struct CodecContext { /* private fields */ }
Expand description

AVCodecContext wrapper

Implementations§

source§

impl CodecContext

source

pub fn from_encoder_id(id: AVCodecID) -> Option<CodecContext>

Creates CodecContext from encoder ID

Returns Some(CodecContext) on success, None on error.

source

pub fn open(&mut self, options: *mut *mut AVDictionary) -> i32

Opens a codec

Returns 0 on success, negative number (Linux error code) on error

§TODO

Wrap it into Result<T, A>

source

pub fn set_size(&mut self, width: i32, height: i32)

Set size of codec picture size

source

pub fn get_size(&self) -> (i32, i32)

Get size of codec picture size

source

pub fn set_bitrate(&mut self, bitrate: i64)

Set bitrate

source

pub fn get_bitrate(&self) -> i64

Get bitrate

source

pub fn set_framerate(&mut self, fps: i32)

Set framerate (this also sets time_base but in inverse order)

source

pub fn get_framerate(&self) -> AVRational

Get framerate

source

pub fn get_time_base(&self) -> AVRational

Get time base

source

pub fn set_pixel_format(&mut self, fmt: AVPixelFormat)

Set pixel format

source

pub fn get_pixel_format(&self) -> AVPixelFormat

Get pixel format

source

pub fn fill_parameters(&self, params: *mut AVCodecParameters)

Fills parameters from codec into params

source

pub fn set_flags(&mut self, flags: i32)

Set codec flags

source

pub fn get_flags(&self) -> i32

Get codec flags

source

pub fn send_frame(&mut self, frame: &mut Frame) -> i32

Send frame to codec

source

pub unsafe fn receive_packet(&mut self, out: *mut AVPacket) -> i32

Receive packet from codec to out

source

pub fn is_open(&self) -> bool

Returns true if codec is opened.

Trait Implementations§

source§

impl Drop for CodecContext

source§

fn drop(&mut self)

Frees context on drop

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.