using DirectDraw output as an OpenGL texture

hi all,
i hope it isn’t OT. In case… sorry!! :slight_smile:

now I am working on an application that should grab the output of a web cam and use it to texture map a surface. The theory is clear:
i get the pixmap and then i texsubimage2d it on a texture.
now i have been modifing an app of that kind, but the video played on the texture eventually sloooows down to 2 fps…
anyone knows where the problem may lay?

Have you profiled the application? What does VTune say? Is it leaking memory? How about Purify, or BoundsChecker, or one of those other leak tools? It seems unlikely to be a bug in the OpenGL, although you can test it on another machine with another graphics card; if the problem still persists, it’s likely in your code.

You are most probably “leaking” texture objects, ie for each frame of video you generate a new texture object instead of reusing the “old” established texture object. So you clog up all your local video memory with now-unused textures, start spilling to AGP memory and eventually force the driver to do texture swapping.

I could be wrong, but this would fit with your performance observations. Code please :smiley:

A leak sounds about right, but if you’re using TexSubImage, it seems unlikely that you’re leaking texture objects. Maybe you’re leaking pixmaps, or the direct draw surfaces?

Hard to tell without more details.

-Won

Do google for DsVideoLib… This is all what you need.

yooyo

Originally posted by yooyo:
[b]Do google for DsVideoLib… This is all what you need.

yooyo[/b]
actually I am using dsvideolib.
Again I hope not to fall too much OT, but can anyone point me a good OpenSource profiler? The only one i found was Nprof but it doesn’t feel like a very robust product…

DsVideoLib work fine on my machine. I have test it with webcam, firewire camera and file source.

yooyo

Originally posted by yooyo:
[b]DsVideoLib work fine on my machine. I have test it with webcam, firewire camera and file source.

yooyo[/b]
hi yooyo,
what kind of camera are you using? If i use a usb 1 webcam my app works fine, when i switch to a usb2 camera, it hangs. It sure looks like a driver problem, but no matter how much i struggle, i can’t fix it… anyone has got ideas???