Hi Nvidia,
I need fast(HW) copy argus frame from camera to CUDA Npp8u* buffer.
I have the frame:
[b]UniqueObj< Frame > frameLeft{ iFrameConsumerLeft->acquireFrame() };
IFrame * iFrameLeft{ interface_cast< IFrame >( frameLeft ) };
NV::IImageNativeBuffer * iNativeBufferLeft{ interface_cast< NV::IImageNativeBuffer >( iFrameLeft->getImage() ) };
int fdLeft = iNativeBufferLeft->createNvBuffer( STREAM_SIZE, NvBufferColorFormat_YUV420, NvBufferLayout_Pitch );
EGLImageKHR egl_imageLeft{ NvEGLImageFromFd( egl_display, fdLeft ) };
CUgraphicsResource pResourceLeft;
cuGraphicsEGLRegisterImage( & pResourceLeft, * egl_imageLeft, CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE );
CUeglFrame eglFrameLeft;
cuGraphicsResourceGetMappedEglFrame( & eglFrameLeft, pResourceLeft, 0, 0 );[/b]
and i have Npp8 buffer:
[b]Npp8u* pPanoImgCUDA = nppiMalloc_8u_C2( STREAM_SIZE.width(), STREAM_SIZE.height(), & panoPitch );
[/b]
and then i will convert yuv frame to rgb: nppiYUV422ToRGB_8u_C2C3R(***)
How i can do copy frame data to Npp8u buffer?
It is device to device or host to device?
[s]May be i need somthing like this:
[b]NvBufferParams params;
NvBufferGetParams(fdLeft, ¶ms);
for (int i = 0; i < params.num_planes; i++) {
uint32_t width = params.width[i];
uint32_t height = params.height[i];
uint32_t pitch = params.pitch[i];
size_t fsize = pitch * height;
uint8_t* data_mem = (uint8_t*)mmap(0, fsize, PROT_READ | PROT_WRITE, MAP_SHARED, fdLeft, params.offset[i]);
...(data_mem, pitch);
}
[/b]
It is HW copy?
[/s]
Please help.
Best regards, Viktor.