| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include <string> |
| 8 |
#include <utility> |
| 9 |
#include <vector> |
| 10 |
|
| 11 |
#include <QObject> |
| 12 |
|
| 13 |
typedef struct _GstDevice GstDevice; |
| 14 |
|
| 15 |
class CallDevices final : public QObject |
| 16 |
{ |
| 17 |
Q_OBJECT |
| 18 |
|
| 19 |
public: |
| 20 |
static CallDevices &instance() |
| 21 |
{ |
| 22 |
static CallDevices instance; |
| 23 |
return instance; |
| 24 |
} |
| 25 |
|
| 26 |
bool haveMic() const; |
| 27 |
bool haveCamera() const; |
| 28 |
std::vector<std::string> names(bool isVideo, const std::string &defaultDevice) const; |
| 29 |
std::vector<std::string> resolutions(const std::string &cameraName) const; |
| 30 |
std::vector<std::string> |
| 31 |
frameRates(const std::string &cameraName, const std::string &resolution) const; |
| 32 |
|
| 33 |
signals: |
| 34 |
void devicesChanged(); |
| 35 |
|
| 36 |
private: |
| 37 |
CallDevices(); |
| 38 |
|
| 39 |
friend class WebRTCSession; |
| 40 |
void init(); |
| 41 |
GstDevice *audioDevice() const; |
| 42 |
GstDevice *videoDevice(std::pair<int, int> &resolution, std::pair<int, int> &frameRate) const; |
| 43 |
|
| 44 |
public: |
| 45 |
CallDevices(CallDevices const &) = delete; |
| 46 |
void operator=(CallDevices const &) = delete; |
| 47 |
void deinit(); |
| 48 |
}; |