2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
2022-01-01 06:57:53 +03:00
|
|
|
// SPDX-FileCopyrightText: 2022 Nheko Contributors
|
2021-03-05 02:35:15 +03:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-02-07 19:47:47 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
typedef struct _GstDevice GstDevice;
|
|
|
|
|
2022-10-10 15:38:29 +03:00
|
|
|
class CallDevices final : public QObject
|
2021-02-07 19:47:47 +03:00
|
|
|
{
|
2021-09-18 01:22:33 +03:00
|
|
|
Q_OBJECT
|
2021-02-07 19:47:47 +03:00
|
|
|
|
|
|
|
public:
|
2021-09-18 01:22:33 +03:00
|
|
|
static CallDevices &instance()
|
|
|
|
{
|
|
|
|
static CallDevices instance;
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2021-11-22 02:32:49 +03:00
|
|
|
std::vector<std::string>
|
|
|
|
frameRates(const std::string &cameraName, const std::string &resolution) const;
|
2021-02-07 19:47:47 +03:00
|
|
|
|
|
|
|
signals:
|
2021-09-18 01:22:33 +03:00
|
|
|
void devicesChanged();
|
2021-02-07 19:47:47 +03:00
|
|
|
|
|
|
|
private:
|
2021-09-18 01:22:33 +03:00
|
|
|
CallDevices();
|
2021-02-07 19:47:47 +03:00
|
|
|
|
2021-09-18 01:22:33 +03:00
|
|
|
friend class WebRTCSession;
|
|
|
|
void init();
|
|
|
|
GstDevice *audioDevice() const;
|
|
|
|
GstDevice *videoDevice(std::pair<int, int> &resolution, std::pair<int, int> &frameRate) const;
|
2021-02-07 19:47:47 +03:00
|
|
|
|
|
|
|
public:
|
2022-09-25 21:05:08 +03:00
|
|
|
CallDevices(CallDevices const &) = delete;
|
2021-09-18 01:22:33 +03:00
|
|
|
void operator=(CallDevices const &) = delete;
|
2021-02-07 19:47:47 +03:00
|
|
|
};
|