tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

call_config.h (3079B)


      1 /*
      2 *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
      3 *
      4 *  Use of this source code is governed by a BSD-style license
      5 *  that can be found in the LICENSE file in the root of the source
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 #ifndef CALL_CALL_CONFIG_H_
     11 #define CALL_CALL_CONFIG_H_
     12 
     13 #include <memory>
     14 #include <optional>
     15 
     16 #include "api/environment/environment.h"
     17 #include "api/fec_controller.h"
     18 #include "api/metronome/metronome.h"
     19 #include "api/neteq/neteq_factory.h"
     20 #include "api/network_state_predictor.h"
     21 #include "api/scoped_refptr.h"
     22 #include "api/task_queue/task_queue_base.h"
     23 #include "api/transport/bitrate_settings.h"
     24 #include "api/transport/network_control.h"
     25 #include "api/units/time_delta.h"
     26 #include "call/audio_state.h"
     27 #include "call/rtp_transport_config.h"
     28 
     29 namespace webrtc {
     30 
     31 class AudioProcessing;
     32 
     33 struct CallConfig {
     34  // If `network_task_queue` is set to nullptr, Call will assume that network
     35  // related callbacks will be made on the same TQ as the Call instance was
     36  // constructed on.
     37  explicit CallConfig(const Environment& env,
     38                      TaskQueueBase* network_task_queue = nullptr);
     39 
     40  // Move-only.
     41  CallConfig(CallConfig&&) = default;
     42  CallConfig& operator=(CallConfig&& other) = default;
     43 
     44  ~CallConfig();
     45 
     46  RtpTransportConfig ExtractTransportConfig() const;
     47 
     48  Environment env;
     49 
     50  // Bitrate config used until valid bitrate estimates are calculated. Also
     51  // used to cap total bitrate used. This comes from the remote connection.
     52  BitrateConstraints bitrate_config;
     53 
     54  // AudioState which is possibly shared between multiple calls.
     55  scoped_refptr<AudioState> audio_state;
     56 
     57  // Audio Processing Module to be used in this call.
     58  AudioProcessing* audio_processing = nullptr;
     59 
     60  // FecController to use for this call.
     61  FecControllerFactoryInterface* fec_controller_factory = nullptr;
     62 
     63  // NetworkStatePredictor to use for this call.
     64  NetworkStatePredictorFactoryInterface* network_state_predictor_factory =
     65      nullptr;
     66 
     67  // Call-specific Network controller factory to use. If this is set, it
     68  // takes precedence over network_controller_factory.
     69  std::unique_ptr<NetworkControllerFactoryInterface>
     70      per_call_network_controller_factory;
     71  // Network controller factory to use for this call if
     72  // per_call_network_controller_factory is null.
     73  NetworkControllerFactoryInterface* network_controller_factory = nullptr;
     74 
     75  // NetEq factory to use for this call.
     76  NetEqFactory* neteq_factory = nullptr;
     77 
     78  TaskQueueBase* network_task_queue_ = nullptr;
     79 
     80  Metronome* decode_metronome = nullptr;
     81  Metronome* encode_metronome = nullptr;
     82 
     83  // The burst interval of the pacer, see TaskQueuePacedSender constructor.
     84  std::optional<TimeDelta> pacer_burst_interval;
     85 
     86  // Enables send packet batching from the egress RTP sender.
     87  bool enable_send_packet_batching = false;
     88 };
     89 
     90 }  // namespace webrtc
     91 
     92 #endif  // CALL_CALL_CONFIG_H_