xref: /aosp_15_r20/external/webrtc/call/call_config.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1*d9f75844SAndroid Build Coastguard Worker /*
2*d9f75844SAndroid Build Coastguard Worker  *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3*d9f75844SAndroid Build Coastguard Worker  *
4*d9f75844SAndroid Build Coastguard Worker  *  Use of this source code is governed by a BSD-style license
5*d9f75844SAndroid Build Coastguard Worker  *  that can be found in the LICENSE file in the root of the source
6*d9f75844SAndroid Build Coastguard Worker  *  tree. An additional intellectual property rights grant can be found
7*d9f75844SAndroid Build Coastguard Worker  *  in the file PATENTS.  All contributing project authors may
8*d9f75844SAndroid Build Coastguard Worker  *  be found in the AUTHORS file in the root of the source tree.
9*d9f75844SAndroid Build Coastguard Worker  */
10*d9f75844SAndroid Build Coastguard Worker #ifndef CALL_CALL_CONFIG_H_
11*d9f75844SAndroid Build Coastguard Worker #define CALL_CALL_CONFIG_H_
12*d9f75844SAndroid Build Coastguard Worker 
13*d9f75844SAndroid Build Coastguard Worker #include "api/fec_controller.h"
14*d9f75844SAndroid Build Coastguard Worker #include "api/field_trials_view.h"
15*d9f75844SAndroid Build Coastguard Worker #include "api/metronome/metronome.h"
16*d9f75844SAndroid Build Coastguard Worker #include "api/neteq/neteq_factory.h"
17*d9f75844SAndroid Build Coastguard Worker #include "api/network_state_predictor.h"
18*d9f75844SAndroid Build Coastguard Worker #include "api/rtc_error.h"
19*d9f75844SAndroid Build Coastguard Worker #include "api/task_queue/task_queue_factory.h"
20*d9f75844SAndroid Build Coastguard Worker #include "api/transport/bitrate_settings.h"
21*d9f75844SAndroid Build Coastguard Worker #include "api/transport/network_control.h"
22*d9f75844SAndroid Build Coastguard Worker #include "call/audio_state.h"
23*d9f75844SAndroid Build Coastguard Worker #include "call/rtp_transport_config.h"
24*d9f75844SAndroid Build Coastguard Worker #include "call/rtp_transport_controller_send_factory_interface.h"
25*d9f75844SAndroid Build Coastguard Worker 
26*d9f75844SAndroid Build Coastguard Worker namespace webrtc {
27*d9f75844SAndroid Build Coastguard Worker 
28*d9f75844SAndroid Build Coastguard Worker class AudioProcessing;
29*d9f75844SAndroid Build Coastguard Worker class RtcEventLog;
30*d9f75844SAndroid Build Coastguard Worker 
31*d9f75844SAndroid Build Coastguard Worker struct CallConfig {
32*d9f75844SAndroid Build Coastguard Worker   // If `network_task_queue` is set to nullptr, Call will assume that network
33*d9f75844SAndroid Build Coastguard Worker   // related callbacks will be made on the same TQ as the Call instance was
34*d9f75844SAndroid Build Coastguard Worker   // constructed on.
35*d9f75844SAndroid Build Coastguard Worker   explicit CallConfig(RtcEventLog* event_log,
36*d9f75844SAndroid Build Coastguard Worker                       TaskQueueBase* network_task_queue = nullptr);
37*d9f75844SAndroid Build Coastguard Worker   CallConfig(const CallConfig&);
38*d9f75844SAndroid Build Coastguard Worker   RtpTransportConfig ExtractTransportConfig() const;
39*d9f75844SAndroid Build Coastguard Worker   ~CallConfig();
40*d9f75844SAndroid Build Coastguard Worker 
41*d9f75844SAndroid Build Coastguard Worker   // Bitrate config used until valid bitrate estimates are calculated. Also
42*d9f75844SAndroid Build Coastguard Worker   // used to cap total bitrate used. This comes from the remote connection.
43*d9f75844SAndroid Build Coastguard Worker   BitrateConstraints bitrate_config;
44*d9f75844SAndroid Build Coastguard Worker 
45*d9f75844SAndroid Build Coastguard Worker   // AudioState which is possibly shared between multiple calls.
46*d9f75844SAndroid Build Coastguard Worker   rtc::scoped_refptr<AudioState> audio_state;
47*d9f75844SAndroid Build Coastguard Worker 
48*d9f75844SAndroid Build Coastguard Worker   // Audio Processing Module to be used in this call.
49*d9f75844SAndroid Build Coastguard Worker   AudioProcessing* audio_processing = nullptr;
50*d9f75844SAndroid Build Coastguard Worker 
51*d9f75844SAndroid Build Coastguard Worker   // RtcEventLog to use for this call. Required.
52*d9f75844SAndroid Build Coastguard Worker   // Use webrtc::RtcEventLog::CreateNull() for a null implementation.
53*d9f75844SAndroid Build Coastguard Worker   RtcEventLog* const event_log = nullptr;
54*d9f75844SAndroid Build Coastguard Worker 
55*d9f75844SAndroid Build Coastguard Worker   // FecController to use for this call.
56*d9f75844SAndroid Build Coastguard Worker   FecControllerFactoryInterface* fec_controller_factory = nullptr;
57*d9f75844SAndroid Build Coastguard Worker 
58*d9f75844SAndroid Build Coastguard Worker   // Task Queue Factory to be used in this call. Required.
59*d9f75844SAndroid Build Coastguard Worker   TaskQueueFactory* task_queue_factory = nullptr;
60*d9f75844SAndroid Build Coastguard Worker 
61*d9f75844SAndroid Build Coastguard Worker   // NetworkStatePredictor to use for this call.
62*d9f75844SAndroid Build Coastguard Worker   NetworkStatePredictorFactoryInterface* network_state_predictor_factory =
63*d9f75844SAndroid Build Coastguard Worker       nullptr;
64*d9f75844SAndroid Build Coastguard Worker 
65*d9f75844SAndroid Build Coastguard Worker   // Network controller factory to use for this call.
66*d9f75844SAndroid Build Coastguard Worker   NetworkControllerFactoryInterface* network_controller_factory = nullptr;
67*d9f75844SAndroid Build Coastguard Worker 
68*d9f75844SAndroid Build Coastguard Worker   // NetEq factory to use for this call.
69*d9f75844SAndroid Build Coastguard Worker   NetEqFactory* neteq_factory = nullptr;
70*d9f75844SAndroid Build Coastguard Worker 
71*d9f75844SAndroid Build Coastguard Worker   // Key-value mapping of internal configurations to apply,
72*d9f75844SAndroid Build Coastguard Worker   // e.g. field trials.
73*d9f75844SAndroid Build Coastguard Worker   const FieldTrialsView* trials = nullptr;
74*d9f75844SAndroid Build Coastguard Worker 
75*d9f75844SAndroid Build Coastguard Worker   TaskQueueBase* const network_task_queue_ = nullptr;
76*d9f75844SAndroid Build Coastguard Worker   // RtpTransportControllerSend to use for this call.
77*d9f75844SAndroid Build Coastguard Worker   RtpTransportControllerSendFactoryInterface*
78*d9f75844SAndroid Build Coastguard Worker       rtp_transport_controller_send_factory = nullptr;
79*d9f75844SAndroid Build Coastguard Worker 
80*d9f75844SAndroid Build Coastguard Worker   Metronome* metronome = nullptr;
81*d9f75844SAndroid Build Coastguard Worker 
82*d9f75844SAndroid Build Coastguard Worker   // The burst interval of the pacer, see TaskQueuePacedSender constructor.
83*d9f75844SAndroid Build Coastguard Worker   absl::optional<TimeDelta> pacer_burst_interval;
84*d9f75844SAndroid Build Coastguard Worker };
85*d9f75844SAndroid Build Coastguard Worker 
86*d9f75844SAndroid Build Coastguard Worker }  // namespace webrtc
87*d9f75844SAndroid Build Coastguard Worker 
88*d9f75844SAndroid Build Coastguard Worker #endif  // CALL_CALL_CONFIG_H_
89