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"
This commit is contained in:
@@ -843,6 +843,11 @@ struct ListDeviceAvailable
|
||||
return _listDevice[i];
|
||||
//if (!_listDevice.empty())
|
||||
// return _listDevice.front();
|
||||
|
||||
int deviceId = atoi(name.c_str());
|
||||
if(deviceId >= 0 && deviceId < (int)_listDevice.size())
|
||||
return _listDevice[deviceId];
|
||||
|
||||
return DeviceEntry();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user