2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Improve calls settings (camera / microphone).

This commit is contained in:
John Preston
2020-08-21 14:50:13 +04:00
parent ade7745b0b
commit 4672e3d068
5 changed files with 186 additions and 137 deletions

View File

@@ -744,8 +744,8 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
.mediaDevicesConfig = tgcalls::MediaDevicesConfig{
.audioInputId = settings.callInputDeviceId().toStdString(),
.audioOutputId = settings.callOutputDeviceId().toStdString(),
.inputVolume = settings.callInputVolume() / 100.f,
.outputVolume = settings.callOutputVolume() / 100.f,
.inputVolume = 1.f,//settings.callInputVolume() / 100.f,
.outputVolume = 1.f,//settings.callOutputVolume() / 100.f,
},
.videoCapture = _videoCapture,
.stateUpdated = [=](tgcalls::State state) {
@@ -962,19 +962,20 @@ void Call::setState(State state) {
}
}
void Call::setCurrentAudioDevice(bool input, std::string deviceId) {
void Call::setCurrentAudioDevice(bool input, const QString &deviceId) {
if (_instance) {
const auto id = deviceId.toStdString();
if (input) {
_instance->setAudioInputDevice(deviceId);
_instance->setAudioInputDevice(id);
} else {
_instance->setAudioOutputDevice(deviceId);
_instance->setAudioOutputDevice(id);
}
}
}
void Call::setCurrentVideoDevice(std::string deviceId) {
void Call::setCurrentVideoDevice(const QString &deviceId) {
if (_videoCapture) {
_videoCapture->switchToDevice(deviceId);
_videoCapture->switchToDevice(deviceId.toStdString());
}
}