Chapter 13: Creating and Working with DirectX Media Objects

Chapter 13

Creating and Working with DirectX Media Objects

Microsoft DirectShow filters provide a flexible and extensible interface to add features to DirectShow applications, but they also have a lot of overhead, in both design and implementation, beyond the requirements that serve their basic functionality. DirectShow filters must handle buffer allocation, media type negotiation, and filter connection methods, and much of the implementation deals with these necessary features of a filter. Fortunately, there is another option: the Microsoft DirectX Media Object (DMO), which offers the most important feature of a transform filter the ability to manipulate a media stream without the overhead of a filter implementation. Although DMOs are an important feature of DirectShow, they are portable, which means that they do not require a filter graph for operation and can be used in non-DirectShow applications. Within DirectShow, the only restriction on DMOs is that they can t be used as transitions or effects in conjunction with the DirectShow Editing Services (DES) covered in Chapter 8. A separate architecture is required for DES transitions and effects; more information on that topic can be found in the DirectX SDK documentation.

DMOs were introduced with DirectX 8 as a way to speed the development of plug-in video and audio effects within the DirectX architecture. Although technically less sophisticated than DirectShow filters, DMOs can be brought into a filter graph and used like filters. DirectShow wraps DMOs in a filter, which makes DMOs appear as though they are fully functional DirectShow filters. Through this wrapper, DMOs can be instantiated, connected, and manipulated just like any other filter in the filter graph.

Most DMOs perform some basic audio or video processing on a stream, such as taking an audio stream and adding a delay effect to the signal. These effects are sometimes performed in place (that is, on an existing buffer of stream data without any need to copy it to a separate location) and don t require any input from the filter graph. DMOs are entirely self-contained and don t handle even the basic task of acquiring or sending along buffers of data. Instead, the DMO is called by the client, which presents a buffer to it. The client receives the processed data when the DMO s operation is complete.

All of this means that DMOs represent a lightweight approach for the development of DirectShow effects, encoders, and decoders. DMO audio effects can also be used by DirectSound, the audio component of the DirectX multimedia API. You can write an audio effect DMO perhaps for a DirectShow application and use it later in a DirectSound application. Because both DirectShow and DirectSound are important technologies for PC gaming development, using DMOs could potentially save a lot of time. In addition, any other application can use a DMO directly because DMOs aren t tied to any DirectX technology.



Programming Microsoft DirectShow for Digital Video and Television
Programming Microsoft DirectShow for Digital Video and Television (Pro-Developer)
ISBN: 0735618216
EAN: 2147483647
Year: 2002
Pages: 108
Authors: Mark D. Pesce

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net