共用方式為


IMediaFilter::GetState

 
Microsoft DirectShow 9.0

IMediaFilter::GetState

The GetState method retrieves the filters's state (running, stopped, or paused).

Syntax

  HRESULT GetState(
  DWORD dwMilliSecsTimeout,
  FILTER_STATE *State
);

Parameters

dwMilliSecsTimeout

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

State

[out] Pointer to a variable that receives a member of the FILTER_STATE enumerated type, indicating the filter's state.

Return Values

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

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also