Vpi nvbuffer question

why vpi[2.1.6] 35.1.0 agx have not api of vpiImageCreateNvBufferWrapper ?

nvidia@tegra-ubuntu:~/vpi2$ ls
bin doc etc include lib lib64 samples share
nvidia@tegra-ubuntu:~/vpi2$ grep NvBuffer -nr *
Binary file bin/vpi_demo_remap matches
Binary file bin/vpi_demo_stereo matches
include/vpi/Image.h:187: /** NvBuffer.
include/vpi/Image.h:188: * Please consult NvBuffer
include/vpi/Image.h:220: /** Image stored as an NvBuffer file descriptor.
include/vpi/Image.h:431: * @retval #VPI_ERROR_INVALID_ARGUMENT NvBuffer file descriptor is invalid.
include/vpi/Image.h:468: * @retval #VPI_ERROR_INVALID_OPERATION EGL/NvBuffer wrapping not supported on this platform.
Binary file lib/aarch64-linux-gnu/libnvvpi.so.2.1.6 matches
Binary file lib64/libnvvpi.so.2.1.6 matches
nvidia@tegra-ubuntu:~/vpi2$ head -n 1 /etc/nv_tegra_release

R35 (release), REVISION: 1.0, GCID: 31346300, BOARD: t186ref, EABI: aarch64, DATE: Thu Aug 25 18:41:45 UTC 2022

Without this api of ‘vpiImageCreateNvBufferWrapper’ , how do I import NvBuffer into vpiimage?

The old version had this api. Why is the new version missing?

huilian@localhost:~/xxw/vpi1$ ls
bin include lib64 samples share
huilian@localhost:~/xxw/vpi1$ grep NvBuffer -nr *
Binary file bin/vpi_demo_remap matches
include/vpi/Image.h:107: * - NvBuffer: \ref vpiImageCreateNvBufferWrapper
include/vpi/NvBufferInterop.h:51: * @file NvBufferInterop.h
include/vpi/NvBufferInterop.h:53: * Functions and structures for handling NvBuffer interoperability with VPI.
include/vpi/NvBufferInterop.h:67: * @ingroup VPI_NvBufferInterop NvBuffer interoperability
include/vpi/NvBufferInterop.h:75:/** Parameters for customizing NvBuffer wrapping.
include/vpi/NvBufferInterop.h:76: * These parameters are used to customize how NvBuffer wrapping will be made.
include/vpi/NvBufferInterop.h:77: * Make sure to call \ref vpiInitWrapNvBufferParams to initialize this
include/vpi/NvBufferInterop.h:84: * It it’s a valid color spec, override the color spec information in the wrapped NvBuffer.
include/vpi/NvBufferInterop.h:85: * If \ref VPI_COLOR_SPEC_DEFAULT, infer the color spec from the wrapped NvBuffer. /
include/vpi/NvBufferInterop.h:87:} VPIWrapNvBufferParams;
* Initialize \ref VPIWrapNvBufferParams with default values.
include/vpi/NvBufferInterop.h:98:VPI_PUBLIC VPIStatus vpiInitWrapNvBufferParams(VPIWrapNvBufferParams params);
include/vpi/NvBufferInterop.h:101: * Create an image object by wrapping an existing NvBuffer given its dmabuf_fd handle.
include/vpi/NvBufferInterop.h:105: * @ingroup VPI_NvBufferInterop
include/vpi/NvBufferInterop.h:107: * @param[in] dmabuf_fd Handle to the NvBuffer to be wrapped.
include/vpi/NvBufferInterop.h:108: * @param[in] params If not NULL, use the parameters to modify how the NvBuffer is wrapped.
include/vpi/NvBufferInterop.h:109: * Otherwise, it’ll use default NvBuffer handling.
include/vpi/NvBufferInterop.h:118:VPI_PUBLIC VPIStatus vpiImageCreateNvBufferWrapper(int32_t dmabuf_fd, const VPIWrapNvBufferParams params,
include/vpi/NvBufferInterop.h:122: * Redefines the wrapped NvBuffer memory in an existing \ref VPIImage wrapper.
include/vpi/NvBufferInterop.h:124: * The old wrapped NvBuffer and the new one must have same dimensions and format.
include/vpi/NvBufferInterop.h:126: * The VPIImage must have been created by \ref vpiImageCreateNvBufferWrapper.
include/vpi/NvBufferInterop.h:128: * This operation is efficient and does not allocate memory. The wrapped NvBuffer will be
include/vpi/NvBufferInterop.h:131: * The wrapped NvBuffer must not be deallocated while it’s still being wrapped.
include/vpi/NvBufferInterop.h:133: * @ingroup VPI_NvBufferInterop
include/vpi/NvBufferInterop.h:135: * @param[in] img Handle to image created by \ref vpiImageCreateNvBufferWrapper.
include/vpi/NvBufferInterop.h:136: * @param[in] dmabuf_fd The new NvBuffer to be wrapped.
include/vpi/NvBufferInterop.h:140:VPI_PUBLIC VPIStatus vpiImageSetWrappedNvBuffer(VPIImage img, int dmabuf_fd);
@} */ // end of VPI_NvBufferInterop
Binary file lib64/libnvvpi.so.1.0.15 matches
huilian@localhost:~/xxw/vpi1$ head -n 1 /etc/nv_tegra_release

R32 (release), REVISION: 5.0, GCID: 25531747, BOARD: t186ref, EABI: aarch64, DATE: Fri Jan 15 23:21:05 UTC 2021



The wrapper API has integrated to vpiImageCreateWrapper(.).


This api has not been used in any of the examples, can you give a simple demo

Do I need to call the api of vpiInitImageWrapperParams first? VPI_COLOR_SPEC_DEFAULT? Don’t have to specify nv12?
VPIImageData data;
VPIImage *img;
vpiImageCreateWrapper(&data,NULL,VPI_IMAGE_BUFFER_CUDA_PITCH_LINEAR,img )
Is it used in this way?

Is that right? Is there any mistake?


We don’t have a sample for NvBuffer wrapper currently.
Do you get any errors when wrapping it?


No error was reported.
Compared with the fisheye model, the polynomial model felt that the corrected image was cropped too much

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.