MFTRegister function (mfapi.h)

Adds information about a Media Foundation transform (MFT) to the registry.

Applications can enumerate the MFT by calling the MFTEnum or MFTEnumEx function.

Syntax

HRESULT MFTRegister(
  [in] CLSID                  clsidMFT,
  [in] GUID                   guidCategory,
  [in] LPWSTR                 pszName,
  [in] UINT32                 Flags,
  [in] UINT32                 cInputTypes,
  [in] MFT_REGISTER_TYPE_INFO *pInputTypes,
  [in] UINT32                 cOutputTypes,
  [in] MFT_REGISTER_TYPE_INFO *pOutputTypes,
  [in] IMFAttributes          *pAttributes
);

Parameters

[in] clsidMFT

The CLSID of the MFT. The MFT must also be registered as a COM object using the same CLSID.

[in] guidCategory

GUID that specifies the category of the MFT. For a list of MFT categories, see MFT_CATEGORY.

[in] pszName

Wide-character string that contains the friendly name of the MFT.

[in] Flags

Bitwise OR of zero or more of the following flags from the _MFT_ENUM_FLAG enumeration:

Value Meaning
MFT_ENUM_FLAG_ASYNCMFT
The MFT performs asynchronous processing in software. See Asynchronous MFTs. This flag does not apply to hardware transforms.

Requires Windows 7.

MFT_ENUM_FLAG_FIELDOFUSE
The application must unlock the MFT in order to use it. See IMFFieldOfUseMFTUnlock.

Requires Windows 7.

MFT_ENUM_FLAG_HARDWARE
The MFT performs hardware-based data processing, using either the AVStream driver or a GPU-based proxy MFT. MFTs in this category always process data asynchronously. See Hardware MFTs.
Note  This flag applies to video codecs and video processors that perform their work entirely in hardware. It does not apply to software decoders that use DirectX Video Acceleration to assist decoding.
 
Requires Windows 7.
MFT_ENUM_FLAG_SYNCMFT
The MFT performs synchronous processing in software. This flag does not apply to hardware transforms.
MFT_ENUM_FLAG_TRANSCODE_ONLY
The MFT is optimized for transcoding and should not be used for playback.

Requires Windows 7.

 

Setting Flags to zero is equivalent to setting the MFT_ENUM_FLAG_SYNCMFT flag. The default processing model for MFTs is synchronous processing.

Prior to Windows 7, the Flags parameter was reserved.

[in] cInputTypes

Number of elements in the pInputTypes array.

[in] pInputTypes

Pointer to an array of MFT_REGISTER_TYPE_INFO structures. Each member of the array specifies an input format that the MFT supports. This parameter can be NULL.

This parameter can be NULL. However, if the parameter is NULL, the MFT will be enumerated only when an application specifies NULL for the desired input type.

[in] cOutputTypes

Number of elements in the pOutputTypes array.

[in] pOutputTypes

Pointer to an array of MFT_REGISTER_TYPE_INFO structures. Each member of the array defines an output format that the MFT supports.

This parameter can be NULL. However, if the parameter is NULL, the MFT will be enumerated only when an application specifies NULL for the desired output type.

[in] pAttributes

Pointer to the IMFAttributes interface of an attribute store that contains additional registry information. This parameter can be NULL. If the parameter is non-NULL, the attributes are written to the registry as a byte array. You can use the MFTGetInfo function to retrieve the attributes.

The following attribute is defined for this parameter:

Value Meaning
MFT_CODEC_MERIT_Attribute
Contains the merit value of a hardware codec. See Codec Merit.

Return value

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

Remarks

The registry entries created by this function are read by the following functions:

Function Description
MFTEnum Enumerates MFTs by media type and category.
MFTEnumEx Extended version of MFTEnum.
MFTGetInfo Looks up an MFT by CLSID and retrieves the registry information.
 

This function does not register the CLSID of the MFT for the CoCreateInstance or CoGetClassObject functions.

To remove the entries from the registry, call MFTUnregister. If you remove an MFT from the system, you should always call MFTUnregister.

The formats given in the pInputTypes and pOutputTypes parameters are intended to help applications search for MFTs by format. Applications can use the MFTEnum or MFTEnumEx functions to enumerate MFTs that match a particular set of formats.

It is recommended to specify at least one input type in pInputTypes and one output type in the pOutputTypes parameter. Otherwise, the MFT might be skipped in the enumeration.

On 64-bit Windows, the 32-bit version of this function registers the MFT in the 32-bit node of the registry. For more information, see 32-bit and 64-bit Application Data in the Registry.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header mfapi.h
Library Mfplat.lib
DLL Mfplat.dll

See also

MFTEnumEx

Media Foundation Functions

Media Foundation Transforms

_MFT_ENUM_FLAG