Muokkaa

Jaa


CBaseRenderer.WaitForRenderTime method

[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 WaitForRenderTime method waits for the current sample's presentation time.

Syntax

virtual HRESULT WaitForRenderTime();

Parameters

This method has no parameters.

Return value

Returns one of the following HRESULT values.

Return code Description
S_OK
Success.
VFW_E_STATE_CHANGED
The filter state changed before the presentation time arrived.

Remarks

This method waits until one of the following occurs:

  • The sample's presentation time arrives, at which point the sample can be rendered.
  • The filter stops or begins flushing data.

If the presentation time arrives, the CBaseRenderer::m_RenderEvent event is signaled. If the state changes, the CBaseRenderer::m_ThreadSignal event is signaled. This method waits on both events. The derived class can override this method to wait on additional events, if necessary.

This method calls the CBaseRenderer::OnWaitStart method when the wait begins, and the CBaseRenderer::OnWaitEnd method when the wait is done. Neither method does anything in the base class, but the derived class can override them.

Requirements

Requirement Value
Header
Renbase.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBaseRenderer Class