• Api Documentation
  • Source Code
Search Results for

    Show / Hide Table of Contents
    • JeremyAnsel.DirectX.MediaFoundation
      • MF2DBuffer
      • MFAttributes
      • MFDXGIDeviceManager
      • MFFactory
      • MFHelpers
      • MFMediaBuffer
      • MFMediaFormatGuids
      • MFMediaFormatGuids.Audio
      • MFMediaFormatGuids.Image
      • MFMediaFormatGuids.Video
      • MFMediaType
      • MFMediaTypeGuids
      • MFMediaTypeMajorGuids
      • MFReadWriteGuids
      • MFSample
      • MFSinkWriter
      • MFSinkWriterGuids
      • MFSourceReader
      • MFSourceReaderControlFlags
      • MFSourceReaderFlags
      • MFSourceReaderGuids
      • MFVideoInterlaceMode

    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

    Inheritance
    object
    DXComObject
    MFMediaBuffer
    Implements
    IDisposable
    Inherited Members
    DXComObject.Dispose()
    DXComObject.AddRef()
    DXComObject.Release()
    DXComObject.QueryInterface(in Guid)
    DXComObject.Handle
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: JeremyAnsel.DirectX.MediaFoundation
    Assembly: JeremyAnsel.DirectX.MediaFoundation.dll
    Syntax
    [SecurityCritical]
    public class MFMediaBuffer : DXComObject, IDisposable

    Constructors

    | Edit this page View Source

    MFMediaBuffer(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 Source

    MFMediaBufferGuid

    The interface GUID.

    Declaration
    public static readonly Guid MFMediaBufferGuid
    Field Value
    Type Description
    Guid

    Methods

    | Edit this page View Source

    AsMF2DBuffer()

    Declaration
    public MF2DBuffer? AsMF2DBuffer()
    Returns
    Type Description
    MF2DBuffer
    | Edit this page View Source

    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).

    | Edit this page View Source

    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
    | Edit this page View Source

    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
    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    Implements

    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top Copyright (c) 2026 Jérémy Ansel