mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 15:35:51 +00:00
Implement media device tracking on macOS.
This commit is contained in:
@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "media/audio/media_audio_track.h"
|
#include "media/audio/media_audio_track.h"
|
||||||
#include "media/media_common.h"
|
#include "media/media_common.h"
|
||||||
#include "media/streaming/media_streaming_utility.h"
|
#include "media/streaming/media_streaming_utility.h"
|
||||||
|
#include "webrtc/webrtc_environment.h"
|
||||||
#include "webrtc/webrtc_media_devices.h"
|
#include "webrtc/webrtc_media_devices.h"
|
||||||
#include "data/data_document.h"
|
#include "data/data_document.h"
|
||||||
#include "data/data_file_origin.h"
|
#include "data/data_file_origin.h"
|
||||||
@@ -144,8 +145,11 @@ bool CreatePlaybackDevice() {
|
|||||||
const auto id = Current().deviceId().toStdString();
|
const auto id = Current().deviceId().toStdString();
|
||||||
AudioDevice = alcOpenDevice(id.c_str());
|
AudioDevice = alcOpenDevice(id.c_str());
|
||||||
if (!AudioDevice) {
|
if (!AudioDevice) {
|
||||||
LOG(("Audio Error: Could not create default playback device, enumerating.."));
|
LOG(("Audio Error: Could not create default playback device, refreshing.."));
|
||||||
EnumeratePlaybackDevices();
|
crl::on_main([] {
|
||||||
|
const auto type = Webrtc::DeviceType::Playback;
|
||||||
|
Core::App().mediaDevices().forceRefresh(type);
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -555,7 +555,8 @@ void ChooseAudioDeviceBox(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto weak = Ui::MakeWeak(box);
|
const auto weak = Ui::MakeWeak(box);
|
||||||
chosen(state->ids.take(value).value_or(kDefaultDeviceId));
|
const auto i = state->ids.find(value);
|
||||||
|
chosen((i != end(state->ids)) ? i->second : kDefaultDeviceId);
|
||||||
if (weak) {
|
if (weak) {
|
||||||
box->closeBox();
|
box->closeBox();
|
||||||
}
|
}
|
||||||
|
Submodule Telegram/lib_webrtc updated: 5a83169788...b78e51ad98
Reference in New Issue
Block a user