Share via


CBaseRenderer::PrepareReceive

 
Microsoft DirectShow 9.0

CBaseRenderer::PrepareReceive

The PrepareReceive method prepares the filter to render a sample.

Syntax

  virtual HRESULT PrepareReceive(
    IMediaSample *pMediaSample
);

Parameters

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.

Remarks

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.

Requirements

**  Header:** Declared in Renbase.h; include Streams.h.

**  Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).

See Also