PDA

View Full Version : using DirectDraw output as an OpenGL texture



gunslinger
04-14-2004, 01:09 AM
hi all,
i hope it isn't OT. In case... sorry!! :)

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?

jwatte
04-14-2004, 09:28 AM
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.

zeckensack
04-14-2004, 10:55 AM
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 :D

Won
04-14-2004, 11:17 AM
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

yooyo
04-14-2004, 04:32 PM
Do google for DsVideoLib... This is all what you need.

yooyo

gunslinger
04-14-2004, 10:51 PM
Originally posted by yooyo:
Do google for DsVideoLib... This is all what you need.

yooyoactually 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...

yooyo
04-16-2004, 05:34 AM
DsVideoLib work fine on my machine. I have test it with webcam, firewire camera and file source.

yooyo

gunslinger
04-16-2004, 06:01 AM
Originally posted by yooyo:
DsVideoLib work fine on my machine. I have test it with webcam, firewire camera and file source.

yooyohi 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???