MFCreateLegacyMediaBufferOnMFMediaBuffer function (mfapi.h)

Converts a Media Foundation media buffer into a buffer that is compatible with DirectX Media Objects (DMOs).

Syntax

HRESULT MFCreateLegacyMediaBufferOnMFMediaBuffer(
  IMFSample      *pSample,
  IMFMediaBuffer *pMFMediaBuffer,
  DWORD          cbOffset,
  IMediaBuffer   **ppMediaBuffer
);

Parameters

pSample

Pointer to the IMFSample interface of the sample that contains the Media Foundation buffer. This parameter can be NULL.

pMFMediaBuffer

Pointer to the IMFMediaBuffer interface of the Media Foundation buffer.

cbOffset

Offset in bytes from the start of the Media Foundation buffer. This offset defines where the DMO buffer starts. If this parameter is zero, the DMO buffer starts at the beginning of the Media Foundation buffer.

ppMediaBuffer

Receives a pointer to the IMediaBuffer interface. This interface is documented in the DirectShow SDK documentation. The caller must release the interface.

Return value

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The function succeeded.
E_INVALIDARG
Invalid argument. The pIMFMediaBuffer parameter must not be NULL.

Remarks

The DMO buffer created by this function also exposes the IMFSample interface. If pIMFSample is NULL, all of the IMFSample methods return MF_E_NOT_INITIALIZED. Otherwise, they call through to the pIMFSample pointer.

If the Media Foundation buffer specified by pIMFMediaBuffer exposes the IMF2DBuffer interface, the DMO buffer also exposes IMF2DBuffer.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header mfapi.h
Library Mfplat.lib
DLL Mfplat.dll

See also

IMF2DBuffer

IMFMediaBuffer

IMFSample

Media Buffers

Media Foundation Functions