Struct rsmpeg::avcodec::AVCodecContext[][src]

pub struct AVCodecContext { /* fields omitted */ }

Implementations

impl AVCodecContext[src]

pub fn as_ptr(&self) -> *const AVCodecContext[src]

pub fn as_mut_ptr(&mut self) -> *mut AVCodecContext[src]

pub unsafe fn set_ptr(&mut self, ptr: NonNull<AVCodecContext>)[src]

Safety

This function should only be called when the pointer is valid and the data it’s pointing to can be dropped.

pub unsafe fn from_raw(raw: NonNull<AVCodecContext>) -> Self[src]

Safety

This function should only be called when the pointer is valid and the data it’s pointing to can be dropped.

pub fn into_raw(self) -> NonNull<AVCodecContext>[src]

impl AVCodecContext[src]

pub fn set_framerate(&mut self, framerate: AVRational)[src]

pub fn set_channel_layout(&mut self, channel_layout: u64)[src]

pub fn set_height(&mut self, height: i32)[src]

pub fn set_width(&mut self, width: i32)[src]

pub fn set_sample_aspect_ratio(&mut self, sample_aspect_ratio: AVRational)[src]

pub fn set_pix_fmt(&mut self, pix_fmt: i32)[src]

pub fn set_time_base(&mut self, time_base: AVRational)[src]

pub fn set_sample_rate(&mut self, sample_rate: i32)[src]

pub fn set_channels(&mut self, channels: i32)[src]

pub fn set_sample_fmt(&mut self, sample_fmt: i32)[src]

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

pub fn set_bit_rate(&mut self, bit_rate: i64)[src]

pub fn set_strict_std_compliance(&mut self, strict_std_compliance: i32)[src]

pub fn set_gop_size(&mut self, gop_size: i32)[src]

pub fn set_max_b_frames(&mut self, max_b_frames: i32)[src]

impl AVCodecContext[src]

pub fn new(codec: &AVCodec) -> Self[src]

Create a new AVCodecContext instance, allocate private data and initialize defaults for the given AVCodec.

pub fn open(
    &mut self,
    dict: Option<AVDictionary>
) -> Result<Option<AVDictionary>>
[src]

Initialize the AVCodecContext.

dict: A AVDictionary filled with AVCodecContext and AVCodec private options. Function returns a AVDictionary filled with options that were not found if given dictionary. It can usually be ignored.

pub fn decode_packet(&mut self, packet: &AVPacket) -> Result<Option<AVFrame>>[src]

👎 Deprecated:

This is a wrapper around the deprecated api avcodec_decode_video2() and avcodec_decode_audio4().

This is a wrapper around the deprecated api avcodec_decode_video2() and avcodec_decode_audio4().

Return Some(frame) on getting a frame(AVFrame), return None on not getting frame(or say frame decoding haven’t finished), Return Err(_) on decoding error.

pub fn encode_frame(
    &mut self,
    frame: Option<&AVFrame>
) -> Result<Option<AVPacket>>
[src]

👎 Deprecated:

This is a wrapper around deprecated api: avcodec_encode_video2 and avcodec_encode_audio2.

This is a wrapper around deprecated api: avcodec_encode_video2 and avcodec_encode_audio2.

Return Some(Packet) on getting a packet(AVPacket), return None on not getting packet(or say packet encoding haven’t finished), Return Err(_) on decoding error.

pub fn send_packet(&mut self, packet: Option<&AVPacket>) -> Result<()>[src]

Trying to push a packet to current decoding_context(AVCodecContext).

pub fn receive_frame(&mut self) -> Result<AVFrame>[src]

Trying to pull a frame from current decoding_context(AVCodecContext).

pub fn send_frame(&mut self, frame: Option<&AVFrame>) -> Result<()>[src]

Trying to push a frame to current encoding_context(AVCodecContext).

pub fn receive_packet(&mut self) -> Result<AVPacket>[src]

Trying to pull a packet from current encoding_context(AVCodecContext).

pub fn set_codecpar(&mut self, codecpar: AVCodecParametersRef<'_>) -> Result<()>[src]

Fill the codec context based on the values from the supplied codec parameters.

pub fn extract_codecpar(&self) -> AVCodecParameters[src]

Get a filled AVCodecParameters based on the values from current AVCodecContext.

impl<'ctx> AVCodecContext[src]

pub fn codec(&'ctx self) -> AVCodecRef<'ctx>[src]

Get a reference to the AVCodec in current codec context.

Trait Implementations

impl Deref for AVCodecContext[src]

type Target = AVCodecContext

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl Drop for AVCodecContext[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.