2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Share video capturer between call and settings.

This commit is contained in:
John Preston
2020-08-21 15:49:51 +04:00
parent 4672e3d068
commit 4d2041ae48
5 changed files with 41 additions and 11 deletions

View File

@@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwidget.h"
#include "mtproto/mtproto_config.h"
#include "boxes/rate_call_box.h"
#include "tgcalls/VideoCaptureInterface.h"
#include "app.h"
namespace Calls {
@@ -344,4 +345,15 @@ void Instance::requestPermissionOrFail(Platform::PermissionType type, Fn<void()>
}
}
std::shared_ptr<tgcalls::VideoCaptureInterface> Instance::getVideoCapture() {
if (auto result = _videoCapture.lock()) {
return result;
}
auto result = std::shared_ptr<tgcalls::VideoCaptureInterface>(
tgcalls::VideoCaptureInterface::Create(
Core::App().settings().callVideoInputDeviceId().toStdString()));
_videoCapture = result;
return result;
}
} // namespace Calls