Share via


DMORegister function (dmoreg.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The DMORegister function registers a DMO.

Syntax

HRESULT DMORegister(
  LPCWSTR                     szName,
  REFCLSID                    clsidDMO,
  REFGUID                     guidCategory,
  DWORD                       dwFlags,
  DWORD                       cInTypes,
  const DMO_PARTIAL_MEDIATYPE *pInTypes,
  DWORD                       cOutTypes,
  const DMO_PARTIAL_MEDIATYPE *pOutTypes
);

Parameters

szName

NULL-terminated string that contains a descriptive name for the DMO. Names longer than 79 characters might be truncated.

clsidDMO

Class identifier (CLSID) of the DMO.

guidCategory

GUID that specifies the category of the DMO. See DMO GUIDs for a list of category GUIDs.

dwFlags

Bitwise combination of zero or more flags from the DMO_REGISTER_FLAGS enumeration.

cInTypes

Number of input media types to register. Can be zero.

pInTypes

Pointer to an array of DMO_PARTIAL_MEDIATYPE structures that specify the input media types. The size of the array is specified in the cInTypes parameter

cOutTypes

Number of output media types to register.

pOutTypes

Pointer to an array of DMO_PARTIAL_MEDIATYPE structures that specify the output media types. The size of the array is specified in the cOutTypes parameter. Can be zero.

Return value

Returns an HRESULT value. Possible values include the following.

Return code Description
E_FAIL
Failure
E_INVALIDARG
Invalid argument
S_OK
Success

Remarks

This function adds information about a DMO to the registry. Applications or software components can use this information to locate the DMOs they need to use, by calling the DMOEnum function. For example, to encode a video stream, you would search in the DMOCATEGORY_VIDEO_ENCODER category for a DMO whose media types matched your requirements.

The media types registered by this function are only for the purpose of finding the DMO. They do not necessarily match the types returned by the IMediaObject::GetInputType and IMediaObject::GetOutputType methods. For example, a decoder might register just its main input types. After the DMO is created and its input type has been set, its GetOutputType method will return all of the decompressed types it can generate.

Requirements

Requirement Value
Target Platform Windows
Header dmoreg.h (include Dmo.h)
Library Msdmo.lib
DLL Msdmo.dll

See also

DMO Functions