Getting pointer from NvBuffer

The example code should work for RGBA. It is similar to
LibArgus EGLStream to nvivafilter - #14 by DaneLLL

For YUV422, you would need to try. Not sure if YUV422 is well supported in cv::gpu::gpuMat.

There is format conversion through hardware converter so throughput is good. For optimal performance of hardware converter, please refer to the post for disabling DFS:
Nvvideoconvert issue, nvvideoconvert in DS4 is better than Ds5? - #3 by DaneLLL