Microsoft DirectX 8.1 (C++)

IMemInputPin::Receive

The Receive method receives the next media sample in the stream.

Syntax

HRESULT Receive(
  IMediaSample *pSample
);

Parameters

pSample

[in] Pointer to the sample's IMediaSample interface.

Return Value

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

Value Description
S_OK Success.
S_FALSE Pin is currently flushing; sample was rejected.
E_POINTER NULL pointer argument.
VFW_E_INVALIDMEDIATYPE Invalid media type.
VFW_E_RUNTIME_ERROR A run-time error occurred.
VFW_E_WRONG_STATE The pin is stopped.

Remarks

This method is synchronous and possibly blocking. The pin does one of the following:

In the last case, the method might block indefinitely. If this might happen, the IMemInputPin::ReceiveCanBlock method returns S_OK.

If the pin uses a worker thread to process the sample, it holds a reference count on the sample. In any case, the output pin cannot directly re-use this sample. It must call the IMemAllocator::GetBuffer method to obtain a new sample.

See Also