CTransformFilter.Transform 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 Transform method transforms an input sample to produce an output sample.

Syntax

virtual HRESULT Transform(
   IMediaSample *pIn,
   IMediaSample *pOut
);

Parameters

pIn

Pointer to the input sample's IMediaSample interface.

pOut

Pointer to the output sample's IMediaSample interface.

Return value

The base class returns E_UNEXPECTED.

The derived class should return an HRESULT value, indicating success or failure. Possible values include those shown in the following table.

Return code Description
S_FALSE
Do not deliver this sample.
S_OK
Success.

Remarks

Override this method to produce output data. Read the input data from the sample specified by the pIn parameter, and write the new data into the sample specified by the pOut parameter.

Before the filter calls this method, it copies the properties from the input sample to the output sample. The Transform method should set any properties that differ between the two samples, using IMediaSample methods or the IMediaSample2 interface (if available).

If the filter should not deliver this sample (for example, to support quality control), the method should return S_FALSE.

Requirements

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

See also

CTransformFilter Class