Note that there are some explanatory texts on larger screens.

plurals
  1. PODirectShow IVMRSurfaceAllocator9 (YUV Mixing) DirectX Lost Device
    primarykey
    data
    text
    <p>I use a custom <code>IVMRSurfaceAllocator9</code> to render a video from DirectShow in a DirectX9 application. I have been trying to handle a lost device for my DirectX Device instance (for when the HDMI is [un]plugged in). I release all my DX Device dependent resources (Textures, Surfaces, etc), reset the DX Device then reload those resources. I do that just fine, everything starts rendering again (expect the video); when it comes to the custom IVMRSurfaceAlloctor9 I am having problems. I have tried three different things.</p> <p>Every single time, the video would just be black (or any other color I cleared the surface(s) to)</p> <p>Followed MSDN docs: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd407172%28v=vs.85%29.aspx" rel="nofollow">Supplying a Custom Allocator-Presenter for VMR-9 </a> I did every step on that page, at first I wasn't using the <code>IVMRSurfaceAllocatorNotify9::AllocateSurfaceHelper</code> to create the surface(s); but I switched to using it as well with no result. When I call <code>IVMRSurfaceAllocatorNotify9::ChangeD3DDevice</code>, it would call the <code>IVMRSurfaceAllocator9::InitializeDevice</code>. I'd recreate the surfaces, all was good. It then started calling <code>IVMRSurfaceAllocator9::GetSurface</code>, and <code>IVMRSurfaceAllocator9::PresentImage</code> with correct parameters just like it did before the lost device and reset</p> <p>Google Findings: <a href="http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.directx.video/2007-06/msg00127.html" rel="nofollow">VMR9 and lost device</a> I found a few posts saying to disconnect the pins from the source filter and VMR9 filters, and then reconnect them. I did just that with the same results as before. I even went a step further and I completely removed the VMR9 filter, disposed of it and created a new one to put in it's place with the same results.</p> <p>GraphEdit: After many ideas, I ended up starting to think the video decoders could be serving up blank images (as this isn't just a normal lost device, I completely lose the display/adapter and have to recreate the DX Device on a new [primary] adapter). So I recreated the DirectShow graph in the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd407274%28v=vs.85%29.aspx" rel="nofollow">Windows SDK Graph Edit tool</a> and force a lost device ([un]plug hdmi) and the VMR9 window handles it just fine; but at the first try I did not setup the VMR mixer settings like I do in the application (using <code>IVMRMixerControl9::SetMixingPrefs</code>). I change the VMR9 filter settings in the Graph Edit tool to do YUV mixing and force a lost device again, and to my dismay the VMR9 window goes black and stays black; the same result as in my application.</p> <p>After switching my application to RGB mixing, and resetting the DX Device the video is no longer black and continues like nothing ever happened.</p> <p>So my question is, why in YUV mixing mode can't my custom IVMRSurfaceAllocator9 (nor the default allocator) reinitialize properly after a lost DX Device?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload