EVR Dshow filter and DXVA2.0 API

Hi,

I am trying to use DXVA2 for decode video acceleration under vista. I have a DirectShow decoder filter (MPEG2 and works for XP with dxva1.0). I have the following issues.

1) I was under the impression that dxva1 to dxva2 will happen automatically when we use EVR filter. But it looks like the filter is decoding in pure software mode when using EVR and dxva1.

2) I am trying to implement DXVA2 api's by using the IMFGetService interface. But I am failing on getting the IDirectXVideoAccelerationService interface. It returned E_NOINTERFACE. Why this is happening

3) The sample dxva2.0 playback code which comes with Windows SDk uses D3d to initialize DXVA2. But is there any way to get the Service Interfaces from EVR filter. I was unable to get much documentation regarding those details. If there is any please give me some pointers.

rajy



Answer this question

EVR Dshow filter and DXVA2.0 API

  • Bryant Likes

    To get the IDirectXVideoAccelerationService interface, QI the EVR filter for IMFGetService, then call

    GetService(MR_VIDEO_ACCELERATION_SERVICE, IID_IDirect3DDeviceManager9, (LPVOID*)&pManager)

    Then call

    pManager->OpenDeviceHandle(&handle)

    and pass the resulting handle to

    pManager->GetVideoService(handle, IID_IDirectXVideoAccelerationService, (LPVOID*)&pService)

    Further, in DXVA2 mode, your decoder needs to act as the allocator and pass the decoder surfaces to the input pin of the EVR. In order to do this, the EVR's input pin needs to be specially configured for DXVA mode, so that it uses your allocator. After negotiating the media type, your decoder should QI the EVR's input pin for IDirectXVideoMemoryConfiguration. You will then call GetAvailableSurfaceTypeByIndex, iterating over the indices to verify that DXVA2_SurfaceType_DecoderRenderTarget is supported. If it is, you may call SetSurfaceType(DXVA2_SurfaceType_DecoderRenderTarget). At this point, the EVR's pin will be in DXVA mode, which means that it will accept your allocator when you call NotifyAllocator.

    The samples that you pass to the Receive method should implement IMFGetService. The EVR calls IMFGetService::GetService(MR_BUFFER_SERVICE, IID_IDirect3DSurface9, (LPVOID*)&pDDS) in order to retrieve the pointer to the IDirect3DSurface9 interface.

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



  • EVR Dshow filter and DXVA2.0 API