Class MFMediaBuffer
The IMFMediaBuffer interface represent a buffer of multimedia data for any possible multimedia type. It provides methods for accessing the buffer pointer, the current length, and the maximum length of the buffer
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.MediaFoundation
Assembly: JeremyAnsel.DirectX.MediaFoundation.dll
Syntax
[SecurityCritical]
public class MFMediaBuffer : DXComObject, IDisposable
Constructors
| Edit this page View SourceMFMediaBuffer(nint)
Initializes a new instance of the MFMediaBuffer class.
Declaration
public MFMediaBuffer(nint comPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | comPtr |
Fields
| Edit this page View SourceMFMediaBufferGuid
The interface GUID.
Declaration
public static readonly Guid MFMediaBufferGuid
Field Value
| Type | Description |
|---|---|
| Guid |
Methods
| Edit this page View SourceAsMF2DBuffer()
Declaration
public MF2DBuffer? AsMF2DBuffer()
Returns
| Type | Description |
|---|---|
| MF2DBuffer |
GetCurrentLength()
The GetCurrentLength method returns the current length of the media buffer.
Declaration
public uint GetCurrentLength()
Returns
| Type | Description |
|---|---|
| uint |
Remarks
A returned value of zero bytes indicates a media buffer with no valid data (an empty buffer).
GetMaxLength()
The GetMaxLength method allows the caller to retrieve the maximum length of the buffer represented by the IMFMediaBuffer object.
Declaration
public uint GetMaxLength()
Returns
| Type | Description |
|---|---|
| uint |
Lock(out nint, out uint, out uint)
Declaration
public void Lock(out nint ppbBuffer, out uint pcbMaxLength, out uint pcbCurrentLength)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | ppbBuffer | |
| uint | pcbMaxLength | |
| uint | pcbCurrentLength |
SetCurrentLength(uint)
The SetCurrentLength method allows the caller to set the current length of the media buffer.
Declaration
public void SetCurrentLength(uint cbCurrentLength)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | cbCurrentLength | Current length of the media buffer in bytes. |
Remarks
This method should be used anytime a client modifies the content of the media buffer in such a way that the length of valid data in the media buffer changes.
Unlock()
The Unlock method signals completion of the use of the buffer pointer acquired via the Lock method.
Declaration
public void Unlock()
Remarks
The buffer pointer acquired via Lock can no longer be used once the caller signals completion of that usage via the Unlock call. Also, note that Unlock must be called the same number of times that Lock has been called in order to signal completion of the use of the buffer pointer.