CBaseRenderer::PrepareReceive (Compact 2013)
3/26/2014
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
Header |
dshow.h, |
Library |
ole32.lib, |