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
impl AvCodec
sourcepub fn is_decoder(&self) -> bool
pub fn is_decoder(&self) -> bool
Returns whether the codec is a decoder.
sourcepub fn is_encoder(&self) -> bool
pub fn is_encoder(&self) -> bool
Returns whether the codec is an encoder.
sourcepub fn capabilities(&self) -> u32
pub fn capabilities(&self) -> u32
Returns the capabilities of the codec, as a mask of AV_CODEC_CAP_* bits.
sourcepub fn profile_iter(&self) -> AvProfileIterator ⓘ
pub fn profile_iter(&self) -> AvProfileIterator ⓘ
Returns an iterator over the profiles supported by this codec.
sourcepub fn pixel_format_iter(&self) -> AvPixelFormatIterator ⓘ
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.
sourcepub fn build_encoder(&self) -> Result<EncoderContextBuilder, AvCodecOpenError>
pub fn build_encoder(&self) -> Result<EncoderContextBuilder, AvCodecOpenError>
Get a builder for a encoder AvCodecContext
using this codec.
sourcepub fn build_decoder(&self) -> Result<DecoderContextBuilder, AvCodecOpenError>
pub fn build_decoder(&self) -> Result<DecoderContextBuilder, AvCodecOpenError>
Get a builder for a decoder AvCodecContext
using this codec.
sourcefn alloc_context(&self) -> Result<AvCodecContext, AvCodecOpenError>
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
.