The hardware kernel works on the physically contiguous memory. If the acceleration software library need physically contiguous memory, then the following utility APIs can be used:
VVASFrame* vvas_alloc_buffer (VVASKernel *handle, uint32_t size,
VVASMemoryType mem_type, VVASFrameProps *props)
Parameters:
handle - VVAS kernel handle which has kernel context
size - memory size to be allocated
mem_type - memory can be VVAS_FRAME_MEMORY or VVAS_INTERNAL_MEMORY
props - required when requesting VVAS_FRAME_MEMORY
Return:
VVASFrame handle on success or NULL on failure
If there is frequent memory allocation/deallocation is required, it is recommmended that you allocate from the memory pool. Allocate the memory from the memory pool managed by the GStreamer infrastructure plug-in. To allocate memory from a memory pool managed by the GStreamer Infrastructure plug-in, you must pass the “props” parameter value as VVAS_FRAME_MEMORY. If the “props” parameter value is set to VVAS_INTERNAL_MEMORY, then the memory is not allocated from a memory pool.
The following API is to free the memory that is allocated using the vvas_alloc_buffer() API.
void vvas_free_buffer (VVASKernel * handle, VVASFrame *vvas_frame)
Parameters:
handle - VVAS kernel handle which has kernel context
vvas_frame - VVASFrame handle allocated using vvas_alloc_buffer() API
Return:
None