Discussion:
VMR9 and lost device
(too old to reply)
Jens Pedersen
2007-05-23 13:15:03 UTC
Permalink
I use the VMR9 with a custom allocater/presenter and have a problem with
device reset.
I make surfaces with AllocateSurfaceHelper and a private texture as a render
target.
I set up the VMR9 to MixerPref9_RenderTargetYUV hoping that VMR9 will not
change the render target.
(See http://www.gamedev.net/community/forums/topic.asp?topic_id=380264)
When PresentImage is called, I StretchRect the image from the source to
my private texture. The private texture is then used in my own render loop
in a separate thread to render the final image.
This works fine.

BUT. When I make a lost device event with Ctrl-Alt-Del something goes wrong.
I release all the textures, vertex buffers, state buffers I have allocated.
(As control I write all the addresses each time I make a new buffer
and when it is released, and check the returned reference count is 0)
I wait for TestCooperativeLevel to return D3DERR_DEVICENOTRESET
and call Reset.
Then I get the debug print shown below.

I really don't think I have directly allocated any of the surfaces mentioned.
None of the surfaces I allocate have that size
and none of the addresses is the same as the addresses of any of the
surfaces I allocate.

Q1: Where is these surfaces allocated?
Q2: How do I release these surfaces?
Q3: Is there any way I can use the information in the debug prints to get
closer?
Q4: Can I configure VMR9 to avoid the problem?
--
Jens
BK Medical

Debug print:

Direct3D9: (ERROR) :The following D3DPOOL_DEFAULT surfaces/buffers/textures
still exist
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ad500 lAllocID=682
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748C5683
Direct3D9: (ERROR) : [5] : Address 748C5BBA
Direct3D9: (ERROR) : [6] : Address 748C659D
Direct3D9: (ERROR) : [7] : Address 748BCEB0
Direct3D9: (ERROR) : [8] : Address 748BED18
Direct3D9: (ERROR) : [9] : Address 5E046675
Direct3D9: (ERROR) : [10] : Address 5E03B74A
Direct3D9: (ERROR) : [11] : Address 5E048670
Direct3D9: (ERROR) : [12] : Address 5E0481D0
Direct3D9: (ERROR) : [13] : Address 5E0482BB
Direct3D9: (ERROR) : [14] : Address 5E04838D
Direct3D9: (ERROR) : [15] : Address 5E049A29
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ad140 lAllocID=672
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748C369E
Direct3D9: (ERROR) : [5] : Address 748C5B17
Direct3D9: (ERROR) : [6] : Address 748C659D
Direct3D9: (ERROR) : [7] : Address 748BCEB0
Direct3D9: (ERROR) : [8] : Address 748BED18
Direct3D9: (ERROR) : [9] : Address 5E046675
Direct3D9: (ERROR) : [10] : Address 5E03B74A
Direct3D9: (ERROR) : [11] : Address 5E048670
Direct3D9: (ERROR) : [12] : Address 5E0481D0
Direct3D9: (ERROR) : [13] : Address 5E0482BB
Direct3D9: (ERROR) : [14] : Address 5E04838D
Direct3D9: (ERROR) : [15] : Address 5E049A29
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3acc20 lAllocID=657
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3aca60 lAllocID=655
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac8a0 lAllocID=653
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac6e0 lAllocID=651
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac520 lAllocID=649
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C64
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) :All user created D3DPOOL_DEFAULT surfaces must be freed
before Reset can succeed. Reset Fails.
Direct3D9: (ERROR) :Reset failed and Reset/TestCooperativeLevel/Release are
the only legal APIs to be called subsequently
WenJun Zhang[msft]
2007-05-24 09:26:46 UTC
Permalink
Hi Jens,

One of our D3D engineer confirmed that occasionally the call to reset won't
match up with the hardware interrupt and the device cannot be freed at that
moment. Waiting for a few milliseconds is usually enough to solve this
issue. This may be what is occurring in this scenario.

I also reviewed former cases with the same symptom. One of them was caused
by bug in customer's code. They were holding on to a reference to a media
sample when the system entered this state.

Thanks.

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.
Jens Pedersen
2007-05-25 10:27:00 UTC
Permalink
Hi
Thanks for the answer. Unfortunately it does not help me so much.
I have tried to put in an extra Sleep( 100 ) after TestCooperativeLevel
have returned D3DERR_DEVICENOTRESET and before Reset.
That does not help.

But I have now traced the problem further. I got connected to the symbol
server!

It seems like the problem are the surfaces that is allocated from
InitializeDevice
with AllocateSurfaceHelper.
I can see the surfaces have a reference count of 1 after the call to
AllocateSurfaceHelper.
Later a call to GetSurface is made for each surface.
As in the VMR9 samples this also should increment
the reference count on each surface so now it is 2.

If I ensure the surfaces are deleted before my call to TestCooperativeLevel
by calling Release until the returned reference count is 0,
then Reset can be done.
However then I get an error from VMR9. See trace below.
This indicates to me that the problem is the VMR9 surfaces.

Q1: Is there any way I can use IVMRSurfaceAllocatorNotify9::NotifyEvent
to tell the VMR9 that it should reset and release the surfaces before I call
TestCooperativeLevel?

I have tried with EC_DISPLAY_CHANGES but that did not help.
quartz.dll!RELEASE<IDirectDrawSurface4>() + 0x12 bytes
quartz.dll!VMR9::CVMRInputPin::ReleaseAllocatedSurfaces() + 0x28 bytes
quartz.dll!VMR9::CVMRInputPin::DeleteSurfaces() + 0x5b bytes
quartz.dll!VMR9::CVMRInputPin::BreakConnect() + 0x7d bytes
quartz.dll!CBasePin::DisconnectInternal() + 0x16 bytes
quartz.dll!VMR9::CVMRInputPin::Disconnect() + 0x20 bytes
quartz.dll!CFilterGraph::Disconnect() + 0x2a bytes
quartz.dll!CFGControl::WorkerDisplayChanged() + 0xd1 bytes
quartz.dll!CFGControl::CGraphWindow::OnReceiveMessage() + 0x21bdc bytes
quartz.dll!WndProc() + 0x3e bytes
user32.dll!***@20() + 0x28 bytes
user32.dll!***@32() + 0xb7 bytes
user32.dll!***@8() + 0xdc bytes
user32.dll!***@4() + 0xf bytes
quartz.dll!ObjectThread() + 0x95 bytes
kernel32.dll!***@8() + 0x37 bytes

Regards
--
Jens
BK Medical
Hi Jens,
One of our D3D engineer confirmed that occasionally the call to reset won't
match up with the hardware interrupt and the device cannot be freed at that
moment. Waiting for a few milliseconds is usually enough to solve this
issue. This may be what is occurring in this scenario.
I also reviewed former cases with the same symptom. One of them was caused
by bug in customer's code. They were holding on to a reference to a media
sample when the system entered this state.
Thanks.
Sincerely,
WenJun Zhang
Microsoft Online Community Support
==================================================
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
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
WenJun Zhang[msft]
2007-05-28 10:05:37 UTC
Permalink
Hi Jens,

Have you tried calling DeleteSurfaces() explicitly to release them?

Thanks.

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.
Jens Pedersen
2007-05-29 07:15:00 UTC
Permalink
Hi
On which VMR9 interface is there a DeleteSurfaces.
I can not find any documented method of that name in VMR9.
Q1: where can I find this method.

Instead I have found out that I can find the input pin VMR9 uses and the pin
it is connected to.
On device lost I stop the video stream, disconnect the 2 pins and release
the surfaces once.
After reset I connect the two pins again.
This works fine.
Q2: Is this an acceptable way or is there any more efficient way to do it?
--
Jens
BK Medical
Post by WenJun Zhang[msft]
Hi Jens,
Have you tried calling DeleteSurfaces() explicitly to release them?
Thanks.
Sincerely,
WenJun Zhang
Microsoft Online Community Support
==================================================
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
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
WenJun Zhang[msft]
2007-06-06 09:56:53 UTC
Permalink
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.
Jens Pedersen
2007-06-08 07:10:01 UTC
Permalink
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
Post by WenJun Zhang[msft]
Hi Jens,
Assume your code refers to the Allocator sample in SDK. The implementation
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;
}
}
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;
}
http://msdn2.microsoft.com/en-us/library/ms867211.aspx
I hope this helps.
Sincerely,
WenJun Zhang
Microsoft Online Community Support
==================================================
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
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
WenJun Zhang[msft]
2007-06-11 06:29:24 UTC
Permalink
Jens,

Glad to see you've got solid solution on this.

Have a nice week.

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.
jayxiang
2011-01-12 16:21:45 UTC
Permalink
wjzhang wrote on 06/06/2007 05:56 ET
Post by WenJun Zhang[msft]
Hi Jens
Assume your code refers to the Allocator sample in SDK. The implementatio
of DeleteSurfaces should be like
void CAllocator::DeleteSurfaces(
CAutoLock Lock(&amp;m_ObjectLock)
// clear out the private textur
m_privateTexture = NULL
for( size_t i = 0; i &lt; 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
DeleteSurfaces()
hr = CreateDevice()
if (FAILED(hr)
return hr
MonitorFromWindow( m_window,MONITOR_DEFAULTTOPRIMARY ) )
if (FAILED(hr)
return hr
hr = S_OK
Reference
http://msdn2.microsoft.com/en-us/library/ms867211.asp
I hope this helps
Sincerely
WenJun Zhan
Microsoft Online Community Suppor
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti
ications
Note: The MSDN Managed Newsgroup support offering is for non-urgent issue
where an initial response from the community or a Microsoft Suppor
Engineer within 1 business day is acceptable. Please note that each follo
up response may take approximately 2 business days as the suppor
professional working with you may need further investigation to reach th
most efficient resolution. The offering is not appropriate for situation
that require urgent, real-time or phone-based interactions or comple
project analysis and dump analysis issues. Issues of this nature are bes
handled working with a dedicated Microsoft Support Engineer by contactin
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx
This posting is provided &quot;AS IS&quot; with no warranties, and confers n
rights
Q1: Is there any way I can use IVMRSurfaceAllocatorNotify9::NotifyEven
to tell the VMR9 that it should reset and release the surfaces before I cal
TestCooperativeLevel

I have tried with EC_DISPLAY_CHANGES but that did not help

I tried too, and cannot find any event to tell me that it should reset.
jayxiang
2011-01-14 13:42:42 UTC
Permalink
jayxiang wrote on 01/12/2011 11:21 ET
Post by jayxiang
wjzhang wrote on 06/06/2007 05:56 ET
Post by WenJun Zhang[msft]
Hi Jens
Assume your code refers to the Allocator sample in SDK. The implementatio
of DeleteSurfaces should be like
void CAllocator::DeleteSurfaces(
CAutoLock Lock(&amp;m_ObjectLock)
// clear out the private textur
m_privateTexture = NULL
for( size_t i = 0; i &lt; 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
DeleteSurfaces()
hr = CreateDevice()
if (FAILED(hr)
return hr
MonitorFromWindow( m_window,MONITOR_DEFAULTTOPRIMARY ) )
if (FAILED(hr)
return hr
hr = S_OK
Reference
http://msdn2.microsoft.com/en-us/library/ms867211.asp
I hope this helps
Sincerely
WenJun Zhan
Microsoft Online Community Suppor
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti
ications
Note: The MSDN Managed Newsgroup support offering is for non-urgent issue
where an initial response from the community or a Microsoft Suppor
Engineer within 1 business day is acceptable. Please note that each follo
up response may take approximately 2 business days as the suppor
professional working with you may need further investigation to reach th
most efficient resolution. The offering is not appropriate for situation
that require urgent, real-time or phone-based interactions or comple
project analysis and dump analysis issues. Issues of this nature are bes
handled working with a dedicated Microsoft Support Engineer by contactin
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx
This posting is provided &quot;AS IS&quot; with no warranties, and confer
n
Post by jayxiang
Post by WenJun Zhang[msft]
rights
Q1: Is there any way I can use IVMRSurfaceAllocatorNotify9::NotifyEven
to tell the VMR9 that it should reset and release the surfaces before I cal
TestCooperativeLevel
I have tried with EC_DISPLAY_CHANGES but that did not help
I tried too, and cannot find any event to tell me that it should reset
Q1: Is there any way I can use IVMRSurfaceAllocatorNotify9::NotifyEven
to tell the VMR9 that it should reset and release the surfaces before I cal
TestCooperativeLevel

I have tried with EC_DISPLAY_CHANGES but that did not help

I tried too, and cannot find any event to tell me that it should reset

Is there any event to tell me when it should reset?

Loading...