Skip to content

Latest commit

 

History

History
55 lines (32 loc) · 3 KB

video-samples.md

File metadata and controls

55 lines (32 loc) · 3 KB
description ms.assetid title ms.topic ms.date
Video Samples
1ee2ad6f-5e84-45ba-9849-cd3bd8e7eb29
Video Samples
article
05/31/2018

Video Samples

The video sample object is a specialized implementation of the IMFSample interface for use with the Enhanced Video Renderer (EVR). To create an instance of this object, call the MFCreateVideoSampleFromSurface function. The function takes a pointer to a Direct3D surface and returns a pointer to the IMFSample interface. The following types of objects should allocate samples using this function:

The video sample object implements the following interfaces:

If the pUnkSurface parameter of MFCreateVideoSampleFromSurface is non-NULL, the resulting video sample contains a single media buffer that encapsulates the Direct3D surface. This buffer object has limited functionality:

The only way to access the surface from the buffer is to call IMFGetService::GetService, using the service identifier MR_BUFFER_SERVICE.

If the pUnkSurface parameter is NULL, the video sample is created with zero media buffers. To add a buffer the sample, do the following:

  1. Create a Direct3D surface.

  2. Create a surface buffer by calling MFCreateDXSurfaceBuffer. For more information, see DirectX Surface Buffer.

  3. Add the buffer to the sample by calling IMFSample::AddBuffer.

Use this approach if you need the surface memory to be accessible through the IMF2DBuffer interface.

Related topics

Media Buffers

Media Samples