CreateVideoDecoder returns E_FAIL.....what am I doing wrong? RRS feed

  • Question

  • (I searched here....others threads with same issue didn't have anything that helped me)

    I'm doing this outside of a filter graph setup.
    CreateVideoDecoder returns E_FAIL, everything else before it, returns S_OK results.






    bool InitDXVA2HWDecoding()
    ...init stuff.... IDirect3DSurface9 *pSurf = NULL; hr = pDecoderService->CreateSurface(VIDEO_SUB_WIDTH, VIDEO_SUB_HEIGHT, 0, VIDEO_SUB_FORMAT, g_VPCaps.InputPool, 0, DXVA2_VideoDecoderRenderTarget, &pSurf, NULL); IDirect3DSurface9 *ppRTSurfaceArray[1]; UINT nSurfaceArrayCount = 1; DXVA2_ConfigPictureDecode Config = pConfigs[0]; ppRTSurfaceArray[0] = pSurf ; IDirectXVideoDecoder *pDirectXVideoDec; hr = pDecoderService->CreateVideoDecoder(DecoderGuid, &vidDesc, &Config, &ppRTSurfaceArray[0], nSurfaceArrayCount, &pDirectXVideoDec); //E_FAIL //... more code... if (pDecoderGuids) CoTaskMemFree(pDecoderGuids); // do this at some point if (pFormats) CoTaskMemFree(pFormats); // do this at some point if (pConfigs) CoTaskMemFree(pConfigs); // do this at some point }


    Wednesday, April 6, 2011 9:04 PM

All replies

  • I tried to CreateVideoDecoder from other GUIDs that you get from calling GetDecoderDeviceGuids.


    Some succeeded and some failed, I'm guessing that h264 hardware decoding is not supported on the pc I ran the code on.

    The thing is, that the DXVA2_ModeH264_E guid is one of the guids returned from that list, so what does that mean?

    If the guid is listed, does it mean it's supposed to be supported?

    Thursday, April 7, 2011 8:49 PM
  • I tried the same code at home, at home I have a better computer with a good video card, and it worked (the creating of decoder part).



    Thursday, April 7, 2011 11:06 PM
  • DXVA decoder support is very video device and driver dependent.  It is quite possible there is a bug in that original PC's video driver that exposes H264 support when it does not actually work.  There can also be issues where a device or driver will sometimes support CreateDecoder but not always -- for example, a driver might support two DXVA instances on the PC but no more.  All Microsoft decoders have a fallback plan (essentially falling back to software decode) if any of the DXVA setup does not work to prevent DXVA issues from affecting reliability.
    Friday, May 6, 2011 10:28 PM