| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/media_stream_video_capturer_source.h" | 5 #include "content/renderer/media/media_stream_video_capturer_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 base::Unretained(this))); | 648 base::Unretained(this))); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void MediaStreamVideoCapturerSource::StopSourceImpl() { | 651 void MediaStreamVideoCapturerSource::StopSourceImpl() { |
| 652 source_->StopCapture(); | 652 source_->StopCapture(); |
| 653 } | 653 } |
| 654 | 654 |
| 655 base::Optional<media::VideoCaptureFormat> | 655 base::Optional<media::VideoCaptureFormat> |
| 656 MediaStreamVideoCapturerSource::GetCurrentFormatImpl() const { | 656 MediaStreamVideoCapturerSource::GetCurrentFormatImpl() const { |
| 657 DCHECK(!IsOldVideoConstraints()); | 657 DCHECK(!IsOldVideoConstraints()); |
| 658 return capture_params_.requested_format; | 658 return base::Optional<media::VideoCaptureFormat>( |
| 659 capture_params_.requested_format); |
| 659 } | 660 } |
| 660 | 661 |
| 661 void MediaStreamVideoCapturerSource::OnRunStateChanged(bool is_running) { | 662 void MediaStreamVideoCapturerSource::OnRunStateChanged(bool is_running) { |
| 662 if (is_capture_starting_) { | 663 if (is_capture_starting_) { |
| 663 OnStartDone(is_running ? MEDIA_DEVICE_OK | 664 OnStartDone(is_running ? MEDIA_DEVICE_OK |
| 664 : MEDIA_DEVICE_TRACK_START_FAILURE); | 665 : MEDIA_DEVICE_TRACK_START_FAILURE); |
| 665 is_capture_starting_ = false; | 666 is_capture_starting_ = false; |
| 666 } else if (!is_running) { | 667 } else if (!is_running) { |
| 667 StopSource(); | 668 StopSource(); |
| 668 } | 669 } |
| 669 } | 670 } |
| 670 | 671 |
| 671 const char* | 672 const char* |
| 672 MediaStreamVideoCapturerSource::GetPowerLineFrequencyForTesting() const { | 673 MediaStreamVideoCapturerSource::GetPowerLineFrequencyForTesting() const { |
| 673 return kPowerLineFrequency; | 674 return kPowerLineFrequency; |
| 674 } | 675 } |
| 675 | 676 |
| 676 } // namespace content | 677 } // namespace content |
| OLD | NEW |