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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 formats.push_back(cricket::VideoFormat(kDefaultFormat)); | 313 formats.push_back(cricket::VideoFormat(kDefaultFormat)); |
314 } else { | 314 } else { |
315 // The VideoCapturer implementation doesn't support capability | 315 // The VideoCapturer implementation doesn't support capability |
316 // enumeration. We need to guess what the camera supports. | 316 // enumeration. We need to guess what the camera supports. |
317 for (uint32_t i = 0; i < arraysize(kVideoFormats); ++i) { | 317 for (uint32_t i = 0; i < arraysize(kVideoFormats); ++i) { |
318 formats.push_back(cricket::VideoFormat(kVideoFormats[i])); | 318 formats.push_back(cricket::VideoFormat(kVideoFormats[i])); |
319 } | 319 } |
320 } | 320 } |
321 } | 321 } |
322 | 322 |
323 // Get default from the capturer, overridden by constraints, if any. | |
324 needs_denoising_ = video_capturer_->NeedsDenoising(); | |
325 | |
326 if (constraints) { | 323 if (constraints) { |
327 MediaConstraintsInterface::Constraints mandatory_constraints = | 324 MediaConstraintsInterface::Constraints mandatory_constraints = |
328 constraints->GetMandatory(); | 325 constraints->GetMandatory(); |
329 MediaConstraintsInterface::Constraints optional_constraints; | 326 MediaConstraintsInterface::Constraints optional_constraints; |
330 optional_constraints = constraints->GetOptional(); | 327 optional_constraints = constraints->GetOptional(); |
331 | 328 |
332 if (video_capturer_->IsScreencast()) { | 329 if (video_capturer_->IsScreencast()) { |
333 // Use the maxWidth and maxHeight allowed by constraints for screencast. | 330 // Use the maxWidth and maxHeight allowed by constraints for screencast. |
334 FromConstraintsForScreencast(mandatory_constraints, &(formats[0])); | 331 FromConstraintsForScreencast(mandatory_constraints, &(formats[0])); |
335 } | 332 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 capture_state)); | 387 capture_state)); |
391 return; | 388 return; |
392 } | 389 } |
393 | 390 |
394 if (capturer == video_capturer_.get()) { | 391 if (capturer == video_capturer_.get()) { |
395 SetState(GetReadyState(capture_state)); | 392 SetState(GetReadyState(capture_state)); |
396 } | 393 } |
397 } | 394 } |
398 | 395 |
399 } // namespace webrtc | 396 } // namespace webrtc |
OLD | NEW |