Microsoft DirectX 8.0

Introduction to DirectX Media Objects

Microsoft® DirectX® Media Objects (DMOs) are a new way to write data-streaming components. In some respects, DMOs are similar to Microsoft® DirectShow® filters. Like a DirectShow filter, a DMO takes input data and uses it to produce output data. However, the application programming interfaces (APIs) for DMOs are much simpler than the corresponding APIs for DirectShow. As a result, DMOs are easier to create, easier to test, and easier to use.

DMOs are fully compatible with DirectShow, but applications can use DMOs without using DirectShow. Within a DirectShow application, DMOs are wrapped by a DirectShow filter called the DMO Wrapper filter. The distinction between filters and DMOs is transparent to the application, which does not need to use the DMO APIs. On the other hand, applications not based on DirectShow can use DMOs directly. Thus, by writing a DMO, you create a component that can be used in a wide range of applications.

How DMOs Differ from DirectShow Filters

DirectShow filters work only within a DirectShow filter graph. The filter graph manager mediates between the application and the filters in the graph. DMOs do not have this requirement; an application can use a DMO by itself.

In DirectShow, filters do much of the work required to stream data. This includes:

In contrast, a DMO does none of these things. Instead, these kinds of tasks become the responsibility of the client using the DMO. The client allocates buffers and fills them with data. Then it delivers the buffers to the DMO, which processes them. The client retrieves the output buffers.

Within DirectShow, the DMO Wrapper filter is the client of the DMO, so it handles all of these tasks. Other applications can provide their own implementations.

Why DMOs?

DMOs offer the following advantages:

For these reasons, you should implement a DMO rather than a DirectShow filter whenever possible. However, there may be situations when a DMO is not suitable. For example:

DMO Test Application

The DirectX 8.0 SDK includes a DMO test application, named DMOTest. The test application can help verify that a DMO meets the DMO specifications. The application is installed in the Bin\DXUtils directory, under the SDK root directory. If you develop a DMO, you should include the DMO test application as part of your testing.

To use DMOTest, you must generate test data for the DMO. The SDK includes a DirectShow filter for this purpose. It is located in the DLL file DMODump.dll. You will need to register the filter with the Regsvr32 utility.

Details about the test application can be found in the DMOTest application help. In the application, choose Contents from the Help menu. The help includes step-by-step instructions for generating test data and running the test application.