locked
render video to texture

    Question

  •      I have use D3D11 video decoding tech to decode the video, which has been decribed in http://msdn.microsoft.com/en-us/library/windows/desktop/hh162912(v=vs.85).aspx.  in one of these step, I should create a texture, which the format must be DXGI_FORMAT_NV12, then I use CreateShaderResourceView to create a view that can be used to map on the mesh.

    When I used the CreateShaderResourceView interface , I just only use the DXGI_FORMAT_R8_UNORM or DXGI_FORMAT_R8G8_UNORM  view format, else will be  wrong, it is said in the http://msdn.microsoft.com/en-us/library/windows/desktop/bb173059(v=vs.85).aspx. When I use the DXGI_FORMAT_R8_UNORM  format , the render result is just only red channel.

    My question is how to set the view format or other ways,  the render result will be right?

    Thank you for your help

    Monday, April 09, 2012 8:37 AM

Answers

  • just drop an information here,

    your referrence document is for desktop application,

    are you writing desktop application or metro style application?

    if you're working on desktop application, you should post your question to desktop forum.


    ---------------------------------------------- JohnYe from SHANGHAI. email: yechzh@126.com

    Tuesday, April 10, 2012 3:20 AM

All replies

  • just drop an information here,

    your referrence document is for desktop application,

    are you writing desktop application or metro style application?

    if you're working on desktop application, you should post your question to desktop forum.


    ---------------------------------------------- JohnYe from SHANGHAI. email: yechzh@126.com

    Tuesday, April 10, 2012 3:20 AM
  • Hello,
     
    Thanks for your feedback, I will involve more experts to investigate it.
     
    Best regards,
    Jesse

    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 10, 2012 3:36 AM
    Moderator
  • I had this problem a number of times.

    The data is an unsigned int to get 32 bits for the colour.

    If the data is described in bytes the you need to write into 4 bytes.

    So writing into the first byte will only get you red.

    I found writing into all 4 bytes gave the full colour range.


    n.Wright

    • Proposed as answer by nigelwright7557 Monday, September 16, 2013 11:59 PM
    Monday, September 16, 2013 11:59 PM