Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MFCreateSourceReaderFromByteStream function

Creates the source reader from a byte stream.


HRESULT MFCreateSourceReaderFromByteStream(
  _In_  IMFByteStream   *pByteStream,
  _In_  IMFAttributes   *pAttributes,
  _Out_ IMFSourceReader **ppSourceReader


pByteStream [in]

A pointer to the IMFByteStream interface of a byte stream. This byte stream will provide the source data for the source reader.

pAttributes [in]

Pointer to the IMFAttributes interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be NULL.

ppSourceReader [out]

Receives a pointer to the IMFSourceReader interface. The caller must release the interface.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


Call CoInitialize(Ex) and MFStartup before calling this function.

Internally, the source reader calls the IMFSourceResolver::CreateObjectFromByteStream method to create a media source from the byte stream. Therefore, a byte-stream handler must be registered for the byte stream. For more information about byte-stream handlers, see Scheme Handlers and Byte-Stream Handlers.

This function is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.


Minimum supported client

Windows 7, Windows Vista and Platform Update Supplement for Windows Vista [desktop apps | UWP apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | UWP apps]

Minimum supported phone

Windows Phone 8.1







See also

Media Foundation Functions
Source Reader



© 2018 Microsoft