Override the CheckInputType Member Function

During the pin connection, the CTransformInputPin::CheckMediaType member function of the input pin is called to determine whether the proposed media type is acceptable. The CTransformInputPin::CheckMediaType member function is implemented to call the CheckInputType member function of the derived filter class with the media type. You must implement this to accommodate the media types your filter can handle. The following code sample outlines part of the CGargle::CheckInputType member function, which rejects any media type but MEDIATYPE_Audio.

HRESULT CGargle::CheckInputType(const CMediaType *pmt) {    
    ...
    // Reject non-Audio type
    if (pmt->majortype != MEDIATYPE_Audio) {
        return E_INVALIDARG;
    }

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.