Microsoft DirectX 8.1 (C++) |
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
) PURE;
Parameters
pSample
Pointer to the IMediaSample interface of the media sample.
Return Values
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.
See Also