mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Update tgcalls library.
This commit is contained in:
parent
662424319c
commit
78c9c1e7f8
3 changed files with 17 additions and 15 deletions
|
@ -628,6 +628,12 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
|
||||||
const auto &protocol = call.vprotocol().c_phoneCallProtocol();
|
const auto &protocol = call.vprotocol().c_phoneCallProtocol();
|
||||||
const auto &serverConfig = _user->session().serverConfig();
|
const auto &serverConfig = _user->session().serverConfig();
|
||||||
|
|
||||||
|
auto encryptionKeyValue = ranges::view::all(
|
||||||
|
_authKey
|
||||||
|
) | ranges::view::transform([](bytes::type byte) {
|
||||||
|
return static_cast<uint8_t>(byte);
|
||||||
|
}) | ranges::to_vector;
|
||||||
|
|
||||||
const auto weak = base::make_weak(this);
|
const auto weak = base::make_weak(this);
|
||||||
auto descriptor = tgcalls::Descriptor{
|
auto descriptor = tgcalls::Descriptor{
|
||||||
.config = tgcalls::Config{
|
.config = tgcalls::Config{
|
||||||
|
@ -641,14 +647,14 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
|
||||||
.enableVolumeControl = true,
|
.enableVolumeControl = true,
|
||||||
.maxApiLayer = protocol.vmax_layer().v,
|
.maxApiLayer = protocol.vmax_layer().v,
|
||||||
},
|
},
|
||||||
|
.encryptionKey = tgcalls::EncryptionKey(
|
||||||
|
std::move(encryptionKeyValue),
|
||||||
|
(_type == Type::Outgoing)),
|
||||||
.videoCapture = nullptr,
|
.videoCapture = nullptr,
|
||||||
.stateUpdated = [=](tgcalls::State state) {
|
.stateUpdated = [=](tgcalls::State state, tgcalls::VideoState videoState) {
|
||||||
crl::on_main(weak, [=] {
|
crl::on_main(weak, [=] {
|
||||||
handleControllerStateChange(state);
|
handleControllerStateChange(state, videoState);
|
||||||
});
|
});
|
||||||
},
|
|
||||||
.videoStateUpdated = [=](bool state) {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
.signalBarsUpdated = [=](int count) {
|
.signalBarsUpdated = [=](int count) {
|
||||||
crl::on_main(weak, [=] {
|
crl::on_main(weak, [=] {
|
||||||
|
@ -700,13 +706,6 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptor.encryptionKey.isOutgoing = (_type == Type::Outgoing);
|
|
||||||
descriptor.encryptionKey.value = ranges::view::all(
|
|
||||||
_authKey
|
|
||||||
) | ranges::view::transform([](bytes::type byte) {
|
|
||||||
return static_cast<uint8_t>(byte);
|
|
||||||
}) | ranges::to_vector;
|
|
||||||
|
|
||||||
descriptor.videoCapture = tgcalls::CreateVideoCapture();
|
descriptor.videoCapture = tgcalls::CreateVideoCapture();
|
||||||
|
|
||||||
const auto version = call.vprotocol().match([&](
|
const auto version = call.vprotocol().match([&](
|
||||||
|
@ -746,7 +745,9 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
|
||||||
raw->setAudioOutputDuckingEnabled(settings.callAudioDuckingEnabled());
|
raw->setAudioOutputDuckingEnabled(settings.callAudioDuckingEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Call::handleControllerStateChange(tgcalls::State state) {
|
void Call::handleControllerStateChange(
|
||||||
|
tgcalls::State state,
|
||||||
|
tgcalls::VideoState videoState) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case tgcalls::State::WaitInit: {
|
case tgcalls::State::WaitInit: {
|
||||||
DEBUG_LOG(("Call Info: State changed to WaitingInit."));
|
DEBUG_LOG(("Call Info: State changed to WaitingInit."));
|
||||||
|
|
|
@ -22,6 +22,7 @@ class Track;
|
||||||
namespace tgcalls {
|
namespace tgcalls {
|
||||||
class Instance;
|
class Instance;
|
||||||
enum class State;
|
enum class State;
|
||||||
|
enum class VideoState;
|
||||||
} // namespace tgcalls
|
} // namespace tgcalls
|
||||||
|
|
||||||
namespace Calls {
|
namespace Calls {
|
||||||
|
@ -154,7 +155,7 @@ private:
|
||||||
void displayNextFrame(QImage frame);
|
void displayNextFrame(QImage frame);
|
||||||
|
|
||||||
void generateModExpFirst(bytes::const_span randomSeed);
|
void generateModExpFirst(bytes::const_span randomSeed);
|
||||||
void handleControllerStateChange(tgcalls::State state);
|
void handleControllerStateChange(tgcalls::State state, tgcalls::VideoState videoState);
|
||||||
void handleControllerBarCountChange(int count);
|
void handleControllerBarCountChange(int count);
|
||||||
void createAndStartController(const MTPDphoneCall &call);
|
void createAndStartController(const MTPDphoneCall &call);
|
||||||
|
|
||||||
|
|
2
Telegram/ThirdParty/tgcalls
vendored
2
Telegram/ThirdParty/tgcalls
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 36566eda283ae3731ff2911965ee09efbf9ae361
|
Subproject commit 80c2b48f30b9ee21b75abf2afda09c5fc77b4145
|
Loading…
Add table
Reference in a new issue