Microsoft DirectX 9.0


The EndOfStream method notifies the pin that no additional data is expected, until a new run command is issued to the filter. This method implements the IPin::EndOfStream method.


HRESULT EndOfStream(void);

Return Value

Returns S_OK if successful, or an error code otherwise.


If the filter is running, this method sends an EC_COMPLETE event to the Filter Graph Manager. Otherwise, is sets a flag so that the EC_COMPLETE event is sent when the filter next runs. Flushing the filter clears the flag.

You should override this method to hold the pin's streaming lock:

class CMyInputPin : public CRenderedInputPin
    CCritSec * const m_pReceiveLock; // Streaming lock.
    STDMETHODIMP EndOfStream(void);

    /* (Remainder of the class declaration not shown.) */

STDMETHODIMP CMyInputPin::EndOfStream(void)
    CAutoLock lock(m_pReceiveLock);  
    return CRenderedInputPin::EndOfStream();

Also, if the filter processes Receive calls asynchronously, the pin should wait to send the EC_COMPLETE event until the filter has processed all pending samples.

See Also