In my current OpenGL application, I need to
be able to play an AVI/MPEG file at any time
(basic 2D rendering of the video, no need
for any 3D video-texture).
My problem is that when I do play the AVI
file, I''m loosing some of my textures (both
in software rendering and with my GeForce
2 MX OpenGL driver).
I''ve tried to play the video in a separate
process too, the results are the same.
I''m using DirectShow to render the video
file in a separate window, displayed just
over the OpenGL rendering window. This seems
to conflict with the OpenGL drivers.
But when I launch the AVI from the
Mediaplayer while my OpenGL app is running,
I don''t loose any texture.
Do you know how I could solve this problem ?
I don''t know if you''ve found this, but there''s a recent NeHe tutorial dealing with video. I haven''t gone throught it yet (I''ve got far more important things at the moment to do ), but it should help you out. I think it uses Video For Windows instead of DirectShow.
Sure, I took a look at this excellent tutorial, but it mainly explains how to render a video to a texture. In my case, I want to render the video + sound streams in my window.
After some more experiments, it appears that even if I launch the Mediaplayer application while my app is running, I also loose textures (either in software & hardware mode) !!!
I''ve found a workaround to my problem: after the video has finished to play, I recreate the OpenGL rendering context. But this involves reloading all the textures, which can be a pain and is really not elegant ... But it works.
If someone has a better way to do it, please let me know.