IMediaFilter::GetState 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 GetState method retrieves the filter's state (running, stopped, or paused).

Syntax

HRESULT GetState(
  [in]  DWORD        dwMilliSecsTimeout,
  [out] FILTER_STATE *State
);

Parameters

[in] dwMilliSecsTimeout

Time-out interval, in milliseconds. To block indefinitely, use the value INFINITE.

[out] State

Receives a member of the FILTER_STATE enumerated type, indicating the filter's state.

Return value

Returns an HRESULT value. Possible values include those shown in the following table.

Return code Description
S_OK
Success.
E_POINTER
NULL pointer argument.
VFW_S_STATE_INTERMEDIATE
Intermediate state.
VFW_S_CANT_CUE
The filter is active, but cannot deliver data.

Remarks

State transitions can be asynchronous. If the filter is transitioning to a new state, and the method times out before the transition completes, the method returns VFW_S_STATE_INTERMEDIATE.

If a filter cannot deliver data for some reason, it returns VFW_S_CANT_CUE. Live capture filters return this value while paused, because they do not deliver data in the paused state.

For more information, see Data Flow in the Filter Graph.

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

Error and Success Codes

IBaseFilter

IMediaFilter Interface