RE: VMR9 and lost device

Thanks for the reply.
But I think I stick the solution I have found myself:
Stop the graph.
Disconnect pins to VMR9.
Release the surfaces.
Connect the pins again. This will make VMR9 call InitializeDevice
Start the graph again.

This works fine.
BK Medical

""WenJun Zhang[msft]"" wrote:

Hi Jens,

Assume your code refers to the Allocator sample in SDK. The implementation
of DeleteSurfaces should be like:

void CAllocator::DeleteSurfaces()
CAutoLock Lock(&m_ObjectLock);

// clear out the private texture
m_privateTexture = NULL;

for( size_t i = 0; i < m_surfaces.size(); ++i )
m_surfaces[i] = NULL;

Then you can try doing something like this for device lost:

// Try to restore the device.
if (m_D3DDev->TestCooperativeLevel() == D3DERR_DEVICENOTRESET)
hr = CreateDevice();
if (FAILED(hr))
return hr;
hr = m_lpIVMRSurfAllocNotify->ChangeD3DDevice( m_D3DDev,
MonitorFromWindow( m_window,MONITOR_DEFAULTTOPRIMARY ) );
if (FAILED(hr))
return hr;
hr = S_OK;


I hope this helps.


WenJun Zhang

Microsoft Online Community Support


Get notification to my posts through email? Please refer to:

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:


This posting is provided "AS IS" with no warranties, and confers no rights.