Declaration of functions for NvBuffer interoperability. More...
Data Structures | |
struct | VPIWrapNvBufferParams |
Parameters for customizing NvBuffer wrapping. More... | |
VPIStatus | vpiImageCreateNvBufferWrapper (int32_t dmabuf_fd, const VPIWrapNvBufferParams *params, 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.
struct VPIWrapNvBufferParams |
Parameters for customizing NvBuffer wrapping.
These parameters are used to customize how NvBuffer wrapping will be made. Make sure to call vpiInitWrapNvBufferParams to initialize this structure before updating its attributes. This guarantees that new attributes added in future versions will have a suitable default value assigned.
Definition at line 81 of file NvBufferInterop.h.
Data Fields | ||
---|---|---|
VPIColorSpec | colorSpec |
Overriden VPIColorSpec of the wrapped Nvbuffer. It it's a valid color spec, override the color spec information in the wrapped NvBuffer. If VPI_COLOR_SPEC_DEFAULT, infer the color spec from the wrapped NvBuffer. |
VPIStatus vpiImageCreateNvBufferWrapper | ( | int32_t | dmabuf_fd, |
const VPIWrapNvBufferParams * | params, | ||
uint32_t | flags, | ||
VPIImage * | img | ||
) |
#include <vpi/NvBufferInterop.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] | params | If not NULL, use the parameters to modify how the NvBuffer is wrapped. Otherwise, it'll use default NvBuffer handling. |
[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/NvBufferInterop.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 vpiImageCreateNvBufferWrapper. |
[in] | dmabuf_fd | The new NvBuffer to be wrapped. |