COutputQueue.ThreadProc method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The ThreadProc method retrieves samples from the queue and delivers them to the input pin.

Syntax

DWORD ThreadProc();

Parameters

This method has no parameters.

Return value

Returns zero.

Remarks

The COutputQueue::InitialThreadProc method calls this method, which implements the main thread loop. Within the loop, the method performs the following steps:

  1. Retrieves a sample for the queue.
  2. If the sample is a control message, the thread executes the control action. Otherwise, it places the sample into the COutputQueue::m_ppSamples array.
  3. When the array is full (or if COutputQueue::m_bBatchExact is FALSE), the thread calls the IMemInputPin::ReceiveMultiple method to deliver the samples.
  4. If no samples are queued, the thread waits on the COutputQueue::m_hSem semaphore.

The thread terminates when the COutputQueue::m_bTerminate member variable becomes TRUE.

Requirements

Requirement Value
Header
Outputq.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

COutputQueue Class