Freigeben über


Instantiating Codec DMOs

You can create a codec DMO by calling the CoCreateInstance COM function. You must pass the class identifier of the DMO, the interface identifier of IMediaObject, and a pointer to an IMediaObject pointer.

The class identifiers of the codec DMOs are defined as constants in the wmcodecdsp.h header file.

The constant for the IMediaObject interface identifier is IID_IMediaObject.

The following code example demonstrates how to create an instance of a codec DMO:

HRESULT CreateVideoEncoderDMO(IMediaObject** ppDMO)
{
    if(ppDMO == NULL)
        return E_POINTER;

    return CoCreateInstance(CLSID_CWMV9EncMediaObject,
                            NULL,
                            CLSCTX_INPROC_SERVER, 
                            IID_IMediaObject, 
                            (void**)ppDMO);
}

See Also

Working with Codec DMOs

 

 

Send comments about this topic to Microsoft

Build date: 4/7/2010