Microsoft Windows CE 3.0  

CBaseRenderer::PrepareReceive

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.

Ensures that a sample can be rendered.

virtual HRESULT PrepareReceive(
IMediaSample *
pMediaSample
);

Parameters

pMediaSample
Media sample.

Return Values

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 already 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 will be unlocked so an application thread can get in and change the state to stopped. In this case, it will also signal the thread event so that 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 was 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.