Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This topic describes the process of configuring the codec DMOs. Each codec has specific procedures, but the information common to all is described here.
Every DMO supports specific input and output types. You can retrieve supported types for inputs and outputs by calling IMediaObject::GetInputType for inputs and IMediaObject::GetOutputType for outputs. You can enumerate the supported formats by making repeated calls to either method, incrementing the type index with each call. When the index exceeds that of the final supported type, the call returns DMO_E_NO_MORE_ITEMS.
For the video codecs, only one output type or input type is enumerated for a given media subtype. For the audio codecs, each individual supported type is enumerated. For more information about supported types for individual codecs, see Working with Audio and Working with Video.
After you configure the media types for the input and output streams, set them by calling IMediaObject::SetInputType and IMediaObject::SetOutputType respectively. Both of these methods return DMO_E_TYPE_NOT_ACCEPTED if the specified type is invalid.
All of the Windows Media Audio and Video codecs support a variety of encoding features. These features are generally configured by setting properties on the DMO by using the methods of the IPropertyBag interface. Some properties are configured using specialized codec interfaces. These interfaces are listed for each codec in the section Codec Objects.
The general order of operations for configuring an encoding DMO is as follows:
Decoding is simpler than encoding, as fewer decoder features are supported.
The general order of operations for configuring a decoding DMO is as follows:
Note
It is important to use the same media type for the decoder input as was used for the encoder output. This is because the Windows Media Audio and Video codecs use media formats with extra data. This data is appended to the structure pointed to by the pbFormat member of the DMO_MEDIA_TYPE structure (usually VIDEOINFOHEADER or WAVEFORMATEX). For some types the extra data is part of the enumerated encoder output type. Other types require you to append this data manually. Without the extended format data, you cannot decode the compressed content.
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today