locked
DirectX APIs error?

    Question

  • Hi,

    Regarding on Windows Media foundation:

    namespace MEDIA { inline void ThrowIfFailed(HRESULT hr) { if (FAILED(hr)) { // Set a breakpoint on this line to catch DirectX API errors throw Platform::Exception::CreateException(hr); } } }

    That code throw out an error E-FAIL. I am using DirectX v11

    How to fix it?

    Regards,

    Weera


    Wednesday, March 11, 2015 7:23 PM

Answers

  • Hello,

    Thanks for providing the dump file. Unfortunately it is not all that helpful. If you can remove the SEH calls from around the API that is crashing and generate another dump file maybe we would have better luck. That said I am tracking another issue with the Media Engine and certain DX feature levels with different video drivers. While the dump file you provided looks different than the issue I am tracking it may be related.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, March 23, 2015 8:26 PM
    Moderator

All replies

  • Hello,

    Maybe I'm missing something but I don't believe you have provided enough information. Are you saying that "CreateException" always throws E_FAIL? Is there a Media Foundation function that is not included in your code snip-it? I guess we need much more information from you to really understand your problem.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, March 11, 2015 11:17 PM
    Moderator
  • Hi James,

    Q:

    Are you saying that "CreateException" always throws E_FAIL?

    ANS:

    Yes.

    I downloaded from following link.

    https://code.msdn.microsoft.com/windowsapps/Media-Engine-Playback-ce1c82f0

    ScreenShot

    https://onedrive.live.com/?cid=B692C2CBAD70A05C&id=b692c2cbad70a05c%211673

    I am new so that don't know how to get a working solution.

    Regards,

    Weera


    Thursday, March 12, 2015 2:18 AM
  • The failure is actually happening wherever ThrowIfFailed is being called from with an E_FAIL HRESULT. You need to set your debugger to break on the C++ Exception throw so you can more easily find out where it's coming from.

    See How to: Break When an Exception is Thrown

    PS: Note that if you are using VS 2013 Express for Windows Desktop, you should move to VS 2013 Community instead as it's more full-featured and includes the exception debugging dialog.

    Thursday, March 12, 2015 5:01 PM
  • Hi All,

    I got this error,

    Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll

    Regards,

    Weera


    Monday, March 16, 2015 11:52 AM
  • You should enable use of the Microsoft Symbol Server for your debugger.

    Monday, March 16, 2015 10:05 PM
  • Hi,

    Thanks Chuck and James, I would like to get a working solution because I haven't got much experience with C++ and Com.

    I enable use of the Microsoft Symbol Server for your debugger. However, for now, I got only blue screen with no error or no exception. It is still not working.

    Thanks and Best Regards,

    Weera

    Tuesday, March 17, 2015 6:13 AM
  • Hello,

    According to the screen shot you provided the exception is occurring in the "MEPlayer::OnTimer" function. Please modify the body of this function to look like this:

    LONGLONG pts;
    if (m_spMediaEngine->OnVideoStreamTick(&pts) == S_OK)
    {
        // new frame available at the media engine so get it 
        ComPtr<ID3D11Texture2D> spTextureDst;
    	m_spDX11SwapChain->GetBuffer(0, IID_PPV_ARGS(&spTextureDst));
    
    	m_spMediaEngine->TransferVideoFrame(spTextureDst.Get(), nullptr, &m_rcTarget, &m_bkgColor);
    
        // and the present it to the screen
    	m_spDX11SwapChain->Present(1, 0);
    }

    Now when you reproduce the problem your app will "crash" and break in the debugger. Once the app breaks in the debugger select "debug->Save dump as". Save the dump file to your local drive. You can then zip it up (please don't use RAR), put it on your OneDrive and post a link here. We will grab it and sync it with our internal symbols. We should then be able to give you some idea as to what might be causing the crash.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Tuesday, March 17, 2015 7:59 PM
    Moderator
  • Dear James,

     I appreciate your time and thank you for your help. To be honest, I did it as you told me. I got only black screen and no errors, no exception.

    Following line throw out the exception:

    MEDIA::ThrowIfFailed(
                    m_spMediaEngine->TransferVideoFrame(spTextureDst.Get(), nullptr, &m_rcTarget, &m_bkgColor)
                    );

    and I am not sure if the following would help because I have other directx sample, it is the same and works fine.

    spTextureDst = 0x030ba888 <No type information available in symbol file for d3d11.dll>

    Regards,

    Weera



    Tuesday, March 17, 2015 9:39 PM
  • Hello,

    When you see the exception can you please create a dump file using the instructions I detailed above? Without more information there is not much we can do to help.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, March 19, 2015 8:57 PM
    Moderator
  • Hi James,

    I followed you instruction then I got no errors, no exception, only black screen:

    LONGLONG pts;
    if (m_spMediaEngine->OnVideoStreamTick(&pts) == S_OK)
    {
       
    // new frame available at the media engine so get it
       
    ComPtr<ID3D11Texture2D> spTextureDst;
    m_spDX11SwapChain
    ->GetBuffer(0, IID_PPV_ARGS(&spTextureDst));

    m_spMediaEngine
    ->TransferVideoFrame(spTextureDst.Get(), nullptr, &m_rcTarget, &m_bkgColor);

       
    // and the present it to the screen
    m_spDX11SwapChain
    ->Present(1, 0);
    }

    Not sure if this help.

    https://onedrive.live.com/?cid=B692C2CBAD70A05C&id=B692C2CBAD70A05C%211675

    if not this should be all.

    Thanks and Best Regards,

    Weera




    Saturday, March 21, 2015 7:25 PM
  • Hello,

    Thanks for providing the dump file. Unfortunately it is not all that helpful. If you can remove the SEH calls from around the API that is crashing and generate another dump file maybe we would have better luck. That said I am tracking another issue with the Media Engine and certain DX feature levels with different video drivers. While the dump file you provided looks different than the issue I am tracking it may be related.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, March 23, 2015 8:26 PM
    Moderator
  • Hi James.

    Thanks for you help. Now I am understanding more. I will fix it.

    Thanks and Best Regards,

    Weera

    Wednesday, March 25, 2015 8:45 AM