blob: 6df4ab7ed4a9834bec034b8ddcbf14526eb92df0 [file] [log] [blame]
Paulina Hensman11b34f42018-04-09 14:24:52 +02001/*
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 "api/fec_controller.h"
Jonas Orelande62c2f22022-03-29 11:04:48 +020014#include "api/field_trials_view.h"
Evan Shrubsole5723d852022-02-14 14:09:57 +010015#include "api/metronome/metronome.h"
Ivo Creusenc3d1f9b2019-11-01 11:47:51 +010016#include "api/neteq/neteq_factory.h"
Ying Wang0810a7c2019-04-10 13:48:24 +020017#include "api/network_state_predictor.h"
Steve Anton10542f22019-01-11 09:11:00 -080018#include "api/rtc_error.h"
Danil Chapovalov359fe332019-04-01 10:46:36 +020019#include "api/task_queue/task_queue_factory.h"
Mirko Bonadei738bfa72019-09-17 14:47:38 +020020#include "api/transport/bitrate_settings.h"
Sebastian Janssondfce03a2018-05-18 18:05:10 +020021#include "api/transport/network_control.h"
Paulina Hensman11b34f42018-04-09 14:24:52 +020022#include "call/audio_state.h"
Vojin Ilic504fc192021-05-31 14:02:28 +020023#include "call/rtp_transport_config.h"
24#include "call/rtp_transport_controller_send_factory_interface.h"
Paulina Hensman11b34f42018-04-09 14:24:52 +020025
26namespace webrtc {
27
28class AudioProcessing;
29class RtcEventLog;
30
31struct CallConfig {
Artem Titovea240272021-07-26 12:40:21 +020032 // If `network_task_queue` is set to nullptr, Call will assume that network
Tomas Gunnarsson41bfcf42021-01-30 16:15:21 +010033 // related callbacks will be made on the same TQ as the Call instance was
34 // constructed on.
35 explicit CallConfig(RtcEventLog* event_log,
36 TaskQueueBase* network_task_queue = nullptr);
Mirko Bonadei8fdcac32018-08-28 16:30:18 +020037 CallConfig(const CallConfig&);
Vojin Ilic504fc192021-05-31 14:02:28 +020038 RtpTransportConfig ExtractTransportConfig() const;
Paulina Hensman11b34f42018-04-09 14:24:52 +020039 ~CallConfig();
40
Paulina Hensman11b34f42018-04-09 14:24:52 +020041 // Bitrate config used until valid bitrate estimates are calculated. Also
42 // used to cap total bitrate used. This comes from the remote connection.
43 BitrateConstraints bitrate_config;
44
45 // AudioState which is possibly shared between multiple calls.
Paulina Hensman11b34f42018-04-09 14:24:52 +020046 rtc::scoped_refptr<AudioState> audio_state;
47
48 // Audio Processing Module to be used in this call.
Paulina Hensman11b34f42018-04-09 14:24:52 +020049 AudioProcessing* audio_processing = nullptr;
50
51 // RtcEventLog to use for this call. Required.
52 // Use webrtc::RtcEventLog::CreateNull() for a null implementation.
Tomas Gunnarsson41bfcf42021-01-30 16:15:21 +010053 RtcEventLog* const event_log = nullptr;
Paulina Hensman11b34f42018-04-09 14:24:52 +020054
55 // FecController to use for this call.
56 FecControllerFactoryInterface* fec_controller_factory = nullptr;
Sebastian Janssondfce03a2018-05-18 18:05:10 +020057
Danil Chapovalov53d45ba2019-07-03 14:56:33 +020058 // Task Queue Factory to be used in this call. Required.
Danil Chapovalov359fe332019-04-01 10:46:36 +020059 TaskQueueFactory* task_queue_factory = nullptr;
60
Ying Wang0810a7c2019-04-10 13:48:24 +020061 // NetworkStatePredictor to use for this call.
62 NetworkStatePredictorFactoryInterface* network_state_predictor_factory =
63 nullptr;
64
Sebastian Janssondfce03a2018-05-18 18:05:10 +020065 // Network controller factory to use for this call.
66 NetworkControllerFactoryInterface* network_controller_factory = nullptr;
Ivo Creusenc3d1f9b2019-11-01 11:47:51 +010067
68 // NetEq factory to use for this call.
69 NetEqFactory* neteq_factory = nullptr;
Erik Språng662678d2019-11-15 17:18:52 +010070
71 // Key-value mapping of internal configurations to apply,
72 // e.g. field trials.
Jonas Orelande62c2f22022-03-29 11:04:48 +020073 const FieldTrialsView* trials = nullptr;
Tomas Gunnarsson41bfcf42021-01-30 16:15:21 +010074
75 TaskQueueBase* const network_task_queue_ = nullptr;
Vojin Ilic504fc192021-05-31 14:02:28 +020076 // RtpTransportControllerSend to use for this call.
77 RtpTransportControllerSendFactoryInterface*
78 rtp_transport_controller_send_factory = nullptr;
Evan Shrubsole5723d852022-02-14 14:09:57 +010079
80 Metronome* metronome = nullptr;
Henrik Boströmcf2856b2022-11-15 09:23:19 +010081
82 // The burst interval of the pacer, see TaskQueuePacedSender constructor.
83 absl::optional<TimeDelta> pacer_burst_interval;
Paulina Hensman11b34f42018-04-09 14:24:52 +020084};
85
86} // namespace webrtc
87
88#endif // CALL_CALL_CONFIG_H_