MF_SA_D3D11_USAGE attribute

Specifies how to allocate Microsoft Direct3D 11 surfaces for media samples. The usage directly reflects whether a sample is accessible by the CPU or GPU.

Data type

D3D11_USAGE stored as UINT32

Remarks

The value of this attribute is a D3D11_USAGE value.

Microsoft Media Foundation Transforms

In this context, the attribute applies only when the Microsoft Media Foundation transform (MFT) returns TRUE for the MF_SA_D3D11_AWARE attribute.

If an MFT supports Direct3D 11, this attribute provides a hint to the MFT when allocating Microsoft Direct3D surfaces for output. Set the attribute as follows:

  1. Call IMFTransform::GetOutputStreamAttributes to get the MFT attribute store.
  2. Call IMFAttributes::SetUINT32.

The Media Foundation pipeline sets the attribute before streaming starts. The MFT should attempt to honor the setting when it allocates surfaces. If that is not possible, the MFT can ignore the attribute, rather than failing the allocation.

In addition, if the MFT requires Direct3D surfaces for input, it can expose this attribute as a hint for how the input surfaces should be allocated. Query the attribute as follows:

  1. Call IMFTransform::GetInputStreamAttributes to get the input stream attributes.
  2. Call IMFAttributes::GetUINT32.

Sample Allocator

This attribute can be set on the video sample allocator, in the IMFVideoSampleAllocatorEx::InitializeSampleAllocatorEx method.

Requirements

Requirement Value
Minimum supported client
Windows 8 [desktop apps | UWP apps]
Minimum supported server
Windows Server 2012 [desktop apps | UWP apps]
Header
Mftransform.h

See also

Alphabetical List of Media Foundation Attributes