CPullPin.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 is called when the object receives a media sample from the output pin. The derived class must implement this method.

Syntax

virtual HRESULT Receive(
   IMediaSample *pSample
) = 0;

Parameters

pSample

Pointer to the IMediaSample interface of the media sample.

Return value

Returns an HRESULT value. Returning a value other than S_OK will stop the data-pulling thread.

Remarks

This method is called whenever a new sample arrives from the output pin. Write this method in the same manner as the IMemInputPin::Receive method.

The time stamps on the sample specify the byte offsets, relative to the original start position that was specified in CPullPin::Seek method.

The start position is rounded down to the nearest alignment boundary, and the stop position is rounded up to the nearest alignment boundary. Also, if the stop position exceeds the total duration, the duration is used instead.

All time stamps are given as a byte offset multiplied by 10,000,000, defined as the constant UNITS. Thus, notionally one second is one byte. To find the actual byte offsets, call IMediaSample::GetTime and divide the results by UNITS.

Requirements

Requirement Value
Header
Pullpin.h
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CPullPin Class