Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,


I have a WPF (.NET 4) app and uses managed DirectX (DirectShow) for rendering videos.

During some operations on the UI (WPF Window), the calls to PresentImage() in our Allocator somehow lags behind. This causes flickering of the video being played. Although testing suggests that PresentImage() does get called at rate of the FPS, it's just that the calls are not equally spaced which causes the flickering.

Anyone faced with same scenario or have any idea to get it fixed?

Thanks in advance.
Posted

1 solution

You can use Thread.Sleep(milliseconds) function inside your render loop. May be that can solve your problem. As I was also going through the same problem when coding in .net3.5 and with slimdx sdk and used the same method on the render loop but keep in mind the number of milliseconds that you place in the function call. It depends upon how powerful your processor is. Something between 8-12 should work for dual core or above.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900