I need to effectively stream out the framebuffer (images) to net.
The size(wxh) and format of streamed image can be various according to the request from net.
I think that the best way how to do that is prepare the output image in graphic card and then read out it to host ram and send it directly to net.
I’m using Framebuffer object(FBO) to render the framebuffer to the texture.
So I think about it this way:
- Create output texture that will hold the final image for streaming according to requested widthxheight and pixel format
- Set glPixelZoom to rescale image from framebuffer size to output size.
- Use glCopyTexImages2dPixels to transfer Framebuffer to output texture.
- Read out output texture with glGetTexImage to host memory.
(Maybe use PBO to allow asynchronous read out of output image).
Is there any other way how to do that task ?