PDA

View Full Version : multi video to texture



yang11
04-02-2002, 01:50 PM
hi,
I am writing a GL app to render multiple live video screams. What is the fastest way to do this?

The code is multi-threaded. The GL rendering context and the video cap are in different threads. I found that the call glTexSubImage2D in the video cap thread has no effect (it doesn't update the video texture at all)

If I only update the texture in the glutIdle call, then all the texture updates have to be serialized, not very efficient.

What I really want is that once I get a new frame, I want to throw it into texture mem -- in a different thread.

Any suggestions?

I seem to recall that I can do this with directX, i.e. DirectX is thread safe. Is this true?


thanks in advance.

ruigang

Korval
04-02-2002, 02:08 PM
If I recall correctly, if you create a rendering context in Thread A, it can only be used in Thread A. You're probably going to need to do some tight synchronization between threads to pull this off.