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

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

Issue 1745003002: Move suspend_below_min_bitrate from VideoOptions to MediaConfig. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 // Construction-time settings, passed to 82 // Construction-time settings, passed to
83 // MediaControllerInterface::Create, and passed on when creating 83 // MediaControllerInterface::Create, and passed on when creating
84 // MediaChannels. 84 // MediaChannels.
85 struct MediaConfig { 85 struct MediaConfig {
86 // Set DSCP value on packets. This flag comes from the 86 // Set DSCP value on packets. This flag comes from the
87 // PeerConnection constraint 'googDscp'. 87 // PeerConnection constraint 'googDscp'.
88 bool enable_dscp = false; 88 bool enable_dscp = false;
89 89
90 // Video-specific config 90 // Video-specific config.
91 struct Video {
92 // Enable WebRTC CPU Overuse Detection. This flag comes from the
93 // PeerConnection constraint 'googCpuOveruseDetection' and is
94 // checked in WebRtcVideoChannel2::OnLoadUpdate, where it's passed
95 // to VideoCapturer::video_adapter()->OnCpuResolutionRequest.
96 bool enable_cpu_overuse_detection = true;
91 97
92 // Enable WebRTC CPU Overuse Detection. This flag comes from the 98 // Enable WebRTC suspension of video. No video frames will be sent
93 // PeerConnection constraint 'googCpuOveruseDetection' and is 99 // when the bitrate is below the configured minimum bitrate. This
94 // checked in WebRtcVideoChannel2::OnLoadUpdate, where it's passed 100 // flag comes from the PeerConnection constraint
95 // to VideoCapturer::video_adapter()->OnCpuResolutionRequest. 101 // 'googSuspendBelowMinBitrate', and WebRtcVideoChannel2 copies it
96 bool enable_cpu_overuse_detection = true; 102 // to VideoSendStream::Config::suspend_below_min_bitrate.
103 bool suspend_below_min_bitrate = false;
97 104
98 // Set to true if the renderer has an algorithm of frame selection. 105 // Set to true if the renderer has an algorithm of frame selection.
99 // If the value is true, then WebRTC will hand over a frame as soon as 106 // If the value is true, then WebRTC will hand over a frame as soon as
100 // possible without delay, and rendering smoothness is completely the duty 107 // possible without delay, and rendering smoothness is completely the duty
101 // of the renderer; 108 // of the renderer;
102 // If the value is false, then WebRTC is responsible to delay frame release 109 // If the value is false, then WebRTC is responsible to delay frame release
103 // in order to increase rendering smoothness. 110 // in order to increase rendering smoothness.
104 // 111 //
105 // This flag comes from PeerConnection's RtcConfiguration, but is 112 // This flag comes from PeerConnection's RtcConfiguration, but is
106 // currently only set by the command line flag 113 // currently only set by the command line flag
107 // 'disable-rtc-smoothness-algorithm'. 114 // 'disable-rtc-smoothness-algorithm'.
108 // WebRtcVideoChannel2::AddRecvStream copies it to the created 115 // WebRtcVideoChannel2::AddRecvStream copies it to the created
109 // WebRtcVideoReceiveStream, where it is returned by the 116 // WebRtcVideoReceiveStream, where it is returned by the
110 // SmoothsRenderedFrames method. This method is used by the 117 // SmoothsRenderedFrames method. This method is used by the
111 // VideoReceiveStream, where the value is passed on to the 118 // VideoReceiveStream, where the value is passed on to the
112 // IncomingVideoStream constructor. 119 // IncomingVideoStream constructor.
113 bool disable_prerenderer_smoothing = false; 120 bool disable_prerenderer_smoothing = false;
121 } video;
114 }; 122 };
115 123
116 // Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine. 124 // Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine.
117 // Used to be flags, but that makes it hard to selectively apply options. 125 // Used to be flags, but that makes it hard to selectively apply options.
118 // We are moving all of the setting of options to structs like this, 126 // We are moving all of the setting of options to structs like this,
119 // but some things currently still use flags. 127 // but some things currently still use flags.
120 struct AudioOptions { 128 struct AudioOptions {
121 void SetAll(const AudioOptions& change) { 129 void SetAll(const AudioOptions& change) {
122 SetFrom(&echo_cancellation, change.echo_cancellation); 130 SetFrom(&echo_cancellation, change.echo_cancellation);
123 SetFrom(&auto_gain_control, change.auto_gain_control); 131 SetFrom(&auto_gain_control, change.auto_gain_control);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 250 }
243 }; 251 };
244 252
245 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. 253 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine.
246 // Used to be flags, but that makes it hard to selectively apply options. 254 // Used to be flags, but that makes it hard to selectively apply options.
247 // We are moving all of the setting of options to structs like this, 255 // We are moving all of the setting of options to structs like this,
248 // but some things currently still use flags. 256 // but some things currently still use flags.
249 struct VideoOptions { 257 struct VideoOptions {
250 void SetAll(const VideoOptions& change) { 258 void SetAll(const VideoOptions& change) {
251 SetFrom(&video_noise_reduction, change.video_noise_reduction); 259 SetFrom(&video_noise_reduction, change.video_noise_reduction);
252 SetFrom(&suspend_below_min_bitrate, change.suspend_below_min_bitrate);
253 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps); 260 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps);
254 } 261 }
255 262
256 bool operator==(const VideoOptions& o) const { 263 bool operator==(const VideoOptions& o) const {
257 return video_noise_reduction == o.video_noise_reduction && 264 return video_noise_reduction == o.video_noise_reduction &&
258 suspend_below_min_bitrate == o.suspend_below_min_bitrate &&
259 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps; 265 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps;
260 } 266 }
261 267
262 std::string ToString() const { 268 std::string ToString() const {
263 std::ostringstream ost; 269 std::ostringstream ost;
264 ost << "VideoOptions {"; 270 ost << "VideoOptions {";
265 ost << ToStringIfSet("noise reduction", video_noise_reduction); 271 ost << ToStringIfSet("noise reduction", video_noise_reduction);
266 ost << ToStringIfSet("suspend below min bitrate",
267 suspend_below_min_bitrate);
268 ost << ToStringIfSet("screencast min bitrate kbps", 272 ost << ToStringIfSet("screencast min bitrate kbps",
269 screencast_min_bitrate_kbps); 273 screencast_min_bitrate_kbps);
270 ost << "}"; 274 ost << "}";
271 return ost.str(); 275 return ost.str();
272 } 276 }
273 277
274 // Enable denoising? This flag comes from the getUserMedia 278 // Enable denoising? This flag comes from the getUserMedia
275 // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it 279 // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it
276 // on to the codec options. Disabled by default. 280 // on to the codec options. Disabled by default.
277 rtc::Optional<bool> video_noise_reduction; 281 rtc::Optional<bool> video_noise_reduction;
278 // Enable WebRTC suspension of video. No video frames will be sent
279 // when the bitrate is below the configured minimum bitrate. This
280 // flag comes from the PeerConnection constraint
281 // 'googSuspendBelowMinBitrate', and WebRtcVideoChannel2 copies it
282 // to VideoSendStream::Config::suspend_below_min_bitrate.
283 rtc::Optional<bool> suspend_below_min_bitrate;
284 // Force screencast to use a minimum bitrate. This flag comes from 282 // Force screencast to use a minimum bitrate. This flag comes from
285 // the PeerConnection constraint 'googScreencastMinBitrate'. It is 283 // the PeerConnection constraint 'googScreencastMinBitrate'. It is
286 // copied to the encoder config by WebRtcVideoChannel2. 284 // copied to the encoder config by WebRtcVideoChannel2.
287 rtc::Optional<int> screencast_min_bitrate_kbps; 285 rtc::Optional<int> screencast_min_bitrate_kbps;
288 286
289 private: 287 private:
290 template <typename T> 288 template <typename T>
291 static void SetFrom(rtc::Optional<T>* s, const rtc::Optional<T>& o) { 289 static void SetFrom(rtc::Optional<T>* s, const rtc::Optional<T>& o) {
292 if (o) { 290 if (o) {
293 *s = o; 291 *s = o;
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 // Signal when the media channel is ready to send the stream. Arguments are: 1102 // Signal when the media channel is ready to send the stream. Arguments are:
1105 // writable(bool) 1103 // writable(bool)
1106 sigslot::signal1<bool> SignalReadyToSend; 1104 sigslot::signal1<bool> SignalReadyToSend;
1107 // Signal for notifying that the remote side has closed the DataChannel. 1105 // Signal for notifying that the remote side has closed the DataChannel.
1108 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; 1106 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
1109 }; 1107 };
1110 1108
1111 } // namespace cricket 1109 } // namespace cricket
1112 1110
1113 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ 1111 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698