Partager via


CBaseRenderer::PrepareReceive

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Ensures that a sample can be rendered.

Syntax

virtual HRESULT PrepareReceive(
  IMediaSample* pMediaSample
);

Parameters

  • pMediaSample
    Media sample.

Return Value

Returns NOERROR if successful, VFW_E_SAMPLE_REJECTED if the delivered sample is later than the sample's timestamp, or E_UNEXPECTED if a renderable sample is available.

Remarks

This member function is called when the upstream filter delivers a sample.

If the upstream filter is running (streaming), the sample is scheduled with the reference clock.

If the upstream filter is not streaming, a sample in paused mode has been received, so any state transition can be completed.

On leaving this function, everything is unlocked so an application thread can get in and change the state to stopped. In this case, it also signals the thread event so the wait call is stopped.

This function is typically called from the IMemInputPin::Receive method on the renderer's input pin.

Although PrepareReceive returns VFW_E_SAMPLE_REJECTED if the sample is delivered too late to be useful, the IMemInputPin::Receive method should not pass the VFW_E_SAMPLE_REJECTED error on to the upstream filter in this case.

Instead, IMemInputPin::Receive should return NOERROR, because no error occurred.

Requirements

Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Windows Mobile Version 5.0 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment, Version 2.12 requires DXPAK 1.0 or later