From dbe854e9b0fb9153e1d851870f013513e9c5110d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 26 Feb 2010 15:01:00 +0000 Subject: [PATCH] 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" --- src/osgPlugins/directshow/DirectShowTexture.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osgPlugins/directshow/DirectShowTexture.cpp b/src/osgPlugins/directshow/DirectShowTexture.cpp index c885c34af..8484b41c3 100644 --- a/src/osgPlugins/directshow/DirectShowTexture.cpp +++ b/src/osgPlugins/directshow/DirectShowTexture.cpp @@ -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(); }