MFCreateStreamOnMFByteStreamEx

Creates an IRandomAccessStream object that wraps a Microsoft Media Foundation byte stream.

Syntax

HRESULT MFCreateStreamOnMFByteStreamEx(
         IMFByteStream *pByteStream,
         REFIID riid,
         _Outptr_ void **ppv
)  

Parameters

pByteStream
Type: IMFByteStream *

A pointer to the IMFByteStream interface of the Microsoft Media Foundation byte stream.

riid
Type: REFIID 

The interface identifier (IID) of the interface being requested.

ppv
Type: Outptr void **

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

Return value

Type: HRESULT 

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

Refer to Media Foundation return codes.

Remarks

The returned byte stream object exposes the IMFGetService interface. To get the original IMFByteStream pointer, call IMFGetService::GetService using the service identifier MF_WRAPPED_OBJECT.

Requirements

Header: Declared in mfidl.h.

Library: Use mfplat.lib.