Screen redrawing best practices? (for displaying video frames)

Hi everybody,
I have a video-surveillance application wich needs to draw multiple (even 16 or more) video frames (already decoded), each of those at 25fps.
I have a few questions:
-Is it better to use one single big panel with one thread which every X milliseconds calls repaint() and then in the display method draws each new frame at the correct position, or use one panel/thread per video, each of those calls repaint() when a new frame is ready to be drawn?
-Is it faster the glDrawPixel() or using textures and glTexSubImage()?
-Are there performance gains using PBOs for storing the frame to be drawn?

I hope I was clear…
Thanks in advance!

Sync everything with one thread. Draw at 25fps whether you’ve got updated video or not. Use glTexSubImage() not glDrawPixels(). Can’t help with PBO but I’d only worry about that it you’re experiencing performance problems to do with texture upload (highly unlikely unless each of your video panels is large but I suspect they’re pretty small if you’re fitting them on a 4x4 array?).

Cas :slight_smile:

Thanks for the immediate response!

I’ll follow your guidelines…

The video panel matrix can be changed by the user at runtime: it can vary from 1x1 to 6x6 array, and can be set fullscreen…
anyway, I don’t think i’m going to experience such performance problems.

Another question: in case I’ll have to go with PBOs, what is the max amount of memory i can allocate for PBOs? It will depend on the size of the RAM of the GPU I suppose… (I’m a complete n00b about openGL programming :slight_smile: )