pub unsafe extern "C" fn vsl_frame_alloc(
    frame: *mut VSLFrame,
    path: *const c_char
) -> c_int
Expand description

Allocates the underlying memory for the frame. This function will prefer to allocate using dmabuf and fallback to shared memory if dmabuf is not available, unless the frame has a path defined in which case shared memory is assumed. If the path begins with /dev then it assumed to point to a dmabuf-heap device. If path is NULL then the allocator will first attempt to create a dmabuf then fallback to shared memory.

Allocations will be based on a buffer large enough to hold height*stride bytes. If using a compressed fourcc such as JPEG the actual data will be smaller, this size can be captured when calling @ref vsl_frame_copy() as the function returns the number of bytes copied into the target frame. There is currently no method to capture the actual compressed size when receiving an already compressed frame. This limitation is because the size varies from frame to frame while the underlying buffer is of a fixed size. When the actual encoded size is important, the @ref vsl_frame_copy() should be called directly or the reported size communicated to the client through a separate channel.

@since 1.3 @memberof VSLFrame