Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
A control distributor is a PID that is used to control the data flow in the filter graph; for example, starting or stopping playback of a media stream. The standard control distributors supplied with DirectShow directly implement their distribution.
These distributors make the following assumptions:
- Applications that connect filters directly without informing
the filter graph manager will get unexpected results if they also
use the distributors of the filter graph manager.
For example, a deadlock might occur if an application calls a filter's IBaseFilter::Runmethod directly, because the filter graph manager contains a distributor that implements IMediaControl::Runand passes calls on to each filter's IBaseFilter::Runmethod. - Properties that can be aggregated directly can be read and
written to through the control interface, even when exposed by
multiple filters. For example, duration can be reported as the
longest of all individual durations, with all streams treated as
running in parallel.
- Where a property is exposed by several different filters,
applications will either use the filter graph manager to set and
get the property or will communicate with the individual filters,
but will not mix the two methods.
An application that communicates with two audio renderers to reset the volume and then queries the IBasicAudioimplementation of the filter graph manager for the volume, will get undefined results.
(In practice, it will probably retrieve the Volumeproperty of the first audio renderer with no attempt to combine this with the other stream.)
If the application sets the property through the interface of the filter graph manager, the same value will be set to all the individual filters that expose it. - The filter graph manager will expose the
IMediaControlinterface (through a non-replaceable distributor)
as the main application method for starting and stopping graphs.
This is a slightly higher-level, more simplified interface than
IMediaFilterand is suitable for Automation clients and
applications.
The IMediaFilterimplementation on the filter graph manager should not be called by applications. IMediaControlis implemented by calling the IMediaFilterinterface implemented by the filter graph manager and by individual filters. Individual filters expose IMediaFilterthrough the IBaseFilterinterface, which inherits it.
PIDs must keep track of the filters in the filter graph. This is done by implementing the IDistributorNotifyinterface on the distributor. IDistributorNotifyhas the same Run, Pause, and Stopmethods as IMediaFilter, all of which are called before the calling the filter. It also has a IDistributorNotify::NotifyGraphChangemethod, which notifies the distributor when any filters are added or removed from the filter graph, or connections change.