Partager via


CRenderedInputPin::EndOfStream

 
Microsoft DirectShow 9.0

CRenderedInputPin::EndOfStream

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.

Syntax

  HRESULT EndOfStream(void);

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

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
{
private:
    CCritSec * const m_pReceiveLock; // Streaming lock.
public:
    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.

Requirements

**  Header:** Declared in Amextra.h; include Streams.h.

**  Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).

See Also