BufferMediaFrame Class


Represents a frame from a MediaFrameSource that provides data in an IBuffer.

public ref class BufferMediaFrame sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BufferMediaFrame final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
public sealed class BufferMediaFrame
Public NotInheritable Class BufferMediaFrame
Object Platform::Object IInspectable BufferMediaFrame

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)


Get an instance of this class by accessing the BufferMediaFrame property of a MediaFrameReference object that was obtained from a media frame source. The BufferMediaFrame property of a MediaFrameReference will always be non-null. This is not true for other frame types, such as VideoMediaFrame, which will be null if the buffer doesn't contain 2D image data or contains data in an unknown format.

A BufferMediaFrame represents the 1D buffer. If the underlying sample returned by the pipeline contains non-consecutive data, the system uses IMFMediaBuffer.Lock to copy the 2D buffer into the 1D buffer. For this reason, it is recommended that you use BufferMediaFrame for arbitrary buffers, such as skeleton or body tracking data, but that you use VideoMediaFrame for 2D buffers to avoid extra copy operations.

For how-to guidance on using MediaFrameSource to capture frames, see Process media frames with MediaFrameReader.



Gets the buffer that contains the data for the BufferMediaFrame.


Gets the MediaFrameReference wrapper object associated with the BufferMediaFrame, which provides access to format information and other properties of the media frame.

Applies to

See also