Microsoft DirectX 8.1 (C++) |
The Receive method receives the next media sample in the stream. This method implements the IMemInputPin::Receive method.
Syntax
HRESULT Receive(
IMediaSample *pSample
);
Parameters
pSample
Pointer to the sample's IMediaSample interface.
Return Value
Returns an HRESULT value. Possible values include those listed 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
The upstream output pin calls this method to deliver a sample to the input pin. The input pin must do one of the following:
If the pin uses a worker thread to process the sample, add a reference count to the sample inside this method. After the method returns, the upstream pin releases the sample. When the sample's reference count reaches zero, the sample returns to the allocator for re-use.
This method is synchronous and can block. If the method might block, the pin's CBaseInputPin::ReceiveCanBlock method should return S_OK.
In the base class, this method performs the following steps:
Test for a format change as follows:
In the base class, this method does not process the sample. The derived class must override this method to perform the processing. (What this entails depends entirely on the filter.) The derived class should call the base-class method, to check for the errors described previously.
See Also