locked
Why do I get 0xc00d3e85(MF_E_SHUTDOWN) from MFCreateSourceReaderFromMediaSource? RRS feed

  • Question

  • I set camera as a IMFMediaSource to IMFSourceReader,and get 0xc00d3e85 error.

    But when I set the same IMFActivate to a IMFPMediaPlayer ,it works well.

    How can I resolve it?

    it's my code under:

        if (SUCCEEDED(hr))
        {
            hr = pActivate->ActivateObject(
                __uuidof(IMFMediaSource),
                (void**)&pSource
                );
        }
    
        //
        // Create the source reader.
        //
    
        // Create an attribute store to hold initialization settings.
    
        if (SUCCEEDED(hr))
        {
            hr = MFCreateAttributes(&pAttributes, 2);
        }
        if (SUCCEEDED(hr))
        {
            hr = pAttributes->SetUINT32(MF_READWRITE_DISABLE_CONVERTERS, TRUE);
        }
    
        // Set the callback pointer.
        if (SUCCEEDED(hr))
        {
            hr = pAttributes->SetUnknown(
                MF_SOURCE_READER_ASYNC_CALLBACK,
                this
                );
        }
        if (SUCCEEDED(hr))
        {
            hr = MFCreateSourceReaderFromMediaSource(
                pSource,
                pAttributes,
                &m_pReader
                );
        }


    Add:

    When I remove MF_SOURCE_READER_ASYNC_CALLBACK attribute,it return S_OK.

    but I need this attribute.How can I modify it?

    • Edited by shevaxp Tuesday, September 18, 2012 9:42 AM add some words
    Tuesday, September 18, 2012 8:45 AM

All replies

  • It sounds like you have not called MFStartup.  You must call MFStartupto initialize the MF platform before calling any other MF APIs.  Otherwise, when components need the platform (like async mode in the source reader) they will return MF_E_SHUTDOWN or sometimes even just hang indefinitely.  Also, make sure to call MFShutdown when you are done with MF.

    MFPlay calls MFStartup for you, which is why MFPlay works fine.

    Thursday, October 25, 2012 11:04 PM