// SPDX-FileCopyrightText: 2021 Nheko Contributors // SPDX-FileCopyrightText: 2022 Nheko Contributors // // SPDX-License-Identifier: GPL-3.0-or-later #pragma once #include #include #include #include typedef struct _GstDevice GstDevice; class CallDevices final : public QObject { Q_OBJECT public: static CallDevices &instance() { static CallDevices instance; return instance; } bool haveMic() const; bool haveCamera() const; std::vector names(bool isVideo, const std::string &defaultDevice) const; std::vector resolutions(const std::string &cameraName) const; std::vector frameRates(const std::string &cameraName, const std::string &resolution) const; signals: void devicesChanged(); private: CallDevices(); friend class WebRTCSession; void init(); GstDevice *audioDevice() const; GstDevice *videoDevice(std::pair &resolution, std::pair &frameRate) const; public: CallDevices(CallDevices const &) = delete; void operator=(CallDevices const &) = delete; };