共用方式為


CVideoTransformFilter::Receive

 
Microsoft DirectShow 9.0

CVideoTransformFilter::Receive

The Receive method receives a media sample, processes it, and delivers an output sample to the downstream filter. This method overrides the CTransformFilter::Receive method.

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

This method calls CVideoTransformFilter::ShouldSkipFrame to determine whether it should deliver this sample or simply discard it. If ShouldSkipFrame returns FALSE (indicating the sample should be delivered), the method does the following:

  1. Calls CTransformFilter::InitializeOutputSample to prepare the output sample
  2. Calls CTransformFilter::Transform to process the input sample. This method is pure virtual, and must be implemented in the derived class.
  3. Calls CBaseOutputPin::Deliver to deliver the output sample.

Also, this method checks for format changes on the input or output sample, by calling IMediaSample::GetMediaType. If there is a format change, the method sets the connection type on the corresponding pin. Before it sets the new type, it calls StopStreaming. After it sets the new type, it calls StartStreaming. The derived class can use these methods to update its internal state. The derived class might also need to check for the new format in its Transform method.

Requirements

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

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

See Also