mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Stop video when rejoining-as, handle errors.
This commit is contained in:
parent
2a5977e97f
commit
412cfb24d2
2 changed files with 25 additions and 1 deletions
|
@ -964,6 +964,14 @@ void GroupCall::rejoinWithHash(const QString &hash) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupCall::setJoinAs(not_null<PeerData*> as) {
|
void GroupCall::setJoinAs(not_null<PeerData*> as) {
|
||||||
|
if (_joinAs != as) {
|
||||||
|
if (_cameraOutgoing) {
|
||||||
|
_cameraOutgoing->setState(Webrtc::VideoState::Inactive);
|
||||||
|
}
|
||||||
|
if (_screenOutgoing) {
|
||||||
|
_screenOutgoing->setState(Webrtc::VideoState::Inactive);
|
||||||
|
}
|
||||||
|
}
|
||||||
_joinAs = as;
|
_joinAs = as;
|
||||||
if (const auto chat = _peer->asChat()) {
|
if (const auto chat = _peer->asChat()) {
|
||||||
chat->setGroupCallDefaultJoinAs(_joinAs->id);
|
chat->setGroupCallDefaultJoinAs(_joinAs->id);
|
||||||
|
@ -1650,6 +1658,10 @@ void GroupCall::ensureOutgoingVideo() {
|
||||||
if (!_cameraCapture) {
|
if (!_cameraCapture) {
|
||||||
_cameraCapture = _delegate->groupCallGetVideoCapture(
|
_cameraCapture = _delegate->groupCallGetVideoCapture(
|
||||||
_cameraInputId);
|
_cameraInputId);
|
||||||
|
if (!_cameraCapture) {
|
||||||
|
_cameraOutgoing->setState(Webrtc::VideoState::Inactive);
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_cameraCapture->switchToDevice(_cameraInputId.toStdString());
|
_cameraCapture->switchToDevice(_cameraInputId.toStdString());
|
||||||
}
|
}
|
||||||
|
@ -1678,6 +1690,18 @@ void GroupCall::ensureOutgoingVideo() {
|
||||||
tgcalls::VideoCaptureInterface::Create(
|
tgcalls::VideoCaptureInterface::Create(
|
||||||
tgcalls::StaticThreads::getThreads(),
|
tgcalls::StaticThreads::getThreads(),
|
||||||
_screenDeviceId.toStdString()));
|
_screenDeviceId.toStdString()));
|
||||||
|
if (!_screenCapture) {
|
||||||
|
_screenOutgoing->setState(Webrtc::VideoState::Inactive);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto weak = base::make_weak(this);
|
||||||
|
_screenCapture->setOnFatalError([=] {
|
||||||
|
crl::on_main(weak, [=] {
|
||||||
|
_screenOutgoing->setState(
|
||||||
|
Webrtc::VideoState::Inactive);
|
||||||
|
// #TODO calls show error toast, receive here device.
|
||||||
|
});
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
_screenCapture->switchToDevice(_screenDeviceId.toStdString());
|
_screenCapture->switchToDevice(_screenDeviceId.toStdString());
|
||||||
}
|
}
|
||||||
|
|
2
Telegram/ThirdParty/tgcalls
vendored
2
Telegram/ThirdParty/tgcalls
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 63dcf796d7721e02ee179c61aec7045b2699a3eb
|
Subproject commit 9a2b95507fe19de2e969517453ae0874fbe1ae62
|
Loading…
Add table
Reference in a new issue