Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Derive from this class to provide a class that creates the data stream from one of the output pins. It should be used with an object that is derived from the CSourceclass derived object to provide the filter-level object.
The CSourceStreamclass creates a worker thread to push data downstream when the filter enters a paused or running state.
The thread first calls the CSourceStream::OnThreadCreatemember function. If this succeeds, it loops, calling the CSourceStream::FillBuffermember function until the CSourceStream::Inactivemember function stops it.
As the thread quits, it calls the CSourceStream::OnThreadDestroymember function.
If OnThreadCreatefails, OnThreadDestroyis called, and the active member function fails.
To use the CSourceStreamclass, supporting a single media type, carry out the following steps.
Override the CSourceStream::GetMediaTypemember function to report the supported output format.
Override the CSourceStream::FillBuffermember function with a means of filling out each IMediaSampleobject with data.
To use the CSourceStreamclass, supporting multiple media types, carry out the following steps.
Override the CSourceStream::CheckMediaTypeand CSourceStream::GetMediaTypemember functions to report the supported media types (for more information, see the CBaseMediaFilterclass).
Override the CSourceStream::FillBuffermember function with a means of filling out each IMediaSampleobject with data.
See the files in the Samples\Multimedia\DShow\Src\Ball subdirectory in the DirectX Media Software Development Kit (SDK) for an example of a pin supporting multiple types.
If you want more complex management of your worker thread, you can override most of the associated member functions. See Samples\Multimedia\DShow\Src\Vidcap in the DirectX Media SDK for an example.
Member Functions
Member function | Description |
---|---|
Called by the CBaseMediaFilterclass to start the worker thread. |
|
Determines if a command is waiting for the thread. |
|
Constructs a CSourceStreamobject. |
|
Called by the CSourceStream::Inactivemember function to exit the worker thread. |
|
Retrieves the next command for the thread. |
|
Called by the CBaseMediaFiltermember function to shut down the worker thread. |
|
Called by the CSourceStream::Activemember function to initialize the worker thread. |
|
Pauses the stream of the worker thread. This will acquire all necessary resources. |
|
Starts the worker thread generation of a media sample stream. |
|
Stops the stream. |
Overrideable Member Functions
Member function | Description |
---|---|
Determines if a specific media type is supported. Override this member function if you use multiple types. |
|
Loops, collecting a buffer and calling the CSourceStream::FillBufferprocessing function. |
|
Override this member function to fill the stream buffer during the creation of a media sample. |
|
Retrieves the media type or types that this pin supports; override the appropriate version of this member function to support one or multiple media types. |
|
Called as the worker thread is created; override this member function for special processing. |
|
Called during the destruction of a worker thread; override this member function for special processing. |
|
Called at the start of processing Pause or Run command; override this member function for special processing. |
|
Override this member function to create a custom thread procedure. |
Implemented IPin Methods
Method | Description |
---|---|
Retrieves an identifier for the pin. |
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 |