xref: /aosp_15_r20/external/webrtc/call/call_config.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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 "api/fec_controller.h"
14 #include "api/field_trials_view.h"
15 #include "api/metronome/metronome.h"
16 #include "api/neteq/neteq_factory.h"
17 #include "api/network_state_predictor.h"
18 #include "api/rtc_error.h"
19 #include "api/task_queue/task_queue_factory.h"
20 #include "api/transport/bitrate_settings.h"
21 #include "api/transport/network_control.h"
22 #include "call/audio_state.h"
23 #include "call/rtp_transport_config.h"
24 #include "call/rtp_transport_controller_send_factory_interface.h"
25 
26 namespace webrtc {
27 
28 class AudioProcessing;
29 class RtcEventLog;
30 
31 struct CallConfig {
32   // If `network_task_queue` is set to nullptr, Call will assume that network
33   // 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);
37   CallConfig(const CallConfig&);
38   RtpTransportConfig ExtractTransportConfig() const;
39   ~CallConfig();
40 
41   // 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.
46   rtc::scoped_refptr<AudioState> audio_state;
47 
48   // Audio Processing Module to be used in this call.
49   AudioProcessing* audio_processing = nullptr;
50 
51   // RtcEventLog to use for this call. Required.
52   // Use webrtc::RtcEventLog::CreateNull() for a null implementation.
53   RtcEventLog* const event_log = nullptr;
54 
55   // FecController to use for this call.
56   FecControllerFactoryInterface* fec_controller_factory = nullptr;
57 
58   // Task Queue Factory to be used in this call. Required.
59   TaskQueueFactory* task_queue_factory = nullptr;
60 
61   // NetworkStatePredictor to use for this call.
62   NetworkStatePredictorFactoryInterface* network_state_predictor_factory =
63       nullptr;
64 
65   // Network controller factory to use for this call.
66   NetworkControllerFactoryInterface* network_controller_factory = nullptr;
67 
68   // NetEq factory to use for this call.
69   NetEqFactory* neteq_factory = nullptr;
70 
71   // Key-value mapping of internal configurations to apply,
72   // e.g. field trials.
73   const FieldTrialsView* trials = nullptr;
74 
75   TaskQueueBase* const network_task_queue_ = nullptr;
76   // RtpTransportControllerSend to use for this call.
77   RtpTransportControllerSendFactoryInterface*
78       rtp_transport_controller_send_factory = nullptr;
79 
80   Metronome* metronome = nullptr;
81 
82   // The burst interval of the pacer, see TaskQueuePacedSender constructor.
83   absl::optional<TimeDelta> pacer_burst_interval;
84 };
85 
86 }  // namespace webrtc
87 
88 #endif  // CALL_CALL_CONFIG_H_
89