Struct rsmpeg::avutil::AVFrameWithImageBuffer[][src]

pub struct AVFrameWithImageBuffer<'img> { /* fields omitted */ }
Expand description

It’s a AVFrame binded with AVImage, the AVFrame copies the buffer pointer from the AVImage.

Implementations

impl<'img> AVFrameWithImageBuffer<'img>[src]

pub fn new(
    image: &'img mut AVImage,
    width: i32,
    height: i32,
    format: i32
) -> Self
[src]

pub fn as_slice(&self) -> &[u8][src]

Methods from Deref<Target = AVFrame>

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

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

pub unsafe fn set_ptr(&mut self, ptr: NonNull<AVFrame>)[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 set_width(&mut self, width: i32)[src]

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

pub fn set_pts(&mut self, pts: i64)[src]

pub fn set_pict_type(&mut self, pict_type: AVPictureType)[src]

pub fn set_nb_samples(&mut self, nb_samples: i32)[src]

pub fn set_format(&mut self, format: i32)[src]

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

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

pub fn is_allocated(&self) -> bool[src]

Return true if the data and buffer of current frame is allocated.

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

Allocate new buffer(s) for audio or video data. The following fields must be set on frame before calling this function:

  • format (pixel format for video, sample format for audio)
  • width and height for video
  • nb_samples and channel_layout for audio

Return Error when the some of the frame settings are invalid, allocating buffer for an already initialized frame or allocation fails because of no memory.

pub fn data_mut(&mut self) -> &mut [*mut u8; 8][src]

pub fn linesize_mut(&mut self) -> &mut [c_int; 8][src]

pub unsafe fn fill_arrays(
    &mut self,
    src: *const u8,
    pix_fmt: AVPixelFormat,
    width: i32,
    height: i32
) -> Result<()>
[src]

Setup the data pointers and linesizes based on the specified image parameters and the provided array.

Safety

The buffer src points to cannot outlive the AVFrame. Recommend using fill_image_buffer() instead.

pub fn get_side_data(
    &'frame self,
    side_data_type: AVFrameSideDataType
) -> Option<AVFrameSideDataRef<'frame>>
[src]

pub fn get_motion_vectors(&'frame self) -> Option<&'frame [AVMotionVector]>[src]

Trait Implementations

impl<'img> Deref for AVFrameWithImageBuffer<'img>[src]

type Target = AVFrame

The resulting type after dereferencing.

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

Dereferences the value.

impl<'img> DerefMut for AVFrameWithImageBuffer<'img>[src]

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

Mutably dereferences the value.

Auto Trait Implementations

impl<'img> RefUnwindSafe for AVFrameWithImageBuffer<'img>

impl<'img> !Send for AVFrameWithImageBuffer<'img>

impl<'img> !Sync for AVFrameWithImageBuffer<'img>

impl<'img> Unpin for AVFrameWithImageBuffer<'img>

impl<'img> !UnwindSafe for AVFrameWithImageBuffer<'img>

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.