I'm reading this example of ffmpeg hardware decoding: https://github.com/FFmpeg/FFmpeg/blob/release/4.2/doc/examples/hw_decode.c
At line 109 it does this:
/* retrieve data from GPU to CPU */
if ((ret = av_hwframe_transfer_data(sw_frame, frame, 0)) < 0) {
which means that decoded video is in GPU. Since I want to render this video using Open GL, I guess it's much more efficient to not get this back to CPU but to actually render directly from GPU memory.
Is it possible to render directly from GPU memory?
What I know is that, in order to render from CPU memory, we usually send data from CPU using gltextImage2D function and the shaders will render it. If I want to pass data that is already on GPU, how do I do?