Show
Ignore:
Timestamp:
02/26/10 16:01:00 (4 years ago)
Author:
robert
Message:

From Raymon de Vries, "I've made a small change to DirectShowTexture?.cpp: in the options for the directshow plugin it is possible to specify the capture device by number. For instance:

options->setPluginStringData("captureVideoDevice", "0");

Lines added in getDevice() are:

int deviceId = atoi(name.c_str());
if(deviceId >= 0 && deviceId < (int)_listDevice.size())

return _listDevice[deviceId];

This makes it easy to use a capture device without knowing it's name. Attached is the whole file against rev 11044"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/directshow/DirectShowTexture.cpp

    r11116 r11130  
    844844        //if (!_listDevice.empty()) 
    845845        //    return _listDevice.front(); 
     846 
     847        int deviceId = atoi(name.c_str()); 
     848        if(deviceId >= 0 && deviceId < (int)_listDevice.size()) 
     849          return _listDevice[deviceId]; 
     850 
    846851        return DeviceEntry(); 
    847852    }