CSourceStream class

CSourceStream Class Hierarchy

The CSourceStream class provides an output pin for the CSource filter class.

For information on using this class, see CSource. This class inherits the CAMThread class, which provides a worker thread for streaming data from the pin. The CSourceStream class implements the following helper methods to send requests to the thread:

The first request to the thread must be Init. The Exit request terminates the thread. In practice, it is not necessary to call any of these methods directly, because the pin's CSourceStream::Active and CSourceStream::Inactive methods call them as needed.

The class also provides several "handler" methods:

These do nothing in the base class, but the derived class can override them.

Protected Member VariablesDescription
m_pFilter Pointer to the filter that contains this pin.
Protected Methods Description
OnThreadCreate Called when the streaming thread is initialized. Virtual.
OnThreadDestroy Called when the streaming thread is about to exit. Virtual.
OnThreadStartPlay Called at the start of the CSourceStream::DoBufferProcessingLoop method. Virtual.
Active Notifies the pin that the filter is now active.
Inactive Notifies the pin that the filter is no longer active.
GetRequest Waits for the next thread request.
CheckRequest Checks if there is a thread request, without blocking.
ThreadProc Thread procedure. Virtual.
DoBufferProcessingLoop Generates media data and delivers it to the downstream input pin. Virtual.
CheckMediaType Determines if the pin accepts a specific media type. Virtual.
GetMediaType Retrieves a preferred media type. Virtual.
Public MethodsDescription
CSourceStream Constructor method.
~ CSourceStream Destructor method. Virtual.
Init Initializes the streaming thread.
Exit Signals the streaming thread to exit.
Run Signals the streaming thread to run.
Pause Signals the streaming thread to become active.
Stop Signals the streaming thread to stop.
Pure Virtual Methods Description
FillBuffer Fills a media sample with data.
IPin Methods Description
QueryId Retrieves an identifier for the pin.




Source.h (include Streams.h)


Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

Writing Source Filters