locked
how to get the interface ID3D11VideoDecoderOutputView with the function CreateVideoDecoderOutputView()

    Question

  • Hello everyone,

    refer to http://msdn.microsoft.com/en-us/library/windows/desktop/hh162912(v=vs.85).aspx 

    when I developing video decoder and go to step "Allocating Uncompressed Buffers" ID3D11VideoDevice::CreateVideoDecoderOutputView ,as below:

    ComPtr<ID3D11Texture2D> pTex;

    ID3D11Resource *pResource;

    ID3D11VideoDecoderOutputView *pVideoDecoderOutputView;

    D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC desc;

    D3D11_TEXTURE2D_DESC textureDesc = {0};
       textureDesc.Width = m_imageWidthInPixels;
       textureDesc.Height = m_imageHeightInPixels;
       textureDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;    

    textureDesc.Usage = D3D11_USAGE_DEFAULT;  
       textureDesc.CPUAccessFlags = 0;        

     textureDesc.MiscFlags = 0;
       textureDesc.MipLevels = 1;

     textureDesc.ArraySize = 1;

        textureDesc.SampleDesc.Count = 1;
       textureDesc.SampleDesc.Quality = 0;

       textureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; 

       hr = m_pD3DDevice->CreateTexture2D(&textureDesc, nullptr, &pTex);

       pResource = (ID3D11Resource*)pTex;

       ZeroMemory(&desc,sizeof(desc));
       desc.DecodeProfile = m_pProfile;//D3D11_DECODER_PROFILE_MPEG2_IDCT
       desc.Texture2D.ArraySlice = 1;
       desc.ViewDimension = D3D11_VDOV_DIMENSION_TEXTURE2D;
       hr = m_pVideoDevice->CreateVideoDecoderOutputView(pResource,&desc, &pVideoDecoderOutputView);

    create failed of the interface ID3D11VideoDecoderOutputView and return "E_INVALIDARG", then I donot know why is it, can someone help me ,

    Thanks

    Jackic


    one work one gain!

    Thursday, September 13, 2012 9:53 AM

All replies

  • can someone know it, I 've retry many times, always failed.


    one work one gain!

    Wednesday, September 19, 2012 11:32 AM
  • In order to create decoder output view on given resource, the resource must be created with D3D11_BIND_DECODER binding.
    Wednesday, September 19, 2012 8:14 PM
  • Thanks to Hideyuki Nagase,

    I've got the interface of the VideoDecoderOutputView, I going to decoding video data by below steps,

    I knew my computer supported hardware decode with IDCT (mpeg2), could you tell me how to fill the video buffer or split buffer(with software decoder) then fill it, whether there have some functions or ways for getting IDCT buffer from video buffer or not ?

    Jackic


    one work one gain!

    Thursday, September 20, 2012 8:59 AM