Declaration of functions for NvBuffer interoperability. More...
Functions | |
VPIStatus | vpiImageCreateNvBufferWrapper (int dmabuf_fd, uint32_t flags, VPIImage *img) |
Create an image object by wrapping an existing NvBuffer given its dmabuf_fd handle. More... | |
VPIStatus | vpiImageSetWrappedNvBuffer (VPIImage img, int dmabuf_fd) |
Redefines the wrapped NvBuffer memory in an existing VPIImage wrapper. More... | |
Declaration of functions for NvBuffer interoperability.
The provided methods allows wrapping user-created NvBuffer objects (also known as dmabuf_fd
) to be used in VPI compute pipelines. NvBuffers are sometimes used to interface with Jetson Linux Multimedia API.
#include <vpi/Image.h>
Create an image object by wrapping an existing NvBuffer
given its dmabuf_fd handle.
The underlying image object does not own/claim the memory block.
[in] | dmabuf_fd | Handle to the NvBuffer to be wrapped. |
[in] | flags | Image flags. Here it can be specified in what backends the image can be used by or-ing together VPIBackend flags. Set flags to 0 to enable it in all backends supported by the active VPI context. |
[out] | img | Pointer to memory that will receive the created image handle. |
#include <vpi/Image.h>
Redefines the wrapped NvBuffer
memory in an existing VPIImage wrapper.
The old wrapped NvBuffer
and the new one must have same dimensions and format.
The VPIImage must have been created by vpiImageCreateNvBufferWrapper.
This operation is efficient and does not allocate memory. The wrapped NvBuffer
will be accessible to the same backends specified during wrapper creation.
The wrapped NvBuffer
must not be deallocated while it's still being wrapped.
[in] | img | Handle to image created by vpiImageCreateCudaMemWrapper. |
[in] | dmabuf_fd | The new NvBuffer to be wrapped. |