DirectShow Quick Reference Guide
Top  Previous  Next

About DirectShow

Microsoft® DirectShow® application programming interface (API) is a media-streaming architecture for the Microsoft Windows® platform. It is embedded into the set of DirectX APIs. The purpose of this API is to capture, render and playback streaming media as Video or Audio streams. It manages both devices or files for capturing and rendering.

Filters and Filter Graphs:

The building block of DirectShow is a software component called a filter. A filter is a software component that performs some operation on a multimedia stream. For example, DirectShow filters can

·read files  
·get video from a video capture device  
·decode various stream formats, such as MPEG-1 video  
·pass data to the graphics or sound card  

Filters receive input and produce output through their pin(s). ActiveGige Video Capture Filter provides a DirectShow interface to GigE Vision compliant cameras. It has one output Video Capture pin which can be connected to other filters. The pin supports all video modes provided by a camera, with high-depth pixel modes automatically converted to 8-bit monochrome or 24-bit RGB format.

One or more of the pins may be connected in a chain, so that the output from one filter becomes the input for another. A set of connected filters is called a filter graph.

Filters expose various interfaces and media type. Interfaces are a filter's set of method for a specific task, for example the CaptureGraphBuilder is an interface of GraphBuilder filter. Media type identifies what kind of data the upstream filter will deliver to the downstream filter, and the physical layout of the data.

Depending on the camera video mode, ActiveGige Video Capture Filter delivers the following media types:

If Display property of IActiveGige interface is set to FALSE:

Mono 16:       MEDIASUBTYPE_RGB8
Mono 8 debayered:    MEDIASUBTYPE_RGB24
Mono 16 debayered: MEDIASUBTYPE_RGB24      

If Display property of IActiveGige interface is set to TRUE:

For all video modes   MEDIASUBTYPE_RGB24

Writing a DirectShow Application:

A limited set of DirectShow interfaces are compatible with Visual Basic, but primarily DirectShow is a C/C++ COM interface. In order to build applications that use ActiveGige Video Source Filter, you will need to install DirectX SDK and have a general understanding of COM client programming. A good starting point is Microsoft's Amcap sample application included in the DirectX SDK.

There are several tasks that any DirectShow application must perform.

·The application creates an instance of the Filter Graph Manager.  
·The application uses the Filter Graph Manager to build a filter graph. The exact set of filters in the graph will depend on the application.  
·The application uses the Filter Graph Manager to control the filter graph and stream data through the filters. Throughout this process, the application will also respond to events from the Filter Graph Manager.  
·The application queries the interfaces exposed by the filters and uses their methods to control the properties of the filters.  
·When processing is completed, the application releases the Filter Graph Manager and all of the filters.  
Note that ActiveGige Video Source Capture Filter provides two alternative ways of working with multiple cameras. By default, ActiveGigE installs one DirectShow device called "GigE Vision compliant camera". You can select a specific camera via the Source property page or through the IActiveGige interface. Alternatively, you can use the FilterConfig utility to register several GigE Vision devices in the system, each one associated with a specific camera. Refer to Working with multiple cameras for more details.

For more information refer to the following topics:

Retrieving the Filter
Building the Graph
Displaying the Preview
Capturing to AVI
Getting the Image Data
Displaying Property Pages