Technical Application Note TAN2007003
Revised May 15, 2015
Developing Microsoft DirectShow Applications with FlyCapture
This TAN applies to all Point Grey products that are supported by the Point Grey FlyCapture driver, which supports Microsoft DirectShow.
The purpose of this Technical Application Note is to show developers how to set up their build environment in order to effectively use the FlyCapture library for developing DirectShow-based applications. This TAN will explain how to prepare the build environment so that sample image capture applications included in the SDK, such as AMCap and PlayCap, can be built successfully. Once this is completed, the environment will be ready for use with custom applications.
The main steps are:
The latest version of the FlyCapture SDK can be found on the downloads page. Run FlyCapture2_x86.exe or FlyCapture2_x64.exe and follow the installation wizard instructions to install the library.
The DirectShow components for FlyCapture2 consist of two DirectShow filters:
regsvr32 PGRDirectShowDecoder.ax PGRDirectShowSource.ax
In addition, the FlyCapture2 DLLs must be present on the system in a location that can be found during registration. This can be achieved by placing the required DLLs in the same directory as the .ax filter files.
The DirectX SDK contains a header file (ddraw.h) that is required to build the DirectShow Base Classes. Obtain the latest version of the SDK from either a current MSDN subscription (if available) or by downloading it from Microsoft.
The DirectX installer extracts the files to a temporary location before performing the installation. Installing with the default options is sufficient.
Obtain the source code for the DirectShow SDK by installing the Microsoft Windows Server 2003 R2 Platform SDK from a current MSDN subscription (if available) or by downloading it from Microsoft.
Run the Setup.exe program and follow the instructions in the installer. Make sure that the Microsoft DirectShow SDK is selected for install.
When the DirectShow SDK is moved from the DirectX SDK to the Platform SDK, the Visual Studio project files for building the Base Classes or any of the sample applications are removed. Download the v0.2 project files from https://msdn.microsoft.com/en-us/library/windows/desktop/dd407279(v=vs.85).aspx, which contain the proper project files for the R2 version of the Platform SDK.
Extract the project files into the installation directory of the Platform SDK. For example, if the default installation directory is used, then they should be extracted to C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow.
The steps outlined in the following section require Microsoft Visual Studio 2005. Support for Visual Studio 6.0 was removed in the October 2004 edition of the DirectX SDK. It may be possible to use the free Visual Studio Express Edition from Microsoft; however, this has not been tested by Point Grey.
In order for Visual Studio 2005 to find the correct header files, the path to both SDKs must be entered into the IDE. Follow these steps to set the path:
Figure 1: Visual Studio “Include files” directories for DirectX
Figure 2: Visual Studio "Library files" directories for DirectX
Load the solution file baseclasses.sln, which should be located in C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses. If the IDE used to load the solution is Visual Studio 2005, a prompt should appear asking if it should proceed with converting the solution. Answer Yes to convert the solution.
The project builds two versions of the library: the retail (strmbase.lib) and debug (strmbasd.lib) versions. Unicode versions are also available if localization is required.
In order to build the sample DirectShow applications, the $BASECLASSES environment variable must be set.
Follow these steps to set the variable:
Load a solution file containing a sample application. The PlayCap sample capture application will be used for this example.
StrmBase.lib (or StrmBasd.lib, depending on the build type)
With these settings in place, the sample application should build successfully.
When building custom DirectShow applications, the following header files should be included:
Some DirectShow interfaces may require additional header files; these will be listed in the interface reference.
The following libraries should be included: