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

Side by Side Diff: webrtc/api/videocapturertracksource.cc

Issue 1842073002: Change VideoSourceInterface::needs_denoising() to return rtc::Optional<bool> (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 8 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/api/videocapturertracksource.h ('k') | webrtc/api/videocapturertracksource_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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 best_it = it; 233 best_it = it;
234 } 234 }
235 } 235 }
236 return *best_it; 236 return *best_it;
237 } 237 }
238 238
239 // Set |option| to the highest-priority value of |key| in the constraints. 239 // Set |option| to the highest-priority value of |key| in the constraints.
240 // Return false if the key is mandatory, and the value is invalid. 240 // Return false if the key is mandatory, and the value is invalid.
241 bool ExtractOption(const MediaConstraintsInterface* all_constraints, 241 bool ExtractOption(const MediaConstraintsInterface* all_constraints,
242 const std::string& key, 242 const std::string& key,
243 bool* option) { 243 rtc::Optional<bool>* option) {
244 size_t mandatory = 0; 244 size_t mandatory = 0;
245 *option = false; 245 bool value;
246 if (FindConstraint(all_constraints, key, option, &mandatory)) { 246 if (FindConstraint(all_constraints, key, &value, &mandatory)) {
247 *option = rtc::Optional<bool>(value);
247 return true; 248 return true;
248 } 249 }
249 250
250 return mandatory == 0; 251 return mandatory == 0;
251 } 252 }
252 253
253 } // anonymous namespace 254 } // anonymous namespace
254 255
255 namespace webrtc { 256 namespace webrtc {
256 257
(...skipping 24 matching lines...) Expand all
281 return source; 282 return source;
282 } 283 }
283 284
284 VideoCapturerTrackSource::VideoCapturerTrackSource( 285 VideoCapturerTrackSource::VideoCapturerTrackSource(
285 rtc::Thread* worker_thread, 286 rtc::Thread* worker_thread,
286 cricket::VideoCapturer* capturer, 287 cricket::VideoCapturer* capturer,
287 bool remote) 288 bool remote)
288 : VideoTrackSource(capturer, worker_thread, remote), 289 : VideoTrackSource(capturer, worker_thread, remote),
289 signaling_thread_(rtc::Thread::Current()), 290 signaling_thread_(rtc::Thread::Current()),
290 video_capturer_(capturer), 291 video_capturer_(capturer),
291 started_(false), 292 started_(false) {
292 needs_denoising_(false) {
293 video_capturer_->SignalStateChange.connect( 293 video_capturer_->SignalStateChange.connect(
294 this, &VideoCapturerTrackSource::OnStateChange); 294 this, &VideoCapturerTrackSource::OnStateChange);
295 } 295 }
296 296
297 VideoCapturerTrackSource::~VideoCapturerTrackSource() { 297 VideoCapturerTrackSource::~VideoCapturerTrackSource() {
298 video_capturer_->SignalStateChange.disconnect(this); 298 video_capturer_->SignalStateChange.disconnect(this);
299 Stop(); 299 Stop();
300 } 300 }
301 301
302 void VideoCapturerTrackSource::Initialize( 302 void VideoCapturerTrackSource::Initialize(
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 this, capturer, capture_state)); 392 this, capturer, capture_state));
393 return; 393 return;
394 } 394 }
395 395
396 if (capturer == video_capturer_.get()) { 396 if (capturer == video_capturer_.get()) {
397 SetState(GetReadyState(capture_state)); 397 SetState(GetReadyState(capture_state));
398 } 398 }
399 } 399 }
400 400
401 } // namespace webrtc 401 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/videocapturertracksource.h ('k') | webrtc/api/videocapturertracksource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698