hi, I want to implement the conversion from nvbufsurface to GPU memory, such as converting the decoded nvbufsurface from “nvbuf-surface ->surfaceList ->mappedAddr. addr [0] nvbuf-surface ->surfaceList ->mappedAddr. addr [0]” to “void * dev_ptr”, which can be accessed freely by CUDA and TensorRT without deep copying of data.
After converting nvbufsurface to void, it does not affect normal loop decoding
Finally, convert dev_ptr to NVBufSurface and use nvosd to draw the tensorrt output’s rect text on the image. I checked that there is no such case in “~/jetpack dec enc/jetson_dec_5.0.2/build”
Although HandleEGLImage can use CUDA, I hope to preserve the original data of nvbufsurface to “void *dev_ptr” without copying it, and not affect decoding
I saw an “NvBufSurface2Raw” API that can convert nvbufsurface data into ptr, but it will make a copy. Is there anything that cannot be copied?
I have reviewed this sample, but the buffer is related to the nvbufsurface. I hope to keep the decoded data independent of the nvbufsurface and not affect the decoding overlay in the loop. However, the original data still exists, so that I can keep this part of the original data in memory and give it to other modules (asynchronous).
I have found another issue that drawing frames and text on images are different for NVOSD input.
Can I use the CUDA kernel function to write text on top of RGB/BGR images? Can you provide an example, as NVOSD input is different and I need to frequently convert their formats