Hi, I am using LibArgus to capture frames from a camera on an EGLStream. Then I use the CUDA EGL Interop API to acquire the image as CUeglFrame
output_stream_settings_.reset(i_session_->createOutputStreamSettings(Argus::STREAM_TYPE_EGL));
....
cuEGLStreamConsumerAcquireFrame(&cuda_connection_, &cuda_resource_, &cuda_stream_, CUDA_EGL_INFINITE_TIMEOUT);
cuGraphicsResourceGetMappedEglFrame(&cuda_egl_frame_, cuda_resource_, 0, 0);
Debugging the output frame returns the following
CUeglFrame:
width: 1920
height: 1200
depth: 0
pitch: 0
planeCount: 2
numChannels: 1
frameType: array
colorFormat: YUV420 semi-planar ER
cuFormat: uint8
I need to wrap this image into a VPIImage. I attempted to create a VPI_IMAGE_BUFFER_CUDA_ARRAY buffer and set its data to the array contained in the CUeglFrame, but this didn’t work since VPICreateWrapper doesn’t work with VPI_IMAGE_BUFFER_CUDA_ARRAY buffers
VPIImageBuffer vpi_image_buffer;
vpi_image_buffer.cudaarray = reinterpret_cast<cudaArray_t>(cuda_egl_frame_.frame.pArray[0]);
VPIImageData vpi_image_data;
vpi_image_data.buffer = vpi_image_buffer;
vpi_image_data.bufferType = VPI_IMAGE_BUFFER_CUDA_ARRAY;
VPI_ERROR_INVALID_ARGUMENT: Wrapping of VPI_IMAGE_BUFFER_CUDA_ARRAY type isn't supported
Is there a way to achieve this EGL ↔ CUDA ↔ VPI Interoperability? Maybe by copying the data first to an NVBUFFER which is compatible with VPI, but I am not sure how to copy the data to that NvBuffer.