init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
99
Telegram/SourceFiles/calls/calls_controller_tgvoip.h
Normal file
99
Telegram/SourceFiles/calls/calls_controller_tgvoip.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "calls/calls_controller.h"
|
||||
|
||||
namespace Calls {
|
||||
|
||||
class TgVoipController final : public Controller {
|
||||
public:
|
||||
TgVoipController(
|
||||
const TgVoipConfig &config,
|
||||
const TgVoipPersistentState &persistentState,
|
||||
const std::vector<TgVoipEndpoint> &endpoints,
|
||||
const TgVoipProxy *proxy,
|
||||
TgVoipNetworkType initialNetworkType,
|
||||
const TgVoipEncryptionKey &encryptionKey)
|
||||
: _impl(TgVoip::makeInstance(
|
||||
config,
|
||||
persistentState,
|
||||
endpoints,
|
||||
proxy,
|
||||
initialNetworkType,
|
||||
encryptionKey)) {
|
||||
}
|
||||
|
||||
[[nodiscard]] static std::string Version() {
|
||||
return TgVoip::getVersion();
|
||||
}
|
||||
|
||||
std::string version() override {
|
||||
return Version();
|
||||
}
|
||||
void setNetworkType(TgVoipNetworkType networkType) override {
|
||||
_impl->setNetworkType(networkType);
|
||||
}
|
||||
void setMuteMicrophone(bool muteMicrophone) override {
|
||||
_impl->setMuteMicrophone(muteMicrophone);
|
||||
}
|
||||
void setAudioOutputGainControlEnabled(bool enabled) override {
|
||||
_impl->setAudioOutputGainControlEnabled(enabled);
|
||||
}
|
||||
void setEchoCancellationStrength(int strength) override {
|
||||
_impl->setEchoCancellationStrength(strength);
|
||||
}
|
||||
void setAudioInputDevice(std::string id) override {
|
||||
_impl->setAudioInputDevice(id);
|
||||
}
|
||||
void setAudioOutputDevice(std::string id) override {
|
||||
_impl->setAudioOutputDevice(id);
|
||||
}
|
||||
void setInputVolume(float level) override {
|
||||
_impl->setInputVolume(level);
|
||||
}
|
||||
void setOutputVolume(float level) override {
|
||||
_impl->setOutputVolume(level);
|
||||
}
|
||||
void setAudioOutputDuckingEnabled(bool enabled) override {
|
||||
_impl->setAudioOutputDuckingEnabled(enabled);
|
||||
}
|
||||
bool receiveSignalingData(const QByteArray &data) override {
|
||||
return false;
|
||||
}
|
||||
std::string getLastError() override {
|
||||
return _impl->getLastError();
|
||||
}
|
||||
std::string getDebugInfo() override {
|
||||
return _impl->getDebugInfo();
|
||||
}
|
||||
int64_t getPreferredRelayId() override {
|
||||
return _impl->getPreferredRelayId();
|
||||
}
|
||||
TgVoipTrafficStats getTrafficStats() override {
|
||||
return _impl->getTrafficStats();
|
||||
}
|
||||
TgVoipPersistentState getPersistentState() override {
|
||||
return _impl->getPersistentState();
|
||||
}
|
||||
void setOnStateUpdated(Fn<void(TgVoipState)> onStateUpdated) override {
|
||||
_impl->setOnStateUpdated(std::move(onStateUpdated));
|
||||
}
|
||||
void setOnSignalBarsUpdated(Fn<void(int)> onSignalBarsUpdated) override {
|
||||
_impl->setOnSignalBarsUpdated(std::move(onSignalBarsUpdated));
|
||||
}
|
||||
TgVoipFinalState stop() override {
|
||||
return _impl->stop();
|
||||
}
|
||||
|
||||
private:
|
||||
const std::unique_ptr<TgVoip> _impl;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Calls
|
||||
Reference in New Issue
Block a user