"Fossies" - the Fresh Open Source Software Archive

Member "tdesktop-2.6.1/Telegram/SourceFiles/calls/calls_controller.cpp" (24 Feb 2021, 1405 Bytes) of package /linux/misc/tdesktop-2.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "calls_controller.cpp" see the Fossies "Dox" file reference documentation.

    1 /*
    2 This file is part of Telegram Desktop,
    3 the official desktop application for the Telegram messaging service.
    4 
    5 For license and copyright information please follow this link:
    6 https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
    7 */
    8 #include "calls/calls_controller.h"
    9 
   10 #include "calls/calls_controller_tgvoip.h"
   11 #include "calls/calls_controller_webrtc.h"
   12 
   13 namespace Calls {
   14 
   15 [[nodiscard]] std::unique_ptr<Controller> MakeController(
   16         const std::string &version,
   17         const TgVoipConfig &config,
   18         const TgVoipPersistentState &persistentState,
   19         const std::vector<TgVoipEndpoint> &endpoints,
   20         const TgVoipProxy *proxy,
   21         TgVoipNetworkType initialNetworkType,
   22         const TgVoipEncryptionKey &encryptionKey,
   23         Fn<void(QByteArray)> sendSignalingData,
   24         Fn<void(QImage)> displayNextFrame) {
   25     if (version == WebrtcController::Version()) {
   26         return std::make_unique<WebrtcController>(
   27             config,
   28             persistentState,
   29             endpoints,
   30             proxy,
   31             initialNetworkType,
   32             encryptionKey,
   33             std::move(sendSignalingData),
   34             std::move(displayNextFrame));
   35     }
   36     return std::make_unique<TgVoipController>(
   37         config,
   38         persistentState,
   39         endpoints,
   40         proxy,
   41         initialNetworkType,
   42         encryptionKey);
   43 }
   44 
   45 std::vector<std::string> CollectControllerVersions() {
   46     return { WebrtcController::Version(), TgVoipController::Version() };
   47 }
   48 
   49 int ControllerMaxLayer() {
   50     return TgVoip::getConnectionMaxLayer();
   51 }
   52 
   53 } // namespace Calls