Looking Inside a DMO

Looking Inside a DMO

A DMO is a COM object that takes an input stream and produces one or more output streams. Most commonly, a DMO will have one input stream and one output stream, but this isn t an absolute rule. A DMO must define the number of its input and output streams at compile time, and these can not change during execution of the DMO object. Unlike DirectShow filters, DMOs can t add input or output pins as they re needed.

Like a DirectShow filter, a DMO supports media types. The DMO wrapper for DirectShow handles media type negotiation with other filters, but the DMO itself can specify what media types it s prepared to support. Before any stream data can be processed by the DMO, its input and output media types must be set by the client application using the DMO. (Again, this is done by the DMO wrapper in DirectShow.)

DMOs don t allocate buffer pools to handle data processing, nor do they arbitrate who owns buffers of data. DMOs operate on buffers presented to them by the client application. Some DMOs perform in-place transformations of data, passing along the same buffer that they were given. Otherwise, the DMO will copy the input buffer to an output buffer during the transformation process.

Minimal overhead is required to implement a DMO architecture. The DMO interacts only minimally with the application that instantiates and controls it. These interactions are defined by the COM interfaces presented by the DMO. All DMOs must support at least one COM interface, IMediaObject. If the DMO is going to be used from DirectShow, the DMO must support the COM aggregation. If the DMO is going to be used within DirectSound applications, another interface must be implemented and supported: IMediaObjectInPlace, which handles in-place transformations of buffer data.



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