mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 23:25:15 +00:00
Stop video when rejoining-as, handle errors.
This commit is contained in:
@@ -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
Submodule Telegram/ThirdParty/tgcalls updated: 63dcf796d7...9a2b95507f
Reference in New Issue
Block a user