mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Implement media devices tracking on Windows.
This commit is contained in:
@@ -522,20 +522,6 @@ void Instance::showInfoPanel(not_null<GroupCall*> call) {
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::setCurrentAudioDevice(bool input, const QString &deviceId) {
|
||||
if (input) {
|
||||
Core::App().settings().setCallInputDeviceId(deviceId);
|
||||
} else {
|
||||
Core::App().settings().setCallOutputDeviceId(deviceId);
|
||||
}
|
||||
Core::App().saveSettingsDelayed();
|
||||
if (const auto call = currentCall()) {
|
||||
call->setCurrentAudioDevice(input, deviceId);
|
||||
} else if (const auto group = currentGroupCall()) {
|
||||
group->setCurrentAudioDevice(input, deviceId);
|
||||
}
|
||||
}
|
||||
|
||||
FnMut<void()> Instance::addAsyncWaiter() {
|
||||
auto semaphore = std::make_unique<crl::semaphore>();
|
||||
const auto raw = semaphore.get();
|
||||
@@ -846,7 +832,7 @@ std::shared_ptr<tgcalls::VideoCaptureInterface> Instance::getVideoCapture(
|
||||
if (deviceId) {
|
||||
result->switchToDevice(
|
||||
(deviceId->isEmpty()
|
||||
? Core::App().settings().callVideoInputDeviceId()
|
||||
? Core::App().settings().cameraDeviceId()
|
||||
: *deviceId).toStdString(),
|
||||
isScreenCapture);
|
||||
}
|
||||
@@ -854,7 +840,7 @@ std::shared_ptr<tgcalls::VideoCaptureInterface> Instance::getVideoCapture(
|
||||
}
|
||||
const auto startDeviceId = (deviceId && !deviceId->isEmpty())
|
||||
? *deviceId
|
||||
: Core::App().settings().callVideoInputDeviceId();
|
||||
: Core::App().settings().cameraDeviceId();
|
||||
auto result = std::shared_ptr<tgcalls::VideoCaptureInterface>(
|
||||
tgcalls::VideoCaptureInterface::Create(
|
||||
tgcalls::StaticThreads::getThreads(),
|
||||
|
||||
Reference in New Issue
Block a user