More DirectShow problems....!

Started by
0 comments, last by mdias 19 years, 6 months ago
Hello there, I have implemented a custom render filter which acts almost identically to the Texture3D9 example in the SDK however I have one problem which some of you guys may have seen before. Occasionally when a video is being rendered to the Direct3D Texture I get white flashes on the texture, as if DirectShow has rendered one or two frames of complete white. Has anybody come accross this problem before with a render filter? I read somehwhere on here that I may need to add a Sleep(x) call in the main loop to allow the DirectShow threads time to catch up, but this doesn't seem to produce any concrete results, sometimes the flashes are better, sometimes worse. Any help would be greatly appreciated as I don't really know where to start looking. One thing I have noticed is that the flashes are more often near the beginning or end of the animation and less often near the middle. I have tried using the Debug mode to find this problem, but when I enable the Debug dll's in the control panel I get another problem. The video is no longer rendered to the screen at all although I know that the animation is running because I can hear the audio stream and the debug dll is producing output, any ideas?? Also the debugger tells me that I have an error in my rendering the error reads like this... Direct3D9: (ERROR) Cannot render primitive when currently set textures are locked I don't really know what it is getting at here, does this mean that the code in the other thread which draws to the texture has locked it and therefore the texture cannot be drawn on the primitive by the main thread? How could I get around this? Would I have to create two textures and flip between them? Thanks in advance. Mark Coleman [Edited by - mrmrcoleman on September 23, 2004 9:58:46 AM]
Advertisement
You need Synchronization Functions
you are looking for Critical Sections.
I don't have much time to explain it to you right now, follow the link.

This topic is closed to new replies.

Advertisement