MFCreateSourceReaderFromURL

Creates the source reader from a URL.

Syntax

HRESULT MFCreateSourceReaderFromURL(
         LPCWSTR pwszURL,
         IMFAttributes *pAttributes,
         IMFSourceReader **ppSourceReader
)  

Parameters

pwszURL
Type: LPCWSTR 

[in] The URL of a media file to open.

pAttributes
Type: IMFAttributes *

[in, optional] 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
Type: IMFSourceReader **

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

Return value

Type: HRESULT 

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

Refer to Media Foundation return codes.

Remarks

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

Internally, the source reader calls the IMFSourceResolver::CreateObjectFromURL method to create a media source from the URL.

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

Requirements

Header: Declared in mfreadwrite.h.

Library: Use mfreadwrite.lib.