Compartir a través de


CSourceStream::DoBufferProcessingLoop

 
Microsoft DirectShow 9.0

CSourceStream::DoBufferProcessingLoop

The DoBufferProcessingLoop method generates media data and delivers it to the downstream input pin.

Syntax

  virtual HRESULT DoBufferProcessingLoop(void);

Return Value

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

Value Description
S_FALSE Thread received a stop request.
S_OK Stream ended, or downstream filter is not accepting samples.

Remarks

This method implements the main loop that processes data and delivers it downstream. Each time through the loop, the method retrieves an empty media sample from the allocator. It passes the sample to the CSourceStream::FillBuffer method. The FillBuffer method, which the derived class must implement, generates media data and places it in the sample buffer.

The loop ends when any of the following occurs:

  • The input pin's IMemInputPin::Receive method rejects a sample.
  • The FillBuffer method returns S_FALSE, indicating the end of the stream, or returns an error code.
  • The thread receives a CSourceStream::Stop request.

The DoBufferProcessingLoop method handles the end-of-stream notification. If an error occurs, it sends an EC_ERRORABORT event to the filter graph manager.

Requirements

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

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

See Also