How to handle device lost with D3DDeviceManager ?

Hi, all:

How to handle device lost with D3DDeviceManager
If device lost is happend, how to notify other modules to free and re-create hw resource with D3DDeviceManager

Thanks



Answer this question

How to handle device lost with D3DDeviceManager ?

  • Jimmy_fingers

    Hi Fei-tian,

    I asked our D3D expert, and here's what he had to say:

    When the device is lost, everything works as it did previously until the device is restored. The EVR’s presenter is the only component that really knows of the device lost situation.

    When the device is restored, the D3D Device Manager owner calls IDirect3DDeviceManager9::ResetDevice, which invalidates all the handles. All clients of the device manager should have been polling using TestDevice during this time and TestDevice will now fail, as the handle is invalid. This is how we notify.

    Hope this helps...



  • Docpro777

    Thanks Becky ^_^:

    So each component must return "S_OK" when device lost. Is it right

    And I still have two questions:
    1) when device lost, a decoder which outputs DXVA2 buffers. But in this state, it cannot create DXVA2 buffers and it cannot lock the buffer for filling the frame. How does the decoder works as it did previously.

    2) in d3d exclusive mode, if device lost happend, presenter will try to re-create all d3d device and buffers. But, a decoder MFT may own some DXVA2 buffers and does not know device lost has happend yet, so the presenter cannot re-create d3d device due to the reference count is not Zero ><". That means previous exclusive mode device cannot be destory. So how to handle this problems.

    Thanks



  • Mojosound

    Besides opening a new handle and retrieving a new D3D device when TestDevice fails, upstream components do not need to do anything special to handle device loss. What you identify in 1 & 2 is handled under the covers so that the upstream component does not need to do anything special.

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



  • How to handle device lost with D3DDeviceManager ?