mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 16:15:13 +00:00
Fix camera start.
This commit is contained in:
@@ -159,10 +159,11 @@ Call::Call(
|
|||||||
|
|
||||||
if (_type == Type::Outgoing) {
|
if (_type == Type::Outgoing) {
|
||||||
setState(State::Requesting);
|
setState(State::Requesting);
|
||||||
|
setupOutgoingVideo();
|
||||||
} else {
|
} else {
|
||||||
startWaitingTrack();
|
startWaitingTrack();
|
||||||
|
// setupOutgoingVideo will be called when we decide if it is enabled.
|
||||||
}
|
}
|
||||||
setupOutgoingVideo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Call::generateModExpFirst(bytes::const_span randomSeed) {
|
void Call::generateModExpFirst(bytes::const_span randomSeed) {
|
||||||
@@ -337,9 +338,7 @@ void Call::setupOutgoingVideo() {
|
|||||||
const auto started = _videoOutgoing->enabled();
|
const auto started = _videoOutgoing->enabled();
|
||||||
_videoOutgoing->enabledValue(
|
_videoOutgoing->enabledValue(
|
||||||
) | rpl::start_with_next([=](bool enabled) {
|
) | rpl::start_with_next([=](bool enabled) {
|
||||||
if (_state.current() != State::Established
|
if (_state.current() != State::Established && enabled != started) {
|
||||||
&& enabled != started
|
|
||||||
&& !(_type == Type::Incoming && !_id)) {
|
|
||||||
_videoOutgoing->setEnabled(started);
|
_videoOutgoing->setEnabled(started);
|
||||||
} else if (enabled) {
|
} else if (enabled) {
|
||||||
if (!_videoCapture) {
|
if (!_videoCapture) {
|
||||||
@@ -464,12 +463,10 @@ bool Call::handleUpdate(const MTPPhoneCall &call) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are allowed to change it for non-established call
|
|
||||||
// only in case `incoming && !_id`, only when we just received it.
|
|
||||||
_videoOutgoing->setEnabled(data.is_video());
|
|
||||||
|
|
||||||
_id = data.vid().v;
|
_id = data.vid().v;
|
||||||
_accessHash = data.vaccess_hash().v;
|
_accessHash = data.vaccess_hash().v;
|
||||||
|
_videoOutgoing->setEnabled(data.is_video());
|
||||||
|
setupOutgoingVideo();
|
||||||
auto gaHashBytes = bytes::make_span(data.vg_a_hash().v);
|
auto gaHashBytes = bytes::make_span(data.vg_a_hash().v);
|
||||||
if (gaHashBytes.size() != kSha256Size) {
|
if (gaHashBytes.size() != kSha256Size) {
|
||||||
LOG(("Call Error: Wrong g_a_hash size %1, expected %2."
|
LOG(("Call Error: Wrong g_a_hash size %1, expected %2."
|
||||||
|
Submodule Telegram/lib_webrtc updated: 78e8e4ae77...ab42b2bf87
Reference in New Issue
Block a user