Microsoft DirectX 9.0


The PrepareReceive method prepares the filter to render a sample.


virtual HRESULT PrepareReceive(
    IMediaSample *pMediaSample



Pointer to the sample's IMediaSample interface.

Return Value

Returns an HRESULT value. Possible values include those in the following table.

Value Description
S_OK Success.
E_FAIL Failed.
E_UNEXPECTED Unexpected error.
VFW_E_SAMPLE_REJECTED Filter is dropping this sample.


The filter calls this method from inside the CBaseRenderer::Receive method, before it renders a sample. If the filter is running, this method schedules the sample for rendering.

If the filter already has a pending sample, or if the end-of-stream was already reached, the method returns E_UNEXPECTED. Possibly the upstream filter is not serializing its streaming calls correctly.

If the scheduling algorithm determines that the sample should be dropped (see CBaseRenderer::ScheduleSample), the method returns VFW_E_SAMPLE_REJECTED. However, the input pin's IMemInputPin::Receive method does not pass this error code to the upstream filter, because dropping a sample is not an error.

See Also