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§
< 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
impl Clone for Dav1dPicAllocator
source§fn clone(&self) -> Dav1dPicAllocator
fn clone(&self) -> Dav1dPicAllocator
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more