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

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

Issue 1711763003: New flag is_screencast in VideoOptions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix OnLoadUpdate is_screencast check. Don't set FakeVideoCapturer into screencast mode in the video… 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
« no previous file with comments | « webrtc/media/base/fakevideocapturer.h ('k') | webrtc/media/base/videocapturer_unittest.cc » ('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) 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 }; 251 };
252 252
253 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. 253 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine.
254 // 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.
255 // 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,
256 // but some things currently still use flags. 256 // but some things currently still use flags.
257 struct VideoOptions { 257 struct VideoOptions {
258 void SetAll(const VideoOptions& change) { 258 void SetAll(const VideoOptions& change) {
259 SetFrom(&video_noise_reduction, change.video_noise_reduction); 259 SetFrom(&video_noise_reduction, change.video_noise_reduction);
260 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps); 260 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps);
261 SetFrom(&is_screencast, change.is_screencast);
261 } 262 }
262 263
263 bool operator==(const VideoOptions& o) const { 264 bool operator==(const VideoOptions& o) const {
264 return video_noise_reduction == o.video_noise_reduction && 265 return video_noise_reduction == o.video_noise_reduction &&
265 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps; 266 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps &&
267 is_screencast == o.is_screencast;
266 } 268 }
267 269
268 std::string ToString() const { 270 std::string ToString() const {
269 std::ostringstream ost; 271 std::ostringstream ost;
270 ost << "VideoOptions {"; 272 ost << "VideoOptions {";
271 ost << ToStringIfSet("noise reduction", video_noise_reduction); 273 ost << ToStringIfSet("noise reduction", video_noise_reduction);
272 ost << ToStringIfSet("screencast min bitrate kbps", 274 ost << ToStringIfSet("screencast min bitrate kbps",
273 screencast_min_bitrate_kbps); 275 screencast_min_bitrate_kbps);
276 ost << ToStringIfSet("is_screencast ", is_screencast);
274 ost << "}"; 277 ost << "}";
275 return ost.str(); 278 return ost.str();
276 } 279 }
277 280
278 // Enable denoising? This flag comes from the getUserMedia 281 // Enable denoising? This flag comes from the getUserMedia
279 // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it 282 // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it
280 // on to the codec options. Disabled by default. 283 // on to the codec options. Disabled by default.
281 rtc::Optional<bool> video_noise_reduction; 284 rtc::Optional<bool> video_noise_reduction;
282 // Force screencast to use a minimum bitrate. This flag comes from 285 // Force screencast to use a minimum bitrate. This flag comes from
283 // the PeerConnection constraint 'googScreencastMinBitrate'. It is 286 // the PeerConnection constraint 'googScreencastMinBitrate'. It is
284 // copied to the encoder config by WebRtcVideoChannel2. 287 // copied to the encoder config by WebRtcVideoChannel2.
285 rtc::Optional<int> screencast_min_bitrate_kbps; 288 rtc::Optional<int> screencast_min_bitrate_kbps;
289 // Set by screencast sources. Implies selection of encoding settings
290 // suitable for screencast. Most likely not the right way to do
291 // things, e.g., screencast of a text document and screencast of a
292 // youtube video have different needs.
293 rtc::Optional<bool> is_screencast;
286 294
287 private: 295 private:
288 template <typename T> 296 template <typename T>
289 static void SetFrom(rtc::Optional<T>* s, const rtc::Optional<T>& o) { 297 static void SetFrom(rtc::Optional<T>* s, const rtc::Optional<T>& o) {
290 if (o) { 298 if (o) {
291 *s = o; 299 *s = o;
292 } 300 }
293 } 301 }
294 }; 302 };
295 303
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 // Signal when the media channel is ready to send the stream. Arguments are: 1110 // Signal when the media channel is ready to send the stream. Arguments are:
1103 // writable(bool) 1111 // writable(bool)
1104 sigslot::signal1<bool> SignalReadyToSend; 1112 sigslot::signal1<bool> SignalReadyToSend;
1105 // Signal for notifying that the remote side has closed the DataChannel. 1113 // Signal for notifying that the remote side has closed the DataChannel.
1106 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; 1114 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
1107 }; 1115 };
1108 1116
1109 } // namespace cricket 1117 } // namespace cricket
1110 1118
1111 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ 1119 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/fakevideocapturer.h ('k') | webrtc/media/base/videocapturer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698