#ifndef __DEVICEDISCOVERY_H__ #define __DEVICEDISCOVERY_H__ #include #include #include #include class DeviceDiscovery { constexpr static int32_t OtaSpecificWidth = 96; public: constexpr static auto DeviceName = "UVC Camera"; struct Device { ~Device(); #ifdef Q_OS_WIN Device(IMFMediaSource *source); IMFMediaSource *source = nullptr; IMFSourceReader *reader = nullptr; #else std::string name; #endif }; using Resolution = std::pair; using Resolutions = std::vector; DeviceDiscovery(); std::shared_ptr find(const std::string &deviceName, std::error_code &error); void enterOtaMode(const std::shared_ptr &device, std::error_code &error); std::vector devices(); protected: Resolutions deviceResolutions(const std::shared_ptr &source); }; #endif // __DEVICEDISCOVERY_H__