Редагувати

Поділитися через


MF_TRANSFORM_ASYNC attribute

Specifies whether a Media Foundation transform (MFT) performs asynchronous processing.

Data type

UINT32

Get/set

To get this attribute, call IMFAttributes::GetUINT32.

To set this attribute, call IMFAttributes::SetUINT32.

Remarks

The attribute is a Boolean value:

  • If the attribute is nonzero, the MFT performs asynchronous processing.
  • If the attribute is 0 or not set, the MFT is synchronous.

To get this attribute, first call IMFTransform::GetAttributes to get the MFT's attribute store. If that method succeeds, call IMFAttributes::GetUINT32 to get the attribute value. If either of the two methods fails, the MFT is synchronous.

For asynchronous MFTs, this attribute must be set to a nonzero value. For synchronous MFTs, this attribute is optional, but must be set to 0 if present.

Asynchronous MFTs are not compatible with earlier versions of Media Foundation. To use an asynchronous MFT, the client must set the MF_TRANSFORM_ASYNC_UNLOCK attribute on the MFT. (The Microsoft Media Foundation pipeline performs this step automatically.)

Examples

The following code tests whether an MFT performs asynchronous processing.

BOOL IsTransformAsync(IMFTransform *pMFT)
{
    BOOL bAsync = FALSE;
    IMFAttributes *pAttributes = NULL;

    HRESULT hr = pMFT->GetAttributes(&pAttributes);
    if (SUCCEEDED(hr))
    {
        bAsync = MFGetAttributeUINT32(pAttributes, MF_TRANSFORM_ASYNC, FALSE);
        pAttributes->Release();
    }

    return (bAsync != FALSE);
}

Requirements

Requirement Value
Minimum supported client
Windows 7 [desktop apps | UWP apps]
Minimum supported server
Windows Server 2008 R2 [desktop apps | UWP apps]
Header
Mftransform.h

See also

Alphabetical List of Media Foundation Attributes

Asynchronous MFTs

Transform Attributes

MF_TRANSFORM_ASYNC_UNLOCK