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.


.



Relevant Pages

  • RE: VMR9 and lost device
    ... I can not find any documented method of that name in VMR9. ... Instead I have found out that I can find the input pin VMR9 uses and the pin ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.win32.programmer.directx.video)
  • I encounter the same error, but my data does not have the benefit of record tags.
    ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ... where an initial response from the community or a Microsoft Support ... I am having trouble creating one input flat file. ...
    (microsoft.public.biztalk.general)
  • Where & How : GDI+ 1.1 for Visual_Studio_2008
    ... I can not find any reference for it in the Platform SDK. ... Version 1.1 in only distributed with Windows VISTA. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.win32.programmer.gdi)
  • Re: How do I Sleep for a specified amount of time and relinquish c
    ... Finally, the Windows thread scheduling is not a trivial topic, it is ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)
  • RE: WSE910 error due to time zone differences between client/serve
    ... synchronization problem between service client and server. ... timestamp header in the form of UTC time format. ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.webservices.enhancements)