locked
Why I get MF_E_SHUTDOWN from MFCreateSourceReaderFromURL?

    Question

  • I want to catch a videoThumbnail as a demo below.

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

    The demo is under desktop,but I want to do it under metro.

    my code is as this:

        hr = MFCreateAttributes(&pAttributes, 1);
    
        if (SUCCEEDED(hr))
        {
            hr = pAttributes->SetUINT32(MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING, TRUE);
        }   
       if (SUCCEEDED(hr))
       {
          String^ st = "Assets\\1.mp4";
    	hr = MFCreateSourceReaderFromURL((LPCWSTR)st->Data(), pAttributes, &m_pReader);
        }

    but it returns MF_E_SHUTDOWN from MFCreateSourceReaderFromURL.

    How can I do it right?

    Friday, May 04, 2012 8:00 AM

Answers

  • Hello Shevaxp,

    You need to make sure that the URL is formatted properly. I don't think you can use specific paths. Take a look at the Media Engine sample referenced below. If memory servers, this sample should show you how to interact between the ME and the file picker. I think that it should be the same with the source reader. Unfortunately I haven't verified this so if you run into any trouble please let me know and I will do what I can to help.

    Media engine native C++ playback sample
    http://code.msdn.microsoft.com/windowsapps/Media-Engine-Playback-ce1c82f0

    I hope this helps,

    James


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

    Tuesday, May 08, 2012 1:10 AM
    Moderator

All replies

  • Hello,

    Would you please upload the sample project to skydriver, so that we can analyze it deeply.
    http://skydrive.live.com/

    It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

    Best regards,
    Jesse


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

    Monday, May 07, 2012 8:14 AM
  • Hello Shevaxp,

    You need to make sure that the URL is formatted properly. I don't think you can use specific paths. Take a look at the Media Engine sample referenced below. If memory servers, this sample should show you how to interact between the ME and the file picker. I think that it should be the same with the source reader. Unfortunately I haven't verified this so if you run into any trouble please let me know and I will do what I can to help.

    Media engine native C++ playback sample
    http://code.msdn.microsoft.com/windowsapps/Media-Engine-Playback-ce1c82f0

    I hope this helps,

    James


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

    Tuesday, May 08, 2012 1:10 AM
    Moderator