| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/rtc_video_capturer.h" | 5 #include "content/renderer/media/rtc_video_capturer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 DVLOG(3) << " RtcVideoCapturer::Start "; | 28 DVLOG(3) << " RtcVideoCapturer::Start "; |
| 29 if (state_ == VIDEO_CAPTURE_STATE_STARTED) { | 29 if (state_ == VIDEO_CAPTURE_STATE_STARTED) { |
| 30 DVLOG(1) << "Got a StartCapture when already started!!! "; | 30 DVLOG(1) << "Got a StartCapture when already started!!! "; |
| 31 return cricket::CS_FAILED; | 31 return cricket::CS_FAILED; |
| 32 } | 32 } |
| 33 | 33 |
| 34 media::VideoCaptureCapability cap; | 34 media::VideoCaptureCapability cap; |
| 35 cap.width = capture_format.width; | 35 cap.width = capture_format.width; |
| 36 cap.height = capture_format.height; | 36 cap.height = capture_format.height; |
| 37 cap.frame_rate = capture_format.framerate(); | 37 cap.frame_rate = capture_format.framerate(); |
| 38 cap.color = media::VideoCaptureCapability::kI420; | 38 cap.color = media::kI420; |
| 39 | 39 |
| 40 SetCaptureFormat(&capture_format); | 40 SetCaptureFormat(&capture_format); |
| 41 | 41 |
| 42 state_ = VIDEO_CAPTURE_STATE_STARTED; | 42 state_ = VIDEO_CAPTURE_STATE_STARTED; |
| 43 start_time_ = base::Time::Now(); | 43 start_time_ = base::Time::Now(); |
| 44 delegate_->StartCapture(cap, | 44 delegate_->StartCapture(cap, |
| 45 base::Bind(&RtcVideoCapturer::OnFrameCaptured, base::Unretained(this)), | 45 base::Bind(&RtcVideoCapturer::OnFrameCaptured, base::Unretained(this)), |
| 46 base::Bind(&RtcVideoCapturer::OnStateChange, base::Unretained(this))); | 46 base::Bind(&RtcVideoCapturer::OnStateChange, base::Unretained(this))); |
| 47 // Update the desired aspect ratio so that later the video frame can be | 47 // Update the desired aspect ratio so that later the video frame can be |
| 48 // cropped to meet the requirement if the camera returns a different | 48 // cropped to meet the requirement if the camera returns a different |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 converted_state = cricket::CS_FAILED; | 144 converted_state = cricket::CS_FAILED; |
| 145 break; | 145 break; |
| 146 default: | 146 default: |
| 147 NOTREACHED(); | 147 NOTREACHED(); |
| 148 break; | 148 break; |
| 149 } | 149 } |
| 150 SignalStateChange(this, converted_state); | 150 SignalStateChange(this, converted_state); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace content | 153 } // namespace content |
| OLD | NEW |