summary refs log tree commit diff
path: root/src/CallDevices.h
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-02-09 15:43:17 +0100
committerGitHub <noreply@github.com>2021-02-09 15:43:17 +0100
commitcb704006a5ba3de2ac6209512bb0b196eb2c6f24 (patch)
tree67241aa974024e5527c324e450fa6264ddca81dc /src/CallDevices.h
parentNative rendering breaks kerning (diff)
parentmake lint (diff)
downloadnheko-cb704006a5ba3de2ac6209512bb0b196eb2c6f24.tar.xz
Merge pull request #465 from trilene/call-devices
Add Duplex call devices
Diffstat (limited to 'src/CallDevices.h')
-rw-r--r--src/CallDevices.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/CallDevices.h b/src/CallDevices.h
new file mode 100644

index 00000000..2b4129f1 --- /dev/null +++ b/src/CallDevices.h
@@ -0,0 +1,45 @@ +#pragma once + +#include <string> +#include <utility> +#include <vector> + +#include <QObject> + +typedef struct _GstDevice GstDevice; + +class CallDevices : public QObject +{ + Q_OBJECT + +public: + static CallDevices &instance() + { + static CallDevices instance; + return instance; + } + + void refresh(); + bool haveMic() const; + bool haveCamera() const; + std::vector<std::string> names(bool isVideo, const std::string &defaultDevice) const; + std::vector<std::string> resolutions(const std::string &cameraName) const; + std::vector<std::string> 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<int, int> &resolution, + std::pair<int, int> &frameRate) const; + +public: + CallDevices(CallDevices const &) = delete; + void operator=(CallDevices const &) = delete; +};