| 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 "media/capture/content/screen_capture_device_core.h" | 5 #include "media/capture/content/screen_capture_device_core.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 return; | 106 return; |
| 107 | 107 |
| 108 oracle_proxy_->Stop(); | 108 oracle_proxy_->Stop(); |
| 109 oracle_proxy_ = NULL; | 109 oracle_proxy_ = NULL; |
| 110 | 110 |
| 111 TransitionStateTo(kIdle); | 111 TransitionStateTo(kIdle); |
| 112 | 112 |
| 113 capture_machine_->Stop(base::Bind(&base::DoNothing)); | 113 capture_machine_->Stop(base::Bind(&base::DoNothing)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void ScreenCaptureDeviceCore::OnConsumerReportingUtilization( |
| 117 int frame_feedback_id, |
| 118 double utilization) { |
| 119 DCHECK(thread_checker_.CalledOnValidThread()); |
| 120 DCHECK(oracle_proxy_); |
| 121 oracle_proxy_->OnConsumerReportingUtilization(frame_feedback_id, utilization); |
| 122 } |
| 123 |
| 116 void ScreenCaptureDeviceCore::CaptureStarted(bool success) { | 124 void ScreenCaptureDeviceCore::CaptureStarted(bool success) { |
| 117 DCHECK(thread_checker_.CalledOnValidThread()); | 125 DCHECK(thread_checker_.CalledOnValidThread()); |
| 118 if (!success) | 126 if (!success) |
| 119 Error(FROM_HERE, "Failed to start capture machine."); | 127 Error(FROM_HERE, "Failed to start capture machine."); |
| 120 } | 128 } |
| 121 | 129 |
| 122 ScreenCaptureDeviceCore::ScreenCaptureDeviceCore( | 130 ScreenCaptureDeviceCore::ScreenCaptureDeviceCore( |
| 123 std::unique_ptr<VideoCaptureMachine> capture_machine) | 131 std::unique_ptr<VideoCaptureMachine> capture_machine) |
| 124 : state_(kIdle), capture_machine_(std::move(capture_machine)) { | 132 : state_(kIdle), capture_machine_(std::move(capture_machine)) { |
| 125 DCHECK(capture_machine_.get()); | 133 DCHECK(capture_machine_.get()); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 return; | 166 return; |
| 159 | 167 |
| 160 if (oracle_proxy_.get()) | 168 if (oracle_proxy_.get()) |
| 161 oracle_proxy_->ReportError(from_here, reason); | 169 oracle_proxy_->ReportError(from_here, reason); |
| 162 | 170 |
| 163 StopAndDeAllocate(); | 171 StopAndDeAllocate(); |
| 164 TransitionStateTo(kError); | 172 TransitionStateTo(kError); |
| 165 } | 173 } |
| 166 | 174 |
| 167 } // namespace media | 175 } // namespace media |
| OLD | NEW |