Creates a media buffer that wraps an existing media buffer. The new media buffer points to the same memory as the original media buffer, or to an offset from the start of the memory.
HRESULT MFCreateMediaBufferWrapper( IMFMediaBuffer *pBuffer, DWORD cbOffset, DWORD dwLength, IMFMediaBuffer **ppBuffer );
A pointer to the IMFMediaBuffer interface of the original media buffer.
The start of the new buffer, as an offset in bytes from the start of the original buffer.
The size of the new buffer. The value of cbOffset + dwLength must be less than or equal to the size of valid data the original buffer. (The size of the valid data is returned by the IMFMediaBuffer::GetCurrentLength method.)
Receives a pointer to the IMFMediaBuffer interface. The caller must release the interface.
The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
||The function succeeded.|
||The requested offset or the requested length is not valid.|
The maximum size of the wrapper buffer is limited to the size of the valid data in the original buffer. This might be less than the allocated size of the original buffer. To set the size of the valid data, call IMFMediaBuffer::SetCurrentLength.
This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:
- Windows XP with Service Pack 2 (SP2) and later.
- Windows XP Media Center Edition 2005 with KB900325 (Windows XP Media Center Edition 2005) and KB925766 (October 2006 Update Rollup for Windows XP Media Center Edition) installed.
|Minimum supported client||Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 [desktop apps | UWP apps]|