Share via


CSource Class

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Aa918247.5f4be628-3e59-4f32-91f7-b1fe9f777811(en-us,MSDN.10).gif

This class and its corresponding class, CSourceStream, simplify the construction of source filters that produce continuous streams of data comparable to the way the CTransformFilter class assists in the creation of transform filters.

The CSource class provides a wrapper for the CBaseFilter class that performs the pin management and works with the CSourceStream class to provide the pins.

To use the CSource class to build a filter:

Derive your filter-level class from the CSource class. Provide a CreateInstance member function in it to create a new object of the class.

Provide a means of adding objects that are derived from the CSourceStream class to support the output pins during construction of the class. You can either create them yourself during construction or provide the developer with a means of creating them later.

For an example of using the CSource class, see the Ball sample in the Samples\Multimedia\DShow\Src\Ball subdirectory of the DirectX Media Software Development Kit (SDK).

This class does not help build an asynchronous file reader source filter, which requires support of an IAsyncReader interface and a downstream parser filter that supports the CPullPin class.

Protected Data Members

Member Description

m_cStateLock

Locks this data member to serialize access to the filter state.

m_iPins

Number of pins on this filter; updated by the CSource::AddPin and CSource::RemovePin member functions.

m_paStreams

Array of streams associated with this filter.

Member Functions

Member function Description

AddPin

Adds a pin to the source filter.

CSource

Constructs a CSource object.

FindPinNumber

Retrieves the number of the pin through the IPin parameter.

GetPin

Returns a pointer to a specified pin.

GetPinCount

Gets the number of pins contained by the filter.

pStateLock

Returns a pointer to the filter-critical section.

RemovePin

Removes a pin from the source filter.

Implemented IBaseFilter Methods

Method Description

FindPin

Retrieves a pointer to the pin with the specified identifier.

Requirements

Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Windows Mobile Version 5.0 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment