IMediaEvent::WaitForCompletion

 
Microsoft DirectShow 9.0

IMediaEvent::WaitForCompletion

The WaitForCompletion method waits for the filter graph to render all available data. The filter graph must be running or the method fails.

Syntax

  HRESULT WaitForCompletion(
  long msTimeout,
  long *pEvCode
);

Parameters

msTimeout

[in] Time-out interval, in milliseconds. Pass zero to return immediately. Pass the value INFINITE to block indefinitely.

pEvCode

[out] Pointer to a variable that receives an event code. See Remarks for more information.

Return Values

Returns an HRESULT value. Possible values include the following.

Return code Description
S_OK Success.
E_ABORT Time-out expired.
VFW_E_WRONG_STATE The filter graph is not running.

Remarks

This method blocks until the time-out expires, or one of the following events occurs:

During the wait, the method discards all other event notifications.

If the return value is S_OK, the pEvCode parameter receives the event code that ended the wait. When the method returns, the filter graph is still running. The application can pause or stop the graph, as appropriate.

Requirements

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

Library: Use Strmiids.lib.

See Also