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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 double utilization) { | 129 double utilization) { |
130 DCHECK(thread_checker_.CalledOnValidThread()); | 130 DCHECK(thread_checker_.CalledOnValidThread()); |
131 DCHECK(oracle_proxy_); | 131 DCHECK(oracle_proxy_); |
132 oracle_proxy_->OnConsumerReportingUtilization(frame_feedback_id, utilization); | 132 oracle_proxy_->OnConsumerReportingUtilization(frame_feedback_id, utilization); |
133 } | 133 } |
134 | 134 |
135 void ScreenCaptureDeviceCore::CaptureStarted(bool success) { | 135 void ScreenCaptureDeviceCore::CaptureStarted(bool success) { |
136 DCHECK(thread_checker_.CalledOnValidThread()); | 136 DCHECK(thread_checker_.CalledOnValidThread()); |
137 if (!success) | 137 if (!success) |
138 Error(FROM_HERE, "Failed to start capture machine."); | 138 Error(FROM_HERE, "Failed to start capture machine."); |
| 139 else if (oracle_proxy_) |
| 140 oracle_proxy_->ReportStarted(); |
139 } | 141 } |
140 | 142 |
141 ScreenCaptureDeviceCore::ScreenCaptureDeviceCore( | 143 ScreenCaptureDeviceCore::ScreenCaptureDeviceCore( |
142 std::unique_ptr<VideoCaptureMachine> capture_machine) | 144 std::unique_ptr<VideoCaptureMachine> capture_machine) |
143 : state_(kIdle), | 145 : state_(kIdle), |
144 capture_machine_(std::move(capture_machine)), | 146 capture_machine_(std::move(capture_machine)), |
145 force_active_refresh_once_(false) { | 147 force_active_refresh_once_(false) { |
146 DCHECK(capture_machine_.get()); | 148 DCHECK(capture_machine_.get()); |
147 } | 149 } |
148 | 150 |
(...skipping 22 matching lines...) Expand all Loading... |
171 state_ = next_state; | 173 state_ = next_state; |
172 } | 174 } |
173 | 175 |
174 void ScreenCaptureDeviceCore::Error(const tracked_objects::Location& from_here, | 176 void ScreenCaptureDeviceCore::Error(const tracked_objects::Location& from_here, |
175 const std::string& reason) { | 177 const std::string& reason) { |
176 DCHECK(thread_checker_.CalledOnValidThread()); | 178 DCHECK(thread_checker_.CalledOnValidThread()); |
177 | 179 |
178 if (state_ == kIdle) | 180 if (state_ == kIdle) |
179 return; | 181 return; |
180 | 182 |
181 if (oracle_proxy_.get()) | 183 if (oracle_proxy_) |
182 oracle_proxy_->ReportError(from_here, reason); | 184 oracle_proxy_->ReportError(from_here, reason); |
183 | 185 |
184 StopAndDeAllocate(); | 186 StopAndDeAllocate(); |
185 TransitionStateTo(kError); | 187 TransitionStateTo(kError); |
186 } | 188 } |
187 | 189 |
188 } // namespace media | 190 } // namespace media |
OLD | NEW |