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). ActiveGeni Video Capture Filter provides a DirectShow interface to GenTL 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, ActiveGeni Video Capture Filter delivers the following media types:

If Display property of IActiveGeni interface is set to FALSE:

Mono 8:       MEDIASUBTYPE_RGB8
Mono 16:       MEDIASUBTYPE_RGB8
RGB 24:       MEDIASUBTYPE_RGB24
Mono 8 debayered:    MEDIASUBTYPE_RGB24
RGB 48:      MEDIASUBTYPE_RGB24
Mono 16 debayered: MEDIASUBTYPE_RGB24      
YUV422:      MEDIASUBTYPE_UYVU
YUV411:      MEDIASUBTYPE_Y411
YUV444:      MEDIASUBTYPE_AYUV

If Display property of IActiveGeni 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 ActiveGeni 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 ActiveGeni Video Source Capture Filter does not enumerates the cameras. Instead, the selection of a specific camera is available ivia the Source property page or through the IActiveGeni interface. Multiple 1394 cameras can be accessed at the same time using several instances of the filter. See Working with multiple cameras for 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