CTransInPlaceFilter.Receive method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The Receive method receives a media sample, processes it, and delivers it to the downstream filter.

Syntax

HRESULT Receive(
   IMediaSample *pSample
);

Parameters

pSample

Pointer to the IMediaSample interface on the sample.

Return value

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

Return code Description
S_OK
Success
E_UNEXPECTED
Unexpected error

Remarks

The filter's input pin calls this method when it receives a sample. The filter calls the Transform method, which the derived class must implement. The Transform method processes the data. If the filter is using only one allocator, it passes pSample directly to the Transform method. Otherwise, it copies pSample and passes the copy.

If the Transform method returns S_FALSE, the Receive method drops the 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

Requirement Value
Header
Transip.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CTransInPlaceFilter Class