One big bug in the "WPF MediaKit" that I've really been putting off has handling the Direct3D device when it's lost. Well I think I've got it licked! See, a standard IDirect3DDevice9 will be lost (meaning you can not use it anymore and all resources in the default pool have to be recreated) in many different scenarios. For instance if you change your display resolution, or if you switch to another user or even hit ctrl-alt-del. In Vista, I use the IDirect3DDevice9Ex, which is simply amazing. The device is only lost when very bad things happen, such as a hung video driver or a new video driver has been installed.
Naturally, I thought that I wouldn't have to do any work for Vista if the device is pretty much never lost. But when I changed my video resolution my video disappeared! After ripping some hair out, it seems as if the D3DImage drops it's Surface backbuffer. With some help from D3DImage's event IsFrontBufferAvailableChanged, all was fixed with Vista.
For good form's sake...and the sake of XP, I wanted to handle the IDirect3DDevice9 when it is lost. With a handful of strategically placed lines of code, all looks good. I don't really have an XP machine to test it on, but I forced Vista to not use the 9Ex, changed the resolution. It caught the lost device and reinitialized it and the video continued on.
Also, I was forced to move the DirectShow stuff from STA or MTA, to MTA only. This is because a DirectShow has it's own thread running the PresentImage in the allocator that needed to talk to other COM and STA wasn't cutting it.
I'll try to upload a new version this weekend so you guys can tell me how it works :)
-Jer