open source pkg v1
This commit is contained in:
31
pkg/OpenFace/lib/3rdParty/CameraEnumerator/DeviceEnumerator.h
vendored
Normal file
31
pkg/OpenFace/lib/3rdParty/CameraEnumerator/DeviceEnumerator.h
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
#include <dshow.h>
|
||||
|
||||
#pragma comment(lib, "strmiids")
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
struct Device {
|
||||
int id; // This can be used to open the device in OpenCV
|
||||
std::string devicePath;
|
||||
std::string deviceName; // This can be used to show the devices to the user
|
||||
};
|
||||
|
||||
class DeviceEnumerator {
|
||||
|
||||
public:
|
||||
|
||||
DeviceEnumerator() = default;
|
||||
std::map<int, Device> getDevicesMap(const GUID deviceClass);
|
||||
std::map<int, Device> getVideoDevicesMap();
|
||||
std::map<int, Device> getAudioDevicesMap();
|
||||
|
||||
private:
|
||||
|
||||
std::string ConvertBSTRToMBS(BSTR bstr);
|
||||
std::string ConvertWCSToMBS(const wchar_t* pstr, long wslen);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user