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.
Reset
Connect the pins again. This will make VMR9 call InitializeDevice
Start the graph again.

This works fine.
--
Jens
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:

if ( hr == D3DERR_DEVICELOST)
{
// Try to restore the device.
if (m_D3DDev->TestCooperativeLevel() == D3DERR_DEVICENOTRESET)
{
DeleteSurfaces();
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;
}

Reference:
http://msdn2.microsoft.com/en-us/library/ms867211.aspx

I hope this helps.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

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:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

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


.