Adding camera enumerator project for getting ready for GUI

This commit is contained in:
Tadas Baltrusaitis
2018-02-09 08:19:03 +00:00
parent 57eadb52d4
commit f0cb0c9ae5
7 changed files with 392 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#include <map>
#include <iostream>
#include "DeviceEnumerator.h"
int main()
{
/*
The id field of the Device struct can be used with an OpenCV VideoCapture object
*/
DeviceEnumerator de;
// Audio Devices
std::map<int, Device> devices = de.getAudioDevicesMap();
// Print information about the devices
for (auto const &device : devices) {
std::cout << "== AUDIO DEVICE (id:" << device.first << ") ==" << std::endl;
std::cout << "Name: " << device.second.deviceName << std::endl;
std::cout << "Path: " << device.second.devicePath << std::endl;
}
// Video Devices
devices = de.getVideoDevicesMap();
// Print information about the devices
for (auto const &device : devices) {
std::cout << "== VIDEO DEVICE (id:" << device.first << ") ==" << std::endl;
std::cout << "Name: " << device.second.deviceName << std::endl;
std::cout << "Path: " << device.second.devicePath << std::endl;
}
}