pub unsafe extern "C" fn dav1d_data_wrap_user_data(
    data: *mut Dav1dData,
    user_data: *const u8,
    free_callback: Option<unsafe extern "C" fn(user_data: *const u8, cookie: *mut c_void)>,
    cookie: *mut c_void
) -> c_int
Expand description

Wrap a user-provided data pointer into a reference counted object.

data->m.user_data field will initialized to wrap the provided $user_data pointer.

$free_callback will be called on the same thread that released the last reference. If frame threading is used, make sure $free_callback is thread-safe.

@param data Input context. @param user_data The user data to be wrapped. @param free_callback Function to be called when we release our last reference to this data. In this callback, $user_data will be the $user_data argument to this function, and $cookie will be the $cookie input argument to this function. @param cookie Opaque parameter passed to $free_callback.

@return 0 on success. A negative DAV1D_ERR value on error.