Struct libdav1d_sys::Dav1dPicAllocator

source ·
#[repr(C)]
pub struct Dav1dPicAllocator { pub cookie: *mut c_void, pub alloc_picture_callback: Option<unsafe extern "C" fn(pic: *mut Dav1dPicture, cookie: *mut c_void) -> c_int>, pub release_picture_callback: Option<unsafe extern "C" fn(pic: *mut Dav1dPicture, cookie: *mut c_void)>, }

Fields§

§cookie: *mut c_void

< custom data to pass to the allocator callbacks.

§alloc_picture_callback: Option<unsafe extern "C" fn(pic: *mut Dav1dPicture, cookie: *mut c_void) -> c_int>

Allocate the picture buffer based on the Dav1dPictureParameters.

The data[0], data[1] and data[2] must be DAV1D_PICTURE_ALIGNMENT byte aligned and with a pixel width/height multiple of 128 pixels. Any allocated memory area should also be padded by DAV1D_PICTURE_ALIGNMENT bytes. data[1] and data[2] must share the same stride[1].

This function will be called on the main thread (the thread which calls dav1d_get_picture()).

@param pic The picture to allocate the buffer for. The callback needs to fill the picture data[0], data[1], data[2], stride[0] and stride[1]. The allocator can fill the pic allocator_data pointer with a custom pointer that will be passed to release_picture_callback(). @param cookie Custom pointer passed to all calls.

@note No fields other than data, stride and allocator_data must be filled by this callback. @return 0 on success. A negative DAV1D_ERR value on error.

§release_picture_callback: Option<unsafe extern "C" fn(pic: *mut Dav1dPicture, cookie: *mut c_void)>

Release the picture buffer.

If frame threading is used, this function may be called by the main thread (the thread which calls dav1d_get_picture()) or any of the frame threads and thus must be thread-safe. If frame threading is not used, this function will only be called on the main thread.

@param pic The picture that was filled by alloc_picture_callback(). @param cookie Custom pointer passed to all calls.

Trait Implementations§

source§

impl Clone for Dav1dPicAllocator

source§

fn clone(&self) -> Dav1dPicAllocator

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Dav1dPicAllocator

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Dav1dPicAllocator

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.