Skip to content

Latest commit

 

History

History
107 lines (86 loc) · 4.63 KB

nf-control-imediacontrol-stopwhenready.md

File metadata and controls

107 lines (86 loc) · 4.63 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:control.IMediaControl.StopWhenReady
IMediaControl::StopWhenReady (control.h)
The StopWhenReady method pauses the filter graph, allowing filters to queue data, and then stops the filter graph.
IMediaControl interface [DirectShow]
StopWhenReady method
IMediaControl.StopWhenReady
IMediaControl::StopWhenReady
IMediaControlStopWhenReady
StopWhenReady
StopWhenReady method [DirectShow]
StopWhenReady method [DirectShow]
IMediaControl interface
control/IMediaControl::StopWhenReady
dshow.imediacontrol_stopwhenready
dshow\imediacontrol_stopwhenready.htm
dshow
55dd55b1-51f0-4b47-8432-99741eaee8bb
4/26/2023
IMediaControl interface [DirectShow],StopWhenReady method, IMediaControl.StopWhenReady, IMediaControl::StopWhenReady, IMediaControlStopWhenReady, StopWhenReady, StopWhenReady method [DirectShow], StopWhenReady method [DirectShow],IMediaControl interface, control/IMediaControl::StopWhenReady, dshow.imediacontrol_stopwhenready
control.h
Dshow.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Strmiids.lib
Windows
19H1
IMediaControl::StopWhenReady
control/IMediaControl::StopWhenReady
c++
APIRef
kbSyntax
COM
Strmiids.lib
Strmiids.dll
IMediaControl.StopWhenReady

IMediaControl::StopWhenReady

-description

[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 StopWhenReady method pauses the filter graph, allowing filters to queue data, and then stops the filter graph.

-returns

Returns an HRESULT value. Possible values include the following.

Return code Description
S_OK
Success.
S_FALSE
The graph was still transitioning to the paused state when the method returned.

-remarks

This method is useful if you want to seek the filter graph while the graph is stopped. As long as the filter graph is stopped, changes in the current position do not repaint the video window with a new frame. Therefore, calling IMediaSeeking::SetPositions does not update the video window. To update the window after the seek operation, call StopWhenReady. This method transitions the graph to a paused state, waits for the pause operation to complete, and then transitions the graph back to stopped. The pause operation queues data in the graph, so that the video renderer receives and displays the new frame.

This method is asynchronous. It waits on a separate thread for the pause to complete. The calling thread does not block, which enables the application to respond to user input. When the method returns, the logical state of the graph is stopped, even before the pause operation completes. If you call the IMediaControl::GetState method at this point, it returns State_Stopped.

If the application issues another state-change command (such as pause, run, or seek) before the pause operation completes, the new command cancels the pending stop command. The pause operation completes, but the graph does not stop.

-see-also

Error and Success Codes

IMediaControl Interface