Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
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::Receivemethod on the renderer's input pin.

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

Instead, IMemInputPin::Receiveshould 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