| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |