Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 } | 245 } |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. | 248 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. |
| 249 // Used to be flags, but that makes it hard to selectively apply options. | 249 // Used to be flags, but that makes it hard to selectively apply options. |
| 250 // We are moving all of the setting of options to structs like this, | 250 // We are moving all of the setting of options to structs like this, |
| 251 // but some things currently still use flags. | 251 // but some things currently still use flags. |
| 252 struct VideoOptions { | 252 struct VideoOptions { |
| 253 void SetAll(const VideoOptions& change) { | 253 void SetAll(const VideoOptions& change) { |
| 254 SetFrom(&video_noise_reduction, change.video_noise_reduction); | 254 SetFrom(&video_noise_reduction, change.video_noise_reduction); |
| 255 SetFrom(&suspend_below_min_bitrate, change.suspend_below_min_bitrate); | 255 SetFrom(&suspend_below_min_bitrate, change.suspend_below_min_bitrate); |
|
perkj_webrtc
2016/02/21 18:09:06
not this cl but is suspend_below_min_bitrate and s
nisse-webrtc
2016/02/22 07:52:34
By the comment I added below, they're PeerConnecti
| |
| 256 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps); | 256 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps); |
| 257 SetFrom(&is_screencast, change.is_screencast); | |
| 257 } | 258 } |
| 258 | 259 |
| 259 bool operator==(const VideoOptions& o) const { | 260 bool operator==(const VideoOptions& o) const { |
| 260 return video_noise_reduction == o.video_noise_reduction && | 261 return video_noise_reduction == o.video_noise_reduction && |
| 261 suspend_below_min_bitrate == o.suspend_below_min_bitrate && | 262 suspend_below_min_bitrate == o.suspend_below_min_bitrate && |
| 262 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps; | 263 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps && |
| 264 is_screencast == o.is_screencast; | |
| 263 } | 265 } |
| 264 | 266 |
| 265 std::string ToString() const { | 267 std::string ToString() const { |
| 266 std::ostringstream ost; | 268 std::ostringstream ost; |
| 267 ost << "VideoOptions {"; | 269 ost << "VideoOptions {"; |
| 268 ost << ToStringIfSet("noise reduction", video_noise_reduction); | 270 ost << ToStringIfSet("noise reduction", video_noise_reduction); |
| 269 ost << ToStringIfSet("suspend below min bitrate", | 271 ost << ToStringIfSet("suspend below min bitrate", |
| 270 suspend_below_min_bitrate); | 272 suspend_below_min_bitrate); |
| 271 ost << ToStringIfSet("screencast min bitrate kbps", | 273 ost << ToStringIfSet("screencast min bitrate kbps", |
| 272 screencast_min_bitrate_kbps); | 274 screencast_min_bitrate_kbps); |
| 275 ost << ToStringIfSet("is_screencast ", is_screencast); | |
| 273 ost << "}"; | 276 ost << "}"; |
| 274 return ost.str(); | 277 return ost.str(); |
| 275 } | 278 } |
| 276 | 279 |
| 277 // Enable denoising? This flag comes from the getUserMedia | 280 // Enable denoising? This flag comes from the getUserMedia |
| 278 // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it | 281 // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it |
| 279 // on to the codec options. Disabled by default. | 282 // on to the codec options. Disabled by default. |
| 280 rtc::Optional<bool> video_noise_reduction; | 283 rtc::Optional<bool> video_noise_reduction; |
| 281 // Enable WebRTC suspension of video. No video frames will be sent | 284 // Enable WebRTC suspension of video. No video frames will be sent |
| 282 // when the bitrate is below the configured minimum bitrate. This | 285 // when the bitrate is below the configured minimum bitrate. This |
| 283 // flag comes from the PeerConnection constraint | 286 // flag comes from the PeerConnection constraint |
| 284 // 'googSuspendBelowMinBitrate', and WebRtcVideoChannel2 copies it | 287 // 'googSuspendBelowMinBitrate', and WebRtcVideoChannel2 copies it |
| 285 // to VideoSendStream::Config::suspend_below_min_bitrate. | 288 // to VideoSendStream::Config::suspend_below_min_bitrate. |
| 286 rtc::Optional<bool> suspend_below_min_bitrate; | 289 rtc::Optional<bool> suspend_below_min_bitrate; |
| 287 // Force screencast to use a minimum bitrate. This flag comes from | 290 // Force screencast to use a minimum bitrate. This flag comes from |
| 288 // the PeerConnection constraint 'googScreencastMinBitrate'. It is | 291 // the PeerConnection constraint 'googScreencastMinBitrate'. It is |
| 289 // copied to the encoder config by WebRtcVideoChannel2. | 292 // copied to the encoder config by WebRtcVideoChannel2. |
| 290 rtc::Optional<int> screencast_min_bitrate_kbps; | 293 rtc::Optional<int> screencast_min_bitrate_kbps; |
| 294 // Set by screencast sources. Implies selection of encoding settings | |
| 295 // suitable for screencast. Most likely not the right way to do | |
| 296 // things, e.g., screencast of a text document and screencast of a | |
| 297 // youtube video have different needs. | |
| 298 rtc::Optional<bool> is_screencast; | |
| 291 | 299 |
| 292 private: | 300 private: |
| 293 template <typename T> | 301 template <typename T> |
| 294 static void SetFrom(rtc::Optional<T>* s, const rtc::Optional<T>& o) { | 302 static void SetFrom(rtc::Optional<T>* s, const rtc::Optional<T>& o) { |
| 295 if (o) { | 303 if (o) { |
| 296 *s = o; | 304 *s = o; |
| 297 } | 305 } |
| 298 } | 306 } |
| 299 }; | 307 }; |
| 300 | 308 |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1107 // Signal when the media channel is ready to send the stream. Arguments are: | 1115 // Signal when the media channel is ready to send the stream. Arguments are: |
| 1108 // writable(bool) | 1116 // writable(bool) |
| 1109 sigslot::signal1<bool> SignalReadyToSend; | 1117 sigslot::signal1<bool> SignalReadyToSend; |
| 1110 // Signal for notifying that the remote side has closed the DataChannel. | 1118 // Signal for notifying that the remote side has closed the DataChannel. |
| 1111 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; | 1119 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; |
| 1112 }; | 1120 }; |
| 1113 | 1121 |
| 1114 } // namespace cricket | 1122 } // namespace cricket |
| 1115 | 1123 |
| 1116 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ | 1124 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ |
| OLD | NEW |