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 version of this page is also available for
4/8/2010

When one filter's output pin is called by the filter graph manager to connect to an input pin of a second filter, the IPin::Connectmethod is called. This, in turn, calls CBaseOutputPin::CheckConnectto obtain interfaces from the connected pin and CBasePin::AgreeMediaTypeto find a common media type.

AgreeMediaTypecalls CBasePin::TryMediaTypes, which uses media type enumerators to query the pins for preferred media types.

IEnumMediaTypesis an interface on the connected input pin that TryMediaTypesuses first.

The base classes use IEnumMediaTypesto repeatedly call a CBasePinmember function called GetMediaTypefor each media type in the list. You use this member function in your input and output pin classes to return the media types that your pin prefers.

TryMediaTypescalls the output pin's CheckMediaTypemember function with each input type returned. You must use CheckMediaTypeto verify whether this type is acceptable.

If no media types are found (for example GetMediaTypemight not even be used on the connected input pin, or might return an unacceptable media type), then AgreeMediaTypeobtains a media type enumerator for the output pin and tries each of these in turn.

Again, the GetMediaTypemember function of the derived output pin is called for each type. In this case, it can determine media types by inquiring about any existing connection established by the filter's input pin.