MFCreateSourceReaderFromByteStream return 0xc00d36c4 for extended video format


  • Hello:

        I'm writting code about extended video playback with video format(.rm). Playback is okay but it will fail(hr=0xc00d36c4) when call MFCreateSourceReaderFromByteStream to get the video thumbnail

        // Register custom ByteStreamHandler and custom decoder.
         m_extensions = ref new MediaExtensionManager();

         m_extensions->RegisterByteStreamHandler("Test.RMByteStreamHandler", ".rm", "video/testrm");
         m_extensions->RegisterAudioDecoder("Test.RADecoder", Guid(MEDIASUBTYPE_RA), Guid(GUID_NULL));
          m_extensions->RegisterVideoDecoder("Test.RVDecoder", Guid(MEDIASUBTYPE_RV), Guid(GUID_NULL));


      task<StorageFile^>(StorageFile::GetFileFromPathAsync(Path)).then([this](StorageFile^ file) -> IAsyncOperation<IRandomAccessStream^>^
          return file->OpenAsync(FileAccessMode::Read);
      }).then([this,bManual](IRandomAccessStream^ strm)



            //Try to get the video thumbnail by MF SourceReader


        //First Get IMFSourceReader

        IMFSourceReader*  pMFSourceReader = NULL;
        UINT32  nWidth = 0, nHeight = 0;
        UINT32  nAspectX = 0, nAspectY = 0;
        LONGLONG llDuration = 0;
        HRESULT   hr = S_OK;
           //Get IMFSourceReader
           IRandomAccessStream ^pStream = strm;
           IMFByteStream*  pMFByteStream = NULL;

          hr = MFCreateMFByteStreamOnStreamEx((IUnknown*)pStream, &pMFByteStream);
          IMFAttributes  *pAttr = NULL;
          hr = pMFByteStream->QueryInterface(__uuidof(IMFAttributes),(void**)&pAttr);
          if (pAttr)
               hr = pAttr->SetString(MF_BYTESTREAM_CONTENT_TYPE,L"video/testrm");
          IMFAttributes  *pAttr = NULL;
         hr = MFCreateSourceReaderFromByteStream(pMFByteStream,pAttr,&pMFSourceReader);//Now it will fail with  0xc00d36c4


       My Questions:

       1.How to create SourceReader for extended video source?

       2.How to get the thumbnai for extended video format?

    Best Wishes,


    Tuesday, July 03, 2012 2:51 AM

All replies

  • Xinhua,

    Is this link helpful:  http://msdn.microsoft.com/en-us/library/aa371872.aspx

    Best Wishes - Eric

    Wednesday, July 04, 2012 1:08 AM
  • Eric:

    You link is for Microsoft Media Foundation.

    I'm writting metro codec on W8 8400.It will succeed when call MFCreateSourceReaderFromByteStream if the video file is system suppprted.But it will fail(hr= 0xc00d36c4) if the video file is system no suppprted even if I register it by call RegisterByteStreamHandler("Test.RMByteStreamHandler", ".rm", "video/testrm");

    My question is:

    1.if the WRT API (registerByteStreamHandler) is useless when call Win32 API(MFCreateSourceReaderFromByteStream)?

    2.If so,what's the resolution to get the video thumbnail for extended video format on metro APP?


    Wednesday, July 04, 2012 2:21 AM