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

Side by Side Diff: talk/media/base/mediachannel.h

Issue 1430433004: Replace rtc::cricket::Settable with rtc::Maybe (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 1 month 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 | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | talk/media/base/videoengine_unittest.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 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 20 matching lines...) Expand all
31 #include <string> 31 #include <string>
32 #include <vector> 32 #include <vector>
33 33
34 #include "talk/media/base/codec.h" 34 #include "talk/media/base/codec.h"
35 #include "talk/media/base/constants.h" 35 #include "talk/media/base/constants.h"
36 #include "talk/media/base/streamparams.h" 36 #include "talk/media/base/streamparams.h"
37 #include "webrtc/base/basictypes.h" 37 #include "webrtc/base/basictypes.h"
38 #include "webrtc/base/buffer.h" 38 #include "webrtc/base/buffer.h"
39 #include "webrtc/base/dscp.h" 39 #include "webrtc/base/dscp.h"
40 #include "webrtc/base/logging.h" 40 #include "webrtc/base/logging.h"
41 #include "webrtc/base/maybe.h"
41 #include "webrtc/base/sigslot.h" 42 #include "webrtc/base/sigslot.h"
42 #include "webrtc/base/socket.h" 43 #include "webrtc/base/socket.h"
43 #include "webrtc/base/window.h" 44 #include "webrtc/base/window.h"
44 // TODO(juberti): re-evaluate this include 45 // TODO(juberti): re-evaluate this include
45 #include "talk/session/media/audiomonitor.h" 46 #include "talk/session/media/audiomonitor.h"
46 47
47 namespace rtc { 48 namespace rtc {
48 class Buffer; 49 class Buffer;
49 class RateLimiter; 50 class RateLimiter;
50 class Timing; 51 class Timing;
51 } 52 }
52 53
53 namespace cricket { 54 namespace cricket {
54 55
55 class AudioRenderer; 56 class AudioRenderer;
56 struct RtpHeader; 57 struct RtpHeader;
57 class ScreencastId; 58 class ScreencastId;
58 struct VideoFormat; 59 struct VideoFormat;
59 class VideoCapturer; 60 class VideoCapturer;
60 class VideoRenderer; 61 class VideoRenderer;
61 62
62 const int kMinRtpHeaderExtensionId = 1; 63 const int kMinRtpHeaderExtensionId = 1;
63 const int kMaxRtpHeaderExtensionId = 255; 64 const int kMaxRtpHeaderExtensionId = 255;
64 const int kScreencastDefaultFps = 5; 65 const int kScreencastDefaultFps = 5;
65 66
66 // Used in AudioOptions and VideoOptions to signify "unset" values.
67 template <class T> 67 template <class T>
68 class Settable { 68 static std::string ToStringIfSet(const char* key, const rtc::Maybe<T>& val) {
69 public:
70 Settable() : set_(false), val_() {}
71 explicit Settable(T val) : set_(true), val_(val) {}
72
73 bool IsSet() const {
74 return set_;
75 }
76
77 bool Get(T* out) const {
78 *out = val_;
79 return set_;
80 }
81
82 T GetWithDefaultIfUnset(const T& default_value) const {
83 return set_ ? val_ : default_value;
84 }
85
86 void Set(T val) {
87 set_ = true;
88 val_ = val;
89 }
90
91 void Clear() {
92 Set(T());
93 set_ = false;
94 }
95
96 void SetFrom(const Settable<T>& o) {
97 // Set this value based on the value of o, iff o is set. If this value is
98 // set and o is unset, the current value will be unchanged.
99 T val;
100 if (o.Get(&val)) {
101 Set(val);
102 }
103 }
104
105 std::string ToString() const {
106 return set_ ? rtc::ToString(val_) : "";
107 }
108
109 bool operator==(const Settable<T>& o) const {
110 // Equal if both are unset with any value or both set with the same value.
111 return (set_ == o.set_) && (!set_ || (val_ == o.val_));
112 }
113
114 bool operator!=(const Settable<T>& o) const {
115 return !operator==(o);
116 }
117
118 protected:
119 void InitializeValue(const T &val) {
120 val_ = val;
121 }
122
123 private:
124 bool set_;
125 T val_;
126 };
127
128 template <class T>
129 static std::string ToStringIfSet(const char* key, const Settable<T>& val) {
130 std::string str; 69 std::string str;
131 if (val.IsSet()) { 70 if (val) {
132 str = key; 71 str = key;
133 str += ": "; 72 str += ": ";
134 str += val.ToString(); 73 str += val ? rtc::ToString(*val) : "";
135 str += ", "; 74 str += ", ";
136 } 75 }
137 return str; 76 return str;
138 } 77 }
139 78
140 template <class T> 79 template <class T>
141 static std::string VectorToString(const std::vector<T>& vals) { 80 static std::string VectorToString(const std::vector<T>& vals) {
142 std::ostringstream ost; 81 std::ostringstream ost;
143 ost << "["; 82 ost << "[";
144 for (size_t i = 0; i < vals.size(); ++i) { 83 for (size_t i = 0; i < vals.size(); ++i) {
145 if (i > 0) { 84 if (i > 0) {
146 ost << ", "; 85 ost << ", ";
147 } 86 }
148 ost << vals[i].ToString(); 87 ost << vals[i].ToString();
149 } 88 }
150 ost << "]"; 89 ost << "]";
151 return ost.str(); 90 return ost.str();
152 } 91 }
153 92
154 // Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine. 93 // Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine.
155 // Used to be flags, but that makes it hard to selectively apply options. 94 // Used to be flags, but that makes it hard to selectively apply options.
156 // We are moving all of the setting of options to structs like this, 95 // We are moving all of the setting of options to structs like this,
157 // but some things currently still use flags. 96 // but some things currently still use flags.
158 struct AudioOptions { 97 struct AudioOptions {
159 void SetAll(const AudioOptions& change) { 98 void SetAll(const AudioOptions& change) {
160 echo_cancellation.SetFrom(change.echo_cancellation); 99 SetFrom(&echo_cancellation, change.echo_cancellation);
161 auto_gain_control.SetFrom(change.auto_gain_control); 100 SetFrom(&auto_gain_control, change.auto_gain_control);
162 noise_suppression.SetFrom(change.noise_suppression); 101 SetFrom(&noise_suppression, change.noise_suppression);
163 highpass_filter.SetFrom(change.highpass_filter); 102 SetFrom(&highpass_filter, change.highpass_filter);
164 stereo_swapping.SetFrom(change.stereo_swapping); 103 SetFrom(&stereo_swapping, change.stereo_swapping);
165 audio_jitter_buffer_max_packets.SetFrom( 104 SetFrom(&audio_jitter_buffer_max_packets,
166 change.audio_jitter_buffer_max_packets); 105 change.audio_jitter_buffer_max_packets);
167 audio_jitter_buffer_fast_accelerate.SetFrom( 106 SetFrom(&audio_jitter_buffer_fast_accelerate,
168 change.audio_jitter_buffer_fast_accelerate); 107 change.audio_jitter_buffer_fast_accelerate);
169 typing_detection.SetFrom(change.typing_detection); 108 SetFrom(&typing_detection, change.typing_detection);
170 aecm_generate_comfort_noise.SetFrom(change.aecm_generate_comfort_noise); 109 SetFrom(&aecm_generate_comfort_noise, change.aecm_generate_comfort_noise);
171 conference_mode.SetFrom(change.conference_mode); 110 SetFrom(&conference_mode, change.conference_mode);
172 adjust_agc_delta.SetFrom(change.adjust_agc_delta); 111 SetFrom(&adjust_agc_delta, change.adjust_agc_delta);
173 experimental_agc.SetFrom(change.experimental_agc); 112 SetFrom(&experimental_agc, change.experimental_agc);
174 extended_filter_aec.SetFrom(change.extended_filter_aec); 113 SetFrom(&extended_filter_aec, change.extended_filter_aec);
175 delay_agnostic_aec.SetFrom(change.delay_agnostic_aec); 114 SetFrom(&delay_agnostic_aec, change.delay_agnostic_aec);
176 experimental_ns.SetFrom(change.experimental_ns); 115 SetFrom(&experimental_ns, change.experimental_ns);
177 aec_dump.SetFrom(change.aec_dump); 116 SetFrom(&aec_dump, change.aec_dump);
178 tx_agc_target_dbov.SetFrom(change.tx_agc_target_dbov); 117 SetFrom(&tx_agc_target_dbov, change.tx_agc_target_dbov);
179 tx_agc_digital_compression_gain.SetFrom( 118 SetFrom(&tx_agc_digital_compression_gain,
180 change.tx_agc_digital_compression_gain); 119 change.tx_agc_digital_compression_gain);
181 tx_agc_limiter.SetFrom(change.tx_agc_limiter); 120 SetFrom(&tx_agc_limiter, change.tx_agc_limiter);
182 recording_sample_rate.SetFrom(change.recording_sample_rate); 121 SetFrom(&recording_sample_rate, change.recording_sample_rate);
183 playout_sample_rate.SetFrom(change.playout_sample_rate); 122 SetFrom(&playout_sample_rate, change.playout_sample_rate);
184 dscp.SetFrom(change.dscp); 123 SetFrom(&dscp, change.dscp);
185 combined_audio_video_bwe.SetFrom(change.combined_audio_video_bwe); 124 SetFrom(&combined_audio_video_bwe, change.combined_audio_video_bwe);
186 } 125 }
187 126
188 bool operator==(const AudioOptions& o) const { 127 bool operator==(const AudioOptions& o) const {
189 return echo_cancellation == o.echo_cancellation && 128 return echo_cancellation == o.echo_cancellation &&
190 auto_gain_control == o.auto_gain_control && 129 auto_gain_control == o.auto_gain_control &&
191 noise_suppression == o.noise_suppression && 130 noise_suppression == o.noise_suppression &&
192 highpass_filter == o.highpass_filter && 131 highpass_filter == o.highpass_filter &&
193 stereo_swapping == o.stereo_swapping && 132 stereo_swapping == o.stereo_swapping &&
194 audio_jitter_buffer_max_packets == o.audio_jitter_buffer_max_packets && 133 audio_jitter_buffer_max_packets == o.audio_jitter_buffer_max_packets &&
195 audio_jitter_buffer_fast_accelerate == 134 audio_jitter_buffer_fast_accelerate ==
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 ost << ToStringIfSet("recording_sample_rate", recording_sample_rate); 179 ost << ToStringIfSet("recording_sample_rate", recording_sample_rate);
241 ost << ToStringIfSet("playout_sample_rate", playout_sample_rate); 180 ost << ToStringIfSet("playout_sample_rate", playout_sample_rate);
242 ost << ToStringIfSet("dscp", dscp); 181 ost << ToStringIfSet("dscp", dscp);
243 ost << ToStringIfSet("combined_audio_video_bwe", combined_audio_video_bwe); 182 ost << ToStringIfSet("combined_audio_video_bwe", combined_audio_video_bwe);
244 ost << "}"; 183 ost << "}";
245 return ost.str(); 184 return ost.str();
246 } 185 }
247 186
248 // Audio processing that attempts to filter away the output signal from 187 // Audio processing that attempts to filter away the output signal from
249 // later inbound pickup. 188 // later inbound pickup.
250 Settable<bool> echo_cancellation; 189 rtc::Maybe<bool> echo_cancellation;
251 // Audio processing to adjust the sensitivity of the local mic dynamically. 190 // Audio processing to adjust the sensitivity of the local mic dynamically.
252 Settable<bool> auto_gain_control; 191 rtc::Maybe<bool> auto_gain_control;
253 // Audio processing to filter out background noise. 192 // Audio processing to filter out background noise.
254 Settable<bool> noise_suppression; 193 rtc::Maybe<bool> noise_suppression;
255 // Audio processing to remove background noise of lower frequencies. 194 // Audio processing to remove background noise of lower frequencies.
256 Settable<bool> highpass_filter; 195 rtc::Maybe<bool> highpass_filter;
257 // Audio processing to swap the left and right channels. 196 // Audio processing to swap the left and right channels.
258 Settable<bool> stereo_swapping; 197 rtc::Maybe<bool> stereo_swapping;
259 // Audio receiver jitter buffer (NetEq) max capacity in number of packets. 198 // Audio receiver jitter buffer (NetEq) max capacity in number of packets.
260 Settable<int> audio_jitter_buffer_max_packets; 199 rtc::Maybe<int> audio_jitter_buffer_max_packets;
261 // Audio receiver jitter buffer (NetEq) fast accelerate mode. 200 // Audio receiver jitter buffer (NetEq) fast accelerate mode.
262 Settable<bool> audio_jitter_buffer_fast_accelerate; 201 rtc::Maybe<bool> audio_jitter_buffer_fast_accelerate;
263 // Audio processing to detect typing. 202 // Audio processing to detect typing.
264 Settable<bool> typing_detection; 203 rtc::Maybe<bool> typing_detection;
265 Settable<bool> aecm_generate_comfort_noise; 204 rtc::Maybe<bool> aecm_generate_comfort_noise;
266 Settable<bool> conference_mode; 205 rtc::Maybe<bool> conference_mode;
267 Settable<int> adjust_agc_delta; 206 rtc::Maybe<int> adjust_agc_delta;
268 Settable<bool> experimental_agc; 207 rtc::Maybe<bool> experimental_agc;
269 Settable<bool> extended_filter_aec; 208 rtc::Maybe<bool> extended_filter_aec;
270 Settable<bool> delay_agnostic_aec; 209 rtc::Maybe<bool> delay_agnostic_aec;
271 Settable<bool> experimental_ns; 210 rtc::Maybe<bool> experimental_ns;
272 Settable<bool> aec_dump; 211 rtc::Maybe<bool> aec_dump;
273 // Note that tx_agc_* only applies to non-experimental AGC. 212 // Note that tx_agc_* only applies to non-experimental AGC.
274 Settable<uint16_t> tx_agc_target_dbov; 213 rtc::Maybe<uint16_t> tx_agc_target_dbov;
275 Settable<uint16_t> tx_agc_digital_compression_gain; 214 rtc::Maybe<uint16_t> tx_agc_digital_compression_gain;
276 Settable<bool> tx_agc_limiter; 215 rtc::Maybe<bool> tx_agc_limiter;
277 Settable<uint32_t> recording_sample_rate; 216 rtc::Maybe<uint32_t> recording_sample_rate;
278 Settable<uint32_t> playout_sample_rate; 217 rtc::Maybe<uint32_t> playout_sample_rate;
279 // Set DSCP value for packet sent from audio channel. 218 // Set DSCP value for packet sent from audio channel.
280 Settable<bool> dscp; 219 rtc::Maybe<bool> dscp;
281 // Enable combined audio+bandwidth BWE. 220 // Enable combined audio+bandwidth BWE.
282 Settable<bool> combined_audio_video_bwe; 221 rtc::Maybe<bool> combined_audio_video_bwe;
222
223 private:
224 template <typename T>
225 static void SetFrom(rtc::Maybe<T>* s, const rtc::Maybe<T>& o) {
226 if (o) {
227 *s = o;
228 }
229 }
283 }; 230 };
284 231
285 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. 232 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine.
286 // Used to be flags, but that makes it hard to selectively apply options. 233 // Used to be flags, but that makes it hard to selectively apply options.
287 // We are moving all of the setting of options to structs like this, 234 // We are moving all of the setting of options to structs like this,
288 // but some things currently still use flags. 235 // but some things currently still use flags.
289 struct VideoOptions { 236 struct VideoOptions {
290 VideoOptions() { 237 VideoOptions()
291 process_adaptation_threshhold.Set(kProcessCpuThreshold); 238 : process_adaptation_threshhold(kProcessCpuThreshold),
292 system_low_adaptation_threshhold.Set(kLowSystemCpuThreshold); 239 system_low_adaptation_threshhold(kLowSystemCpuThreshold),
293 system_high_adaptation_threshhold.Set(kHighSystemCpuThreshold); 240 system_high_adaptation_threshhold(kHighSystemCpuThreshold),
294 unsignalled_recv_stream_limit.Set(kNumDefaultUnsignalledVideoRecvStreams); 241 unsignalled_recv_stream_limit(kNumDefaultUnsignalledVideoRecvStreams) {}
295 }
296 242
297 void SetAll(const VideoOptions& change) { 243 void SetAll(const VideoOptions& change) {
298 adapt_input_to_cpu_usage.SetFrom(change.adapt_input_to_cpu_usage); 244 SetFrom(&adapt_input_to_cpu_usage, change.adapt_input_to_cpu_usage);
299 adapt_cpu_with_smoothing.SetFrom(change.adapt_cpu_with_smoothing); 245 SetFrom(&adapt_cpu_with_smoothing, change.adapt_cpu_with_smoothing);
300 video_adapt_third.SetFrom(change.video_adapt_third); 246 SetFrom(&video_adapt_third, change.video_adapt_third);
301 video_noise_reduction.SetFrom(change.video_noise_reduction); 247 SetFrom(&video_noise_reduction, change.video_noise_reduction);
302 video_start_bitrate.SetFrom(change.video_start_bitrate); 248 SetFrom(&video_start_bitrate, change.video_start_bitrate);
303 cpu_overuse_detection.SetFrom(change.cpu_overuse_detection); 249 SetFrom(&cpu_overuse_detection, change.cpu_overuse_detection);
304 cpu_underuse_threshold.SetFrom(change.cpu_underuse_threshold); 250 SetFrom(&cpu_underuse_threshold, change.cpu_underuse_threshold);
305 cpu_overuse_threshold.SetFrom(change.cpu_overuse_threshold); 251 SetFrom(&cpu_overuse_threshold, change.cpu_overuse_threshold);
306 cpu_underuse_encode_rsd_threshold.SetFrom( 252 SetFrom(&cpu_underuse_encode_rsd_threshold,
307 change.cpu_underuse_encode_rsd_threshold); 253 change.cpu_underuse_encode_rsd_threshold);
308 cpu_overuse_encode_rsd_threshold.SetFrom( 254 SetFrom(&cpu_overuse_encode_rsd_threshold,
309 change.cpu_overuse_encode_rsd_threshold); 255 change.cpu_overuse_encode_rsd_threshold);
310 cpu_overuse_encode_usage.SetFrom(change.cpu_overuse_encode_usage); 256 SetFrom(&cpu_overuse_encode_usage, change.cpu_overuse_encode_usage);
311 conference_mode.SetFrom(change.conference_mode); 257 SetFrom(&conference_mode, change.conference_mode);
312 process_adaptation_threshhold.SetFrom(change.process_adaptation_threshhold); 258 SetFrom(&process_adaptation_threshhold,
313 system_low_adaptation_threshhold.SetFrom( 259 change.process_adaptation_threshhold);
314 change.system_low_adaptation_threshhold); 260 SetFrom(&system_low_adaptation_threshhold,
315 system_high_adaptation_threshhold.SetFrom( 261 change.system_low_adaptation_threshhold);
316 change.system_high_adaptation_threshhold); 262 SetFrom(&system_high_adaptation_threshhold,
317 dscp.SetFrom(change.dscp); 263 change.system_high_adaptation_threshhold);
318 suspend_below_min_bitrate.SetFrom(change.suspend_below_min_bitrate); 264 SetFrom(&dscp, change.dscp);
319 unsignalled_recv_stream_limit.SetFrom(change.unsignalled_recv_stream_limit); 265 SetFrom(&suspend_below_min_bitrate, change.suspend_below_min_bitrate);
320 use_simulcast_adapter.SetFrom(change.use_simulcast_adapter); 266 SetFrom(&unsignalled_recv_stream_limit,
321 screencast_min_bitrate.SetFrom(change.screencast_min_bitrate); 267 change.unsignalled_recv_stream_limit);
268 SetFrom(&use_simulcast_adapter, change.use_simulcast_adapter);
269 SetFrom(&screencast_min_bitrate, change.screencast_min_bitrate);
322 } 270 }
323 271
324 bool operator==(const VideoOptions& o) const { 272 bool operator==(const VideoOptions& o) const {
325 return adapt_input_to_cpu_usage == o.adapt_input_to_cpu_usage && 273 return adapt_input_to_cpu_usage == o.adapt_input_to_cpu_usage &&
326 adapt_cpu_with_smoothing == o.adapt_cpu_with_smoothing && 274 adapt_cpu_with_smoothing == o.adapt_cpu_with_smoothing &&
327 video_adapt_third == o.video_adapt_third && 275 video_adapt_third == o.video_adapt_third &&
328 video_noise_reduction == o.video_noise_reduction && 276 video_noise_reduction == o.video_noise_reduction &&
329 video_start_bitrate == o.video_start_bitrate && 277 video_start_bitrate == o.video_start_bitrate &&
330 cpu_overuse_detection == o.cpu_overuse_detection && 278 cpu_overuse_detection == o.cpu_overuse_detection &&
331 cpu_underuse_threshold == o.cpu_underuse_threshold && 279 cpu_underuse_threshold == o.cpu_underuse_threshold &&
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 suspend_below_min_bitrate); 322 suspend_below_min_bitrate);
375 ost << ToStringIfSet("num channels for early receive", 323 ost << ToStringIfSet("num channels for early receive",
376 unsignalled_recv_stream_limit); 324 unsignalled_recv_stream_limit);
377 ost << ToStringIfSet("use simulcast adapter", use_simulcast_adapter); 325 ost << ToStringIfSet("use simulcast adapter", use_simulcast_adapter);
378 ost << ToStringIfSet("screencast min bitrate", screencast_min_bitrate); 326 ost << ToStringIfSet("screencast min bitrate", screencast_min_bitrate);
379 ost << "}"; 327 ost << "}";
380 return ost.str(); 328 return ost.str();
381 } 329 }
382 330
383 // Enable CPU adaptation? 331 // Enable CPU adaptation?
384 Settable<bool> adapt_input_to_cpu_usage; 332 rtc::Maybe<bool> adapt_input_to_cpu_usage;
385 // Enable CPU adaptation smoothing? 333 // Enable CPU adaptation smoothing?
386 Settable<bool> adapt_cpu_with_smoothing; 334 rtc::Maybe<bool> adapt_cpu_with_smoothing;
387 // Enable video adapt third? 335 // Enable video adapt third?
388 Settable<bool> video_adapt_third; 336 rtc::Maybe<bool> video_adapt_third;
389 // Enable denoising? 337 // Enable denoising?
390 Settable<bool> video_noise_reduction; 338 rtc::Maybe<bool> video_noise_reduction;
391 // Experimental: Enable WebRtc higher start bitrate? 339 // Experimental: Enable WebRtc higher start bitrate?
392 Settable<int> video_start_bitrate; 340 rtc::Maybe<int> video_start_bitrate;
393 // Enable WebRTC Cpu Overuse Detection, which is a new version of the CPU 341 // Enable WebRTC Cpu Overuse Detection, which is a new version of the CPU
394 // adaptation algorithm. So this option will override the 342 // adaptation algorithm. So this option will override the
395 // |adapt_input_to_cpu_usage|. 343 // |adapt_input_to_cpu_usage|.
396 Settable<bool> cpu_overuse_detection; 344 rtc::Maybe<bool> cpu_overuse_detection;
397 // Low threshold (t1) for cpu overuse adaptation. (Adapt up) 345 // Low threshold (t1) for cpu overuse adaptation. (Adapt up)
398 // Metric: encode usage (m1). m1 < t1 => underuse. 346 // Metric: encode usage (m1). m1 < t1 => underuse.
399 Settable<int> cpu_underuse_threshold; 347 rtc::Maybe<int> cpu_underuse_threshold;
400 // High threshold (t1) for cpu overuse adaptation. (Adapt down) 348 // High threshold (t1) for cpu overuse adaptation. (Adapt down)
401 // Metric: encode usage (m1). m1 > t1 => overuse. 349 // Metric: encode usage (m1). m1 > t1 => overuse.
402 Settable<int> cpu_overuse_threshold; 350 rtc::Maybe<int> cpu_overuse_threshold;
403 // Low threshold (t2) for cpu overuse adaptation. (Adapt up) 351 // Low threshold (t2) for cpu overuse adaptation. (Adapt up)
404 // Metric: relative standard deviation of encode time (m2). 352 // Metric: relative standard deviation of encode time (m2).
405 // Optional threshold. If set, (m1 < t1 && m2 < t2) => underuse. 353 // Optional threshold. If set, (m1 < t1 && m2 < t2) => underuse.
406 // Note: t2 will have no effect if t1 is not set. 354 // Note: t2 will have no effect if t1 is not set.
407 Settable<int> cpu_underuse_encode_rsd_threshold; 355 rtc::Maybe<int> cpu_underuse_encode_rsd_threshold;
408 // High threshold (t2) for cpu overuse adaptation. (Adapt down) 356 // High threshold (t2) for cpu overuse adaptation. (Adapt down)
409 // Metric: relative standard deviation of encode time (m2). 357 // Metric: relative standard deviation of encode time (m2).
410 // Optional threshold. If set, (m1 > t1 || m2 > t2) => overuse. 358 // Optional threshold. If set, (m1 > t1 || m2 > t2) => overuse.
411 // Note: t2 will have no effect if t1 is not set. 359 // Note: t2 will have no effect if t1 is not set.
412 Settable<int> cpu_overuse_encode_rsd_threshold; 360 rtc::Maybe<int> cpu_overuse_encode_rsd_threshold;
413 // Use encode usage for cpu detection. 361 // Use encode usage for cpu detection.
414 Settable<bool> cpu_overuse_encode_usage; 362 rtc::Maybe<bool> cpu_overuse_encode_usage;
415 // Use conference mode? 363 // Use conference mode?
416 Settable<bool> conference_mode; 364 rtc::Maybe<bool> conference_mode;
417 // Threshhold for process cpu adaptation. (Process limit) 365 // Threshhold for process cpu adaptation. (Process limit)
418 Settable<float> process_adaptation_threshhold; 366 rtc::Maybe<float> process_adaptation_threshhold;
419 // Low threshhold for cpu adaptation. (Adapt up) 367 // Low threshhold for cpu adaptation. (Adapt up)
420 Settable<float> system_low_adaptation_threshhold; 368 rtc::Maybe<float> system_low_adaptation_threshhold;
421 // High threshhold for cpu adaptation. (Adapt down) 369 // High threshhold for cpu adaptation. (Adapt down)
422 Settable<float> system_high_adaptation_threshhold; 370 rtc::Maybe<float> system_high_adaptation_threshhold;
423 // Set DSCP value for packet sent from video channel. 371 // Set DSCP value for packet sent from video channel.
424 Settable<bool> dscp; 372 rtc::Maybe<bool> dscp;
425 // Enable WebRTC suspension of video. No video frames will be sent when the 373 // Enable WebRTC suspension of video. No video frames will be sent when the
426 // bitrate is below the configured minimum bitrate. 374 // bitrate is below the configured minimum bitrate.
427 Settable<bool> suspend_below_min_bitrate; 375 rtc::Maybe<bool> suspend_below_min_bitrate;
428 // Limit on the number of early receive channels that can be created. 376 // Limit on the number of early receive channels that can be created.
429 Settable<int> unsignalled_recv_stream_limit; 377 rtc::Maybe<int> unsignalled_recv_stream_limit;
430 // Enable use of simulcast adapter. 378 // Enable use of simulcast adapter.
431 Settable<bool> use_simulcast_adapter; 379 rtc::Maybe<bool> use_simulcast_adapter;
432 // Force screencast to use a minimum bitrate 380 // Force screencast to use a minimum bitrate
433 Settable<int> screencast_min_bitrate; 381 rtc::Maybe<int> screencast_min_bitrate;
382
383 private:
384 template <typename T>
385 static void SetFrom(rtc::Maybe<T>* s, const rtc::Maybe<T>& o) {
386 if (o) {
387 *s = o;
388 }
389 }
434 }; 390 };
435 391
436 struct RtpHeaderExtension { 392 struct RtpHeaderExtension {
437 RtpHeaderExtension() : id(0) {} 393 RtpHeaderExtension() : id(0) {}
438 RtpHeaderExtension(const std::string& u, int i) : uri(u), id(i) {} 394 RtpHeaderExtension(const std::string& u, int i) : uri(u), id(i) {}
439 395
440 bool operator==(const RtpHeaderExtension& ext) const { 396 bool operator==(const RtpHeaderExtension& ext) const {
441 // id is a reserved word in objective-c. Therefore the id attribute has to 397 // id is a reserved word in objective-c. Therefore the id attribute has to
442 // be a fully qualified name in order to compile on IOS. 398 // be a fully qualified name in order to compile on IOS.
443 return this->id == ext.id && 399 return this->id == ext.id &&
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 // Signal when the media channel is ready to send the stream. Arguments are: 1204 // Signal when the media channel is ready to send the stream. Arguments are:
1249 // writable(bool) 1205 // writable(bool)
1250 sigslot::signal1<bool> SignalReadyToSend; 1206 sigslot::signal1<bool> SignalReadyToSend;
1251 // Signal for notifying that the remote side has closed the DataChannel. 1207 // Signal for notifying that the remote side has closed the DataChannel.
1252 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; 1208 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
1253 }; 1209 };
1254 1210
1255 } // namespace cricket 1211 } // namespace cricket
1256 1212
1257 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ 1213 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_
OLDNEW
« no previous file with comments | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | talk/media/base/videoengine_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698