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

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

Issue 1642513002: Delete unused members from VideoOptions (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rename screencast_min_bitrate --> screencast_min_bitrate_kbps. Created 4 years, 11 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 | « talk/media/base/constants.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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 *s = o; 231 *s = o;
232 } 232 }
233 } 233 }
234 }; 234 };
235 235
236 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. 236 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine.
237 // Used to be flags, but that makes it hard to selectively apply options. 237 // Used to be flags, but that makes it hard to selectively apply options.
238 // We are moving all of the setting of options to structs like this, 238 // We are moving all of the setting of options to structs like this,
239 // but some things currently still use flags. 239 // but some things currently still use flags.
240 struct VideoOptions { 240 struct VideoOptions {
241 VideoOptions()
242 : process_adaptation_threshhold(kProcessCpuThreshold),
243 system_low_adaptation_threshhold(kLowSystemCpuThreshold),
244 system_high_adaptation_threshhold(kHighSystemCpuThreshold),
245 unsignalled_recv_stream_limit(kNumDefaultUnsignalledVideoRecvStreams) {}
246
247 void SetAll(const VideoOptions& change) { 241 void SetAll(const VideoOptions& change) {
248 SetFrom(&adapt_input_to_cpu_usage, change.adapt_input_to_cpu_usage);
249 SetFrom(&adapt_cpu_with_smoothing, change.adapt_cpu_with_smoothing);
250 SetFrom(&video_adapt_third, change.video_adapt_third);
251 SetFrom(&video_noise_reduction, change.video_noise_reduction); 242 SetFrom(&video_noise_reduction, change.video_noise_reduction);
252 SetFrom(&video_start_bitrate, change.video_start_bitrate);
253 SetFrom(&cpu_overuse_detection, change.cpu_overuse_detection); 243 SetFrom(&cpu_overuse_detection, change.cpu_overuse_detection);
254 SetFrom(&cpu_underuse_threshold, change.cpu_underuse_threshold);
255 SetFrom(&cpu_overuse_threshold, change.cpu_overuse_threshold);
256 SetFrom(&cpu_underuse_encode_rsd_threshold,
257 change.cpu_underuse_encode_rsd_threshold);
258 SetFrom(&cpu_overuse_encode_rsd_threshold,
259 change.cpu_overuse_encode_rsd_threshold);
260 SetFrom(&cpu_overuse_encode_usage, change.cpu_overuse_encode_usage);
261 SetFrom(&conference_mode, change.conference_mode); 244 SetFrom(&conference_mode, change.conference_mode);
262 SetFrom(&process_adaptation_threshhold,
263 change.process_adaptation_threshhold);
264 SetFrom(&system_low_adaptation_threshhold,
265 change.system_low_adaptation_threshhold);
266 SetFrom(&system_high_adaptation_threshhold,
267 change.system_high_adaptation_threshhold);
268 SetFrom(&dscp, change.dscp); 245 SetFrom(&dscp, change.dscp);
269 SetFrom(&suspend_below_min_bitrate, change.suspend_below_min_bitrate); 246 SetFrom(&suspend_below_min_bitrate, change.suspend_below_min_bitrate);
270 SetFrom(&unsignalled_recv_stream_limit, 247 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps);
271 change.unsignalled_recv_stream_limit);
272 SetFrom(&use_simulcast_adapter, change.use_simulcast_adapter);
273 SetFrom(&screencast_min_bitrate, change.screencast_min_bitrate);
274 SetFrom(&disable_prerenderer_smoothing, 248 SetFrom(&disable_prerenderer_smoothing,
275 change.disable_prerenderer_smoothing); 249 change.disable_prerenderer_smoothing);
276 } 250 }
277 251
278 bool operator==(const VideoOptions& o) const { 252 bool operator==(const VideoOptions& o) const {
279 return adapt_input_to_cpu_usage == o.adapt_input_to_cpu_usage && 253 return video_noise_reduction == o.video_noise_reduction &&
280 adapt_cpu_with_smoothing == o.adapt_cpu_with_smoothing &&
281 video_adapt_third == o.video_adapt_third &&
282 video_noise_reduction == o.video_noise_reduction &&
283 video_start_bitrate == o.video_start_bitrate &&
284 cpu_overuse_detection == o.cpu_overuse_detection && 254 cpu_overuse_detection == o.cpu_overuse_detection &&
285 cpu_underuse_threshold == o.cpu_underuse_threshold &&
286 cpu_overuse_threshold == o.cpu_overuse_threshold &&
287 cpu_underuse_encode_rsd_threshold ==
288 o.cpu_underuse_encode_rsd_threshold &&
289 cpu_overuse_encode_rsd_threshold ==
290 o.cpu_overuse_encode_rsd_threshold &&
291 cpu_overuse_encode_usage == o.cpu_overuse_encode_usage &&
292 conference_mode == o.conference_mode && 255 conference_mode == o.conference_mode &&
293 process_adaptation_threshhold == o.process_adaptation_threshhold &&
294 system_low_adaptation_threshhold ==
295 o.system_low_adaptation_threshhold &&
296 system_high_adaptation_threshhold ==
297 o.system_high_adaptation_threshhold &&
298 dscp == o.dscp && 256 dscp == o.dscp &&
299 suspend_below_min_bitrate == o.suspend_below_min_bitrate && 257 suspend_below_min_bitrate == o.suspend_below_min_bitrate &&
300 unsignalled_recv_stream_limit == o.unsignalled_recv_stream_limit && 258 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps &&
301 use_simulcast_adapter == o.use_simulcast_adapter &&
302 screencast_min_bitrate == o.screencast_min_bitrate &&
303 disable_prerenderer_smoothing == o.disable_prerenderer_smoothing; 259 disable_prerenderer_smoothing == o.disable_prerenderer_smoothing;
304 } 260 }
305 261
306 std::string ToString() const { 262 std::string ToString() const {
307 std::ostringstream ost; 263 std::ostringstream ost;
308 ost << "VideoOptions {"; 264 ost << "VideoOptions {";
309 ost << ToStringIfSet("cpu adaption", adapt_input_to_cpu_usage);
310 ost << ToStringIfSet("cpu adaptation smoothing", adapt_cpu_with_smoothing);
311 ost << ToStringIfSet("video adapt third", video_adapt_third);
312 ost << ToStringIfSet("noise reduction", video_noise_reduction); 265 ost << ToStringIfSet("noise reduction", video_noise_reduction);
313 ost << ToStringIfSet("start bitrate", video_start_bitrate);
314 ost << ToStringIfSet("cpu overuse detection", cpu_overuse_detection); 266 ost << ToStringIfSet("cpu overuse detection", cpu_overuse_detection);
315 ost << ToStringIfSet("cpu underuse threshold", cpu_underuse_threshold);
316 ost << ToStringIfSet("cpu overuse threshold", cpu_overuse_threshold);
317 ost << ToStringIfSet("cpu underuse encode rsd threshold",
318 cpu_underuse_encode_rsd_threshold);
319 ost << ToStringIfSet("cpu overuse encode rsd threshold",
320 cpu_overuse_encode_rsd_threshold);
321 ost << ToStringIfSet("cpu overuse encode usage",
322 cpu_overuse_encode_usage);
323 ost << ToStringIfSet("conference mode", conference_mode); 267 ost << ToStringIfSet("conference mode", conference_mode);
324 ost << ToStringIfSet("process", process_adaptation_threshhold);
325 ost << ToStringIfSet("low", system_low_adaptation_threshhold);
326 ost << ToStringIfSet("high", system_high_adaptation_threshhold);
327 ost << ToStringIfSet("dscp", dscp); 268 ost << ToStringIfSet("dscp", dscp);
328 ost << ToStringIfSet("suspend below min bitrate", 269 ost << ToStringIfSet("suspend below min bitrate",
329 suspend_below_min_bitrate); 270 suspend_below_min_bitrate);
330 ost << ToStringIfSet("num channels for early receive", 271 ost << ToStringIfSet("screencast min bitrate kbps",
331 unsignalled_recv_stream_limit); 272 screencast_min_bitrate_kbps);
332 ost << ToStringIfSet("use simulcast adapter", use_simulcast_adapter);
333 ost << ToStringIfSet("screencast min bitrate", screencast_min_bitrate);
334 ost << "}"; 273 ost << "}";
335 return ost.str(); 274 return ost.str();
336 } 275 }
337 276
338 // Enable CPU adaptation? 277 // Enable denoising? VideoSource sets this from the
339 rtc::Optional<bool> adapt_input_to_cpu_usage; 278 // MediaConstraints, and WebRtcVideoEngine2 passes it on to the
340 // Enable CPU adaptation smoothing? 279 // codec options.
pthatcher1 2016/01/28 18:27:08 I'd phrase this as "comes from a getUserMedia cons
341 rtc::Optional<bool> adapt_cpu_with_smoothing;
342 // Enable video adapt third?
343 rtc::Optional<bool> video_adapt_third;
344 // Enable denoising?
345 rtc::Optional<bool> video_noise_reduction; 280 rtc::Optional<bool> video_noise_reduction;
346 // Experimental: Enable WebRtc higher start bitrate?
347 rtc::Optional<int> video_start_bitrate;
348 // Enable WebRTC Cpu Overuse Detection, which is a new version of the CPU 281 // Enable WebRTC Cpu Overuse Detection, which is a new version of the CPU
349 // adaptation algorithm. So this option will override the 282 // adaptation algorithm. So this option will override the
350 // |adapt_input_to_cpu_usage|. 283 // |adapt_input_to_cpu_usage|. WebRtcSession sets this from the
284 // constraints. Checked in WebRtcVideoChannel2::OnLoadUpdate, where
pthatcher1 2016/01/28 18:27:08 I'd phrase this as "comes from a PeerConnection co
285 // it's passed to
286 // VideoCapturer::video_adapter()->OnCpuResolutionRequest.
351 rtc::Optional<bool> cpu_overuse_detection; 287 rtc::Optional<bool> cpu_overuse_detection;
352 // Low threshold (t1) for cpu overuse adaptation. (Adapt up) 288 // Use conference mode? VideoChannel::SetRemoteContent_w sets this
353 // Metric: encode usage (m1). m1 < t1 => underuse. 289 // from the MediaContentDescription. Used only by conference mode
pthatcher1 2016/01/28 18:27:08 I'd phrase this as "comes from the remote descript
354 rtc::Optional<int> cpu_underuse_threshold; 290 // screencast logic in
355 // High threshold (t1) for cpu overuse adaptation. (Adapt down) 291 // WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoderConfig.
356 // Metric: encode usage (m1). m1 > t1 => overuse.
357 rtc::Optional<int> cpu_overuse_threshold;
358 // Low threshold (t2) for cpu overuse adaptation. (Adapt up)
359 // Metric: relative standard deviation of encode time (m2).
360 // Optional threshold. If set, (m1 < t1 && m2 < t2) => underuse.
361 // Note: t2 will have no effect if t1 is not set.
362 rtc::Optional<int> cpu_underuse_encode_rsd_threshold;
363 // High threshold (t2) for cpu overuse adaptation. (Adapt down)
364 // Metric: relative standard deviation of encode time (m2).
365 // Optional threshold. If set, (m1 > t1 || m2 > t2) => overuse.
366 // Note: t2 will have no effect if t1 is not set.
367 rtc::Optional<int> cpu_overuse_encode_rsd_threshold;
368 // Use encode usage for cpu detection.
369 rtc::Optional<bool> cpu_overuse_encode_usage;
370 // Use conference mode?
371 rtc::Optional<bool> conference_mode; 292 rtc::Optional<bool> conference_mode;
372 // Threshhold for process cpu adaptation. (Process limit) 293 // Set DSCP value for packet sent from video channel. WebRtcSession
373 rtc::Optional<float> process_adaptation_threshhold; 294 // sets this from the constraints. WebRtcVideoChannel2::SetOptions
pthatcher1 2016/01/28 18:27:09 I'd phrase this as "comes from PeerConnection cons
374 // Low threshhold for cpu adaptation. (Adapt up) 295 // uses it to select value for MediaChannel::SetDscp.
375 rtc::Optional<float> system_low_adaptation_threshhold;
376 // High threshhold for cpu adaptation. (Adapt down)
377 rtc::Optional<float> system_high_adaptation_threshhold;
378 // Set DSCP value for packet sent from video channel.
379 rtc::Optional<bool> dscp; 296 rtc::Optional<bool> dscp;
380 // Enable WebRTC suspension of video. No video frames will be sent when the 297 // Enable WebRTC suspension of video. No video frames will be sent when the
381 // bitrate is below the configured minimum bitrate. 298 // bitrate is below the configured minimum bitrate.
299 // WebRtcSession sets this from the constraints. WebRtcVideoChannel2
pthatcher1 2016/01/28 18:27:08 I'd phrase this as "comes from PeerConnection cons
300 // copies it to VideoSendStream::Config::suspend_below_min_bitrate.
382 rtc::Optional<bool> suspend_below_min_bitrate; 301 rtc::Optional<bool> suspend_below_min_bitrate;
383 // Limit on the number of early receive channels that can be created. 302 // Force screencast to use a minimum bitrate. WebRtcSession sets
384 rtc::Optional<int> unsignalled_recv_stream_limit; 303 // this from the constraints. Copied to the encoder config by
pthatcher1 2016/01/28 18:27:08 I'd phrase this as "... comes from PeerConnection
385 // Enable use of simulcast adapter. 304 // WebRtcVideoChannel2.
386 rtc::Optional<bool> use_simulcast_adapter; 305 rtc::Optional<int> screencast_min_bitrate_kbps;
387 // Force screencast to use a minimum bitrate
388 rtc::Optional<int> screencast_min_bitrate;
389 // Set to true if the renderer has an algorithm of frame selection. 306 // Set to true if the renderer has an algorithm of frame selection.
390 // If the value is true, then WebRTC will hand over a frame as soon as 307 // If the value is true, then WebRTC will hand over a frame as soon as
391 // possible without delay, and rendering smoothness is completely the duty 308 // possible without delay, and rendering smoothness is completely the duty
392 // of the renderer; 309 // of the renderer;
393 // If the value is false, then WebRTC is responsible to delay frame release 310 // If the value is false, then WebRTC is responsible to delay frame release
394 // in order to increase rendering smoothness. 311 // in order to increase rendering smoothness.
312 //
313 // WebRtcSession sets this from the RTCConfiguration.
pthatcher1 2016/01/28 18:27:09 I'd phrase this as "comes from PeerConnection's Rt
314 // WebRtcVideoChannel2::AddRecvStream copies it to created
315 // WebRtcVideoReceiveStream, where it is returned by the
316 // SmoothsRenderedFrames method. This method is used by the
317 // VideoReceiveStream, where the value is passed on to the
318 // IncomingVideoStream constructor.
395 rtc::Optional<bool> disable_prerenderer_smoothing; 319 rtc::Optional<bool> disable_prerenderer_smoothing;
396 320
397 private: 321 private:
398 template <typename T> 322 template <typename T>
399 static void SetFrom(rtc::Optional<T>* s, const rtc::Optional<T>& o) { 323 static void SetFrom(rtc::Optional<T>* s, const rtc::Optional<T>& o) {
400 if (o) { 324 if (o) {
401 *s = o; 325 *s = o;
402 } 326 }
403 } 327 }
404 }; 328 };
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 // Signal when the media channel is ready to send the stream. Arguments are: 1132 // Signal when the media channel is ready to send the stream. Arguments are:
1209 // writable(bool) 1133 // writable(bool)
1210 sigslot::signal1<bool> SignalReadyToSend; 1134 sigslot::signal1<bool> SignalReadyToSend;
1211 // Signal for notifying that the remote side has closed the DataChannel. 1135 // Signal for notifying that the remote side has closed the DataChannel.
1212 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; 1136 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
1213 }; 1137 };
1214 1138
1215 } // namespace cricket 1139 } // namespace cricket
1216 1140
1217 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ 1141 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_
OLDNEW
« no previous file with comments | « talk/media/base/constants.cc ('k') | talk/media/base/videoengine_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698