Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: webrtc/call.h

Issue 1166263004: C++11 in-class member initialization in Call configs. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: merge master Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/video_receive_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #ifndef WEBRTC_CALL_H_ 10 #ifndef WEBRTC_CALL_H_
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // A Call instance can contain several send and/or receive streams. All streams 66 // A Call instance can contain several send and/or receive streams. All streams
67 // are assumed to have the same remote endpoint and will share bitrate estimates 67 // are assumed to have the same remote endpoint and will share bitrate estimates
68 // etc. 68 // etc.
69 class Call { 69 class Call {
70 public: 70 public:
71 enum NetworkState { 71 enum NetworkState {
72 kNetworkUp, 72 kNetworkUp,
73 kNetworkDown, 73 kNetworkDown,
74 }; 74 };
75 struct Config { 75 struct Config {
76 Config() = delete;
76 explicit Config(newapi::Transport* send_transport) 77 explicit Config(newapi::Transport* send_transport)
77 : send_transport(send_transport), 78 : send_transport(send_transport) {}
78 voice_engine(NULL),
79 overuse_callback(NULL) {}
80 79
81 static const int kDefaultStartBitrateBps; 80 static const int kDefaultStartBitrateBps;
82 81
83 // TODO(solenberg): Need to add media type to the interface for outgoing 82 // TODO(solenberg): Need to add media type to the interface for outgoing
84 // packets too. 83 // packets too.
85 newapi::Transport* send_transport; 84 newapi::Transport* send_transport = nullptr;
86 85
87 // VoiceEngine used for audio/video synchronization for this Call. 86 // VoiceEngine used for audio/video synchronization for this Call.
88 VoiceEngine* voice_engine; 87 VoiceEngine* voice_engine = nullptr;
89 88
90 // Callback for overuse and normal usage based on the jitter of incoming 89 // Callback for overuse and normal usage based on the jitter of incoming
91 // captured frames. 'NULL' disables the callback. 90 // captured frames. 'nullptr' disables the callback.
92 LoadObserver* overuse_callback; 91 LoadObserver* overuse_callback = nullptr;
93 92
94 // Bitrate config used until valid bitrate estimates are calculated. Also 93 // Bitrate config used until valid bitrate estimates are calculated. Also
95 // used to cap total bitrate used. 94 // used to cap total bitrate used.
96 struct BitrateConfig { 95 struct BitrateConfig {
97 BitrateConfig() 96 int min_bitrate_bps = 0;
98 : min_bitrate_bps(0), 97 int start_bitrate_bps = kDefaultStartBitrateBps;
99 start_bitrate_bps(kDefaultStartBitrateBps), 98 int max_bitrate_bps = -1;
100 max_bitrate_bps(-1) {}
101 int min_bitrate_bps;
102 int start_bitrate_bps;
103 int max_bitrate_bps;
104 } bitrate_config; 99 } bitrate_config;
105 100
106 struct AudioConfig { 101 struct AudioConfig {
107 AudioDeviceModule* audio_device_manager; 102 AudioDeviceModule* audio_device_manager = nullptr;
108 AudioProcessing* audio_processing; 103 AudioProcessing* audio_processing = nullptr;
109 VoiceEngineObserver* voice_engine_observer; 104 VoiceEngineObserver* voice_engine_observer = nullptr;
110 } audio_config; 105 } audio_config;
111 }; 106 };
112 107
113 struct Stats { 108 struct Stats {
114 Stats() 109 int send_bandwidth_bps = 0;
115 : send_bandwidth_bps(0), 110 int recv_bandwidth_bps = 0;
116 recv_bandwidth_bps(0), 111 int64_t pacer_delay_ms = 0;
117 pacer_delay_ms(0), 112 int64_t rtt_ms = -1;
118 rtt_ms(-1) {}
119
120 int send_bandwidth_bps;
121 int recv_bandwidth_bps;
122 int64_t pacer_delay_ms;
123 int64_t rtt_ms;
124 }; 113 };
125 114
126 static Call* Create(const Call::Config& config); 115 static Call* Create(const Call::Config& config);
127 116
128 virtual AudioSendStream* CreateAudioSendStream( 117 virtual AudioSendStream* CreateAudioSendStream(
129 const AudioSendStream::Config& config) = 0; 118 const AudioSendStream::Config& config) = 0;
130 virtual void DestroyAudioSendStream(AudioSendStream* send_stream) = 0; 119 virtual void DestroyAudioSendStream(AudioSendStream* send_stream) = 0;
131 120
132 virtual AudioReceiveStream* CreateAudioReceiveStream( 121 virtual AudioReceiveStream* CreateAudioReceiveStream(
133 const AudioReceiveStream::Config& config) = 0; 122 const AudioReceiveStream::Config& config) = 0;
(...skipping 26 matching lines...) Expand all
160 // implemented. 149 // implemented.
161 virtual void SetBitrateConfig( 150 virtual void SetBitrateConfig(
162 const Config::BitrateConfig& bitrate_config) = 0; 151 const Config::BitrateConfig& bitrate_config) = 0;
163 virtual void SignalNetworkState(NetworkState state) = 0; 152 virtual void SignalNetworkState(NetworkState state) = 0;
164 153
165 virtual ~Call() {} 154 virtual ~Call() {}
166 }; 155 };
167 } // namespace webrtc 156 } // namespace webrtc
168 157
169 #endif // WEBRTC_CALL_H_ 158 #endif // WEBRTC_CALL_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698