CBasePin.QueryAccept method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The QueryAccept method determines whether the pin accepts a specified media type. This method implements the IPin::QueryAccept method.

Syntax

HRESULT QueryAccept(
   const AM_MEDIA_TYPE *pmt
);

Parameters

pmt

Pointer to an AM_MEDIA_TYPE structure that specifies the media type.

Return value

Returns S_OK if the media type is acceptable. Otherwise, returns S_FALSE.

Remarks

In the base class, this method delegates to the CBasePin::CheckMediaType method. If CheckMediaType fails, QueryAccept returns S_FALSE.

This method does not hold the pin's critical section (CBasePin::m_pLock). If your derived class dynamically modifies the set of acceptable media types, you should override this method to hold the critical section.

Requirements

Requirement Value
Header
Amfilter.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBasePin Class