IPin::QueryAccept method (strmif.h)

[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.

Syntax

HRESULT QueryAccept(
  [in] const AM_MEDIA_TYPE *pmt
);

Parameters

[in] pmt

Pointer to an AM_MEDIA_TYPE structure that specifies the media type.

Return value

Returns one of the following values:

Return code Description
S_FALSE
The pin rejects the media type.
S_OK
The pin accepts the media type.

Remarks

A return value of S_OK indicates that the pin will accept the media type, either on the next sample, or after a pin reconnection. The implementation should take into account the current state of the filter, including connections on other pins, and any properties that can be set on the filter.

Any other return value, including S_FALSE, means that the pin rejects the media type. Therefore, test for S_OK explicitly; do not use the SUCCEEDED macro.

If the filter is running, a return value of S_OK is ambiguous. The pin might accept a format change on the next media sample, without reconnecting; or it might need to reconnect. If the pin supports the IPinConnection interface, call the IPinConnection::DynamicQueryAccept method, which specifically tests whether the pin can accept the new type without reconnecting.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Data Flow in the Filter Graph

Dynamic Format Changes

Error and Success Codes

IPin Interface