Testing for a Frame Grabber

If you are certain that your application will always be used with a particular frame grabber, you can use the specific class that describes it, as shown in Getting a Frame Grabber Reference. In some cases, however, you may not know exactly what hardware is available to your application. To test whether a particular board is a frame grabber, use the following:

ccBoard& board = ccBoard::get(i);

ccFrameGrabber* pfg = dynamic_cast<ccFrameGrabber*>(&board):
if (!pfg)
{
// board is not a frame grabber
}

You can use the same technique to determine the particular type of frame grabber available to your program. For example, the following code checks for an MVS-8100M frame grabber.

ccBoard& board = ccBoard::get(i);

cc8100m* pfg = dynamic_cast<cc8100m*>(&board):
if (!pfg)
{
// board is not an MVS-8100M
}

Note that when you use the code above to find a frame grabber board, the index (i) refers to a specific board. When you have more than one frame grabber in your system each board is assigned an index starting with 0. Generally frame grabber boards are assigned index numbers according to the motherboard slot into which they are installed. Index 0 is assigned the lowest numbered slot, index 1 to the next higher numbered slot, and so on. However, this can vary with motherboard manufacturers and can be BIOS dependent. You should consult your system hardware documentation to verify the correct frame grabber index numbers to use when more than one frame grabber is installed in your system. If you have only one frame grabber, it will always be index 0.

Note also that ccBoard covers frame grabbers of all types as do its associated index numbers. If you specify a particular type frame grabber, each type uses its own index numbers starting with 0. For example,

cc8100m& fg = cc8100m::get(i);

The index for a cc8100m frame grabber board may not be the same index you would use if you acquire a ccBoard object for the same board. The figure below shows an example system configuration to illustrate this point.

Frame grabber index example