Freigeben über


MFCreateMediaBufferWrapper Function

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.

Syntax

HRESULT MFCreateMediaBufferWrapper(
  __in   IMFMediaBuffer *pBuffer,
  __in   DWORD cbOffset,
  __in   DWORD dwLength,
  __out  IMFMediaBuffer **ppBuffer
);

Parameter

  • pBuffer [in]
    A pointer to the IMFMediaBuffer interface of the original media buffer.

  • cbOffset [in]
    The start of the new buffer, as an offset in bytes from the start of the original buffer.

  • dwLength [in]
    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.)

  • ppBuffer [out]
    Receives a pointer to the IMFMediaBuffer interface. The caller must release the interface.

Rückgabewert

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

Rückgabecode Beschreibung
S_OK

The function succeeded.

E_INVALIDARG

The requested offset or the requested length is not valid.

 

Hinweise

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 mit Service Pack 2 (SP2) und höher.
  • Windows XP Media Center Edition 2005 with KB900325 (Windows XP Media Center Edition 2005) and KB925766 (Oktober 2006 Updaterollup für Windows XP Media Center Edition) installed.

Anforderungen

Mindestens unterstützter Client

Windows Vista

Mindestens unterstützter Server

Windows Server 2008

Header

Mfapi.h

Bibliothek

Mfplat.lib

DLL

Mfplat.dll

Siehe auch

Media Foundation Functions

Media Buffers