Struct ffmpeg::avcodec::AvCodec

source ·
pub struct AvCodec(&'static AVCodec);
Expand description

Lightweight abstraction over libavcodec’s AVCodec struct, allowing the query the capabilities of supported codecs and opening a session to work with them.

AVCodec instances in libavcodec are all static, hence we can safely use a static reference lifetime here.

Tuple Fields§

§0: &'static AVCodec

Implementations§

source§

impl AvCodec

source

pub fn is_decoder(&self) -> bool

Returns whether the codec is a decoder.

source

pub fn is_encoder(&self) -> bool

Returns whether the codec is an encoder.

source

pub fn name(&self) -> &'static str

Returns the name of the codec.

source

pub fn capabilities(&self) -> u32

Returns the capabilities of the codec, as a mask of AV_CODEC_CAP_* bits.

source

pub fn profile_iter(&self) -> AvProfileIterator

Returns an iterator over the profiles supported by this codec.

source

pub fn pixel_format_iter(&self) -> AvPixelFormatIterator

Returns an iterator over the pixel formats supported by this codec.

For a decoder, the returned array will likely be empty. This means that ffmpeg’s native pixel format (YUV420) will be used.

source

pub fn build_encoder(&self) -> Result<EncoderContextBuilder, AvCodecOpenError>

Get a builder for a encoder AvCodecContext using this codec.

source

pub fn build_decoder(&self) -> Result<DecoderContextBuilder, AvCodecOpenError>

Get a builder for a decoder AvCodecContext using this codec.

source

fn alloc_context(&self) -> Result<AvCodecContext, AvCodecOpenError>

Internal helper for build_decoder to allocate an AvCodecContext. This needs to be paired with a later call to AvCodecContext::init.

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.