CTransformFilter::Receive
Microsoft DirectShow 9.0 |
CTransformFilter::Receive
The Receive method receives a media sample, processes it, and delivers an output sample to the downstream filter.
Syntax
HRESULT Receive( IMediaSample *pSample );
Parameters
pSample
Pointer to the IMediaSample interface on the input sample.
Return Value
Returns an HRESULT value. Possible values include the following:
Value | Description |
S_FALSE | The upstream filter should stop sending samples. |
S_OK | Success. |
Remarks
The filter's input pin calls this method when it receives a sample. This method calls the CTransformFilter::InitializeOutputSample method, which prepares a new output sample. Then it calls the CTransformFilter::Transform method, which the derived class must implement. The Transform method processes the input data and produces output data.
If the Transform method returns S_FALSE, the Receive method drops this sample. On the first dropped sample, the filter sends an EC_QUALITY_CHANGE event to the filter graph manager. Otherwise, if the Transform method returns S_OK, the filter delivers the output sample. To do so, it calls the IMemInputPin::Receive method on the downstream input pin.
Requirements
** Header:** Declared in Transfrm.h; include Streams.h.
** Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).
See Also