include/avcap/DeviceCollector.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2005, 2008 Nico Pranke <Nico.Pranke@googlemail.com>, Robin Luedtke <RobinLu@gmx.de> 
00003  *
00004  * This file is part of avcap.
00005  *
00006  * avcap is free software: you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation, either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * avcap is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with avcap.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 /* avcap is free for non-commercial use.
00021  * To use it in commercial endeavors, please contact Nico Pranke <Nico.Pranke@googlemail.com>
00022  */
00023 
00024 #ifndef DEVICECOLLECTOR_H_
00025 #define DEVICECOLLECTOR_H_
00026 
00027 #include <list>
00028 #include <string>
00029 
00030 #include "singleton.h"
00031 
00032 #if !defined(_MSC_VER) && !defined(USE_PREBUILD_LIBS)
00033 # include "avcap-config.h"
00034 #endif
00035 
00036 #include "avcap-export.h"
00037 
00038 namespace avcap
00039 {
00040 class DeviceDescriptor;
00041 class CaptureDevice;
00042 
00044         
00069         class AVCAP_Export DeviceCollector
00070         {
00071         public:
00073                 typedef std::list<DeviceDescriptor*> DeviceList;
00074         
00075         private:
00076                 DeviceList mDeviceList;
00077         
00078         public:
00080                 DeviceCollector();
00081                 
00083                 virtual ~DeviceCollector();
00084         
00086 
00087                 inline const DeviceList& getDeviceList() const 
00088                         { return (const DeviceList&) mDeviceList; }
00089         
00091 
00095                 bool testDevice(const std::string& name);
00096         
00097         private:
00098         
00099 #ifdef AVCAP_LINUX
00100                 void query_V4L1_Devices();
00101                 
00102                 void query_V4L2_Devices();
00103                 
00104                 void query_ieee1394_Devices();
00105                 
00106                 int test_V4L1_Device(const std::string& name);
00107                 
00108                 int test_V4L2_Device(const std::string& name);
00109 #endif
00110 
00111 #ifdef AVCAP_OSX
00112                 void query_QT_Devices();
00113 #endif
00114 
00115 #ifdef AVCAP_WINDOWS
00116                 void query_DS_Devices();
00117                 
00118                 int test_DS_Device(const std::string& name);
00119                 
00120                 bool getInstalledDeviceIDs(std::list<std::string> &UniqueDeviceIDList);
00121 
00122 #endif
00123 };
00124 
00126 typedef Singleton<DeviceCollector> DEVICE_COLLECTOR;
00127 }
00128 
00129 /* \todo Add Linux-support for IEEE 1394 digital cameras. */
00130 
00131 #endif // DEVICECOLLECTOR_H_

Generated on Mon Nov 30 11:10:30 2009 for avcap-0.1 by  doxygen 1.5.1