MFCreateTransformActivate function

Creates a generic activation object for Media Foundation transforms (MFTs).


HRESULT MFCreateTransformActivate(
  _Out_ IMFActivate **ppActivate


ppActivate [out]

Receives a pointer to the IMFActivate interface. The caller must release the interface.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


Most applications will not use this function; it is used internally by the MFTEnumEx function.

An activation object is a helper object that creates another object, somewhat similar to a class factory. The MFCreateTransformActivate function creates an activation object for MFTs. Before this activation object can create an MFT, the caller must initialize the activation object by setting one or more attributes on it.

MFT_TRANSFORM_CLSID_Attribute Required. Contains the CLSID of the MFT. The activation object creates the MFT by passing this CLSID to the CoCreateInstance function.
MF_TRANSFORM_CATEGORY_Attribute Optional. Specifies the category of the MFT.
MF_TRANSFORM_FLAGS_Attribute Contains various flags that describe the MFT. For hardware-based MFTs, set the MFT_ENUM_FLAG_HARDWARE flag. Otherwise, this attribute is optional.

Optional. Contains the merit value of a hardware codec.

If this attribute is set and its value is greater than zero, the activation object calls MFGetMFTMerit to get the trusted merit value for the MFT. If the trusted merit is less than the value of this attribute, the activation object's IMFActivate::ActivateObject method fails and returns MF_E_INVALID_CODEC_MERIT.

MFT_ENUM_HARDWARE_URL_Attribute Required for hardware-based MFTs. Specifies the symbolic link for the hardware device. The device proxy uses this value to configure the MFT.

Optional. Contains an IMFFieldOfUseMFTUnlock pointer, which can be used to unlock the MFT. The IMFFieldOfUseMFTUnlock interface is used with MFTs that have usage restrictions.

If this attribute is set and the MF_TRANSFORM_FLAGS_Attribute attribute contains the MFT_ENUM_FLAG_FIELDOFUSE flag, the activation object calls IMFFieldOfUseMFTUnlock::Unlock when it creates the MFT. An application can also set the MFT_FIELDOFUSE_UNLOCK_Attribute attribute without setting the MFT_ENUM_FLAG_FIELDOFUSE flag. In that case, the application must call Unlock.


Optional. Contains the encoding profile for an encoder. The value of this attribute is an IMFAttributes pointer.

If this attribute is set and the value of the MF_TRANSFORM_CATEGORY_Attribute attribute is MFT_CATEGORY_AUDIO_ENCODER or MFT_CATEGORY_VIDEO_ENCODER, the activation object uses the encoding profile to configure the MFT. The MFT must expose either ICodecAPI or IPropertyStore for this purpose.


Optional. Specifies the preferred output format for an encoder.

If this attribute set and the value of the MF_TRANSFORM_CATEGORY_Attribute attribute is MFT_CATEGORY_AUDIO_ENCODER or MFT_CATEGORY_VIDEO_ENCODER, the activation object sets this media type on the MFT.


For more information about activation objects, see Activation Objects.


Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]







See also

Activation Objects
Media Foundation Functions
Media Foundation Transforms