Other Methods

There are numerous other tools that libvcvideo provides before and after initialization.

Static Methods

Possibly the most useful static method is the vc::videoDevice::enumerateDevices method which returns a std::vector of std::strings that are likely video devices on your system. You can then iterate over the devices to try them out and see if they work with libvcvideo.

Another static method is the vc::videoDevice::getIntegerControlString method. This will get the appropriate std::string name for an integer control, which are discussed in the Normal Methods section below.


Normal Methods

These methods can only be called after device initialization is done.

Integer Controls

Integer Controls are any aspect of the device that can be controlled by an integer value. The currently supported controls are listed in the vc::vdIntegerControl enumeration.

The getValidIntegerControls will return a vector of integer controls that you can use on your device. You can then use getIntegerControlMinimum and getIntegerControlMaximum to find the range of the control, and getIntegerControlStep to find the effective step value for it.

    1   try {
    2     cout << "Brightness (min/max/cur): "
    3          << device.getIntegerControlMinimum(vc::BRIGHTNESS) << "/"
    4          << device.getIntegerControlMaximum(vc::BRIGHTNESS) << "/"
    5          << device.getIntegerControlValue(vc::BRIGHTNESS) << endl;
    6   }
    7   catch(string s) {
    8     cout << "Brightness Information Failed: " << s << endl;
    9     exit(1);
   10   }

With all this information in hand you can then get and set the control through the getIntegerControlValue and setIntegerControlValue methods.

    1   try {
    2     device.setIntegerControlValue(vc::BRIGHTNESS,5000);
    3     cout << device.getIntegerControlValue(vc::BRIGHTNESS) << endl;
    4   }
    5   catch(string s) {
    6     cout << "Brightness Change Failed: " << s << endl;
    7     exit(1);
    8   }

It may seem verbose, but it is very usable.


Signals

Signals using libsigc++2 can optionally be built into libvcvideo. If you do build them in you are provided with the useful sig_progress . This will give an integer of completion out of 100 and a string of what it is currently doing. Right now this is only valid for the init method but it can be very handy.


Navigation: Back (Compilation) - Home - Next (Integration)
Generated on Mon Jul 28 16:14:11 2008 for libvcvideo by  doxygen 1.5.3