共用方式為


IMediaControl::Pause

 
Microsoft DirectShow 9.0

IMediaControl::Pause

The Pause method pauses all the filters in the filter graph.

Syntax

  HRESULT Pause(void);

Return Values

Returns an HRESULT value. Possible values include the following.

Return code Description
S_FALSE The graph paused successfully, but some filters have not completed the state transition.
S_OK All filters in the graph completed the transition to a paused state.

Remarks

Pausing the filter graph cues the graph for immediate rendering when the graph is next run. While the graph is paused, filters process data but do not render it. Data is pushed through the graph and processed by transform filters as far as buffering permits, but renderer filters do not render the data. However, video renderers display a static poster frame of the first sample.

If the method returns S_FALSE, call the IMediaControl::GetState method to wait for the state transition to complete, or to check if the transition has completed. When you call Pause to display the first frame of a video file, always follow it immediately with a call to GetState to ensure that the state transition has completed. Failure to do this can result in the video rectangle being painted black.

If the method fails, it stops the graph before returning.

Requirements

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

Library: Use Strmiids.lib.

See Also