Recently I've been doing a lot of experiments using D3DImage. I implemented buffered video playback in WPF through DirectShow using a custom allocator in renderless mode. I always render +-100 frames ahead of the current position of the video to be displayed.
(.NET 3.5 Windows 7 64bit)
Nonbuffered playback was implemented before and works perfectly.
My first attempt was to store every one of these buffered frames in a D3DImage, backed by a fixed assigned Direct3D Surface. When a buffered frame was no longer needed, the D3DImage was reused to render a new frame. This implementation worked. Calling the
sequence of Lock(), AddDirtyRect() and Unlock() to update the D3DImage however didn't seem to work properly at all times. Black frames occurred, or the D3DImage still contained the previously used frame. Let's say +- 4 out of 100 frame displays were erronous.
As mentioned in http://msdn.microsoft.com/en-us/library/cc656910.aspx: "As the number of
instances increases, more flushing occurs, and performance degrades. Therefore, you should use
This made me assume I was instantiating too much D3DImag
View Complete Post