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

Side by Side Diff: content/renderer/media/media_stream_video_capturer_source.cc

Issue 2807203002: Use explicit conversion to base::Optional in MSVS::GetCurrentFormatImpl implementations. (Closed)
Patch Set: Created 3 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 | « no previous file | content/renderer/media/mock_media_stream_video_source.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 // 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
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
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/mock_media_stream_video_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698