Control Distributors (Windows Embedded CE 6.0)

1/6/2010

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::Run method directly, because the filter graph manager contains a distributor that implements IMediaControl::Run and passes calls on to each filter's IBaseFilter::Run method.
  • 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 IBasicAudio implementation of the filter graph manager for the volume, will get undefined results.
    (In practice, it will probably retrieve the Volume property 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 IMediaControl interface (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 IMediaFilter and is suitable for Automation clients and applications.
    The IMediaFilter implementation on the filter graph manager should not be called by applications. IMediaControl is implemented by calling the IMediaFilter interface implemented by the filter graph manager and by individual filters. Individual filters expose IMediaFilter through the IBaseFilter interface, which inherits it.

PIDs must keep track of the filters in the filter graph. This is done by implementing the IDistributorNotify interface on the distributor. IDistributorNotify has the same Run, Pause, and Stop methods as IMediaFilter, all of which are called before the calling the filter. It also has a IDistributorNotify::NotifyGraphChange method, which notifies the distributor when any filters are added or removed from the filter graph, or connections change.

See Also

Concepts

Video Renderers