matrixion/src/voip/CallDevices.h

49 lines
1.1 KiB
C
Raw Normal View History

2021-03-05 02:35:15 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
// SPDX-FileCopyrightText: 2022 Nheko Contributors
2021-03-05 02:35:15 +03:00
//
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <string>
#include <utility>
#include <vector>
#include <QObject>
typedef struct _GstDevice GstDevice;
class CallDevices : public QObject
{
2021-09-18 01:22:33 +03:00
Q_OBJECT
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;
std::vector<std::string>
frameRates(const std::string &cameraName, const std::string &resolution) const;
signals:
2021-09-18 01:22:33 +03:00
void devicesChanged();
private:
2021-09-18 01:22:33 +03:00
CallDevices();
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;
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;
};