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/thread_safe_capture_oracle.h" | 5 #include "media/capture/content/thread_safe_capture_oracle.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 base::AutoLock guard(lock_); | 138 base::AutoLock guard(lock_); |
139 VLOG(1) << "Source size changed to " << source_size.ToString(); | 139 VLOG(1) << "Source size changed to " << source_size.ToString(); |
140 oracle_.SetSourceSize(source_size); | 140 oracle_.SetSourceSize(source_size); |
141 } | 141 } |
142 | 142 |
143 void ThreadSafeCaptureOracle::Stop() { | 143 void ThreadSafeCaptureOracle::Stop() { |
144 base::AutoLock guard(lock_); | 144 base::AutoLock guard(lock_); |
145 client_.reset(); | 145 client_.reset(); |
146 } | 146 } |
147 | 147 |
148 void ThreadSafeCaptureOracle::ReportError(const std::string& reason) { | 148 void ThreadSafeCaptureOracle::ReportError( |
| 149 const tracked_objects::Location& from_here, |
| 150 const std::string& reason) { |
149 base::AutoLock guard(lock_); | 151 base::AutoLock guard(lock_); |
150 if (client_) | 152 if (client_) |
151 client_->OnError(reason); | 153 client_->OnError(from_here, reason); |
152 } | 154 } |
153 | 155 |
154 void ThreadSafeCaptureOracle::DidCaptureFrame( | 156 void ThreadSafeCaptureOracle::DidCaptureFrame( |
155 int frame_number, | 157 int frame_number, |
156 scoped_ptr<VideoCaptureDevice::Client::Buffer> buffer, | 158 scoped_ptr<VideoCaptureDevice::Client::Buffer> buffer, |
157 base::TimeTicks capture_begin_time, | 159 base::TimeTicks capture_begin_time, |
158 base::TimeDelta estimated_frame_duration, | 160 base::TimeDelta estimated_frame_duration, |
159 const scoped_refptr<VideoFrame>& frame, | 161 const scoped_refptr<VideoFrame>& frame, |
160 base::TimeTicks timestamp, | 162 base::TimeTicks timestamp, |
161 bool success) { | 163 bool success) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // destructor. |metadata| is still valid for read-access at this point. | 196 // destructor. |metadata| is still valid for read-access at this point. |
195 double utilization = -1.0; | 197 double utilization = -1.0; |
196 if (metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, | 198 if (metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, |
197 &utilization)) { | 199 &utilization)) { |
198 base::AutoLock guard(lock_); | 200 base::AutoLock guard(lock_); |
199 oracle_.RecordConsumerFeedback(frame_number, utilization); | 201 oracle_.RecordConsumerFeedback(frame_number, utilization); |
200 } | 202 } |
201 } | 203 } |
202 | 204 |
203 } // namespace media | 205 } // namespace media |
OLD | NEW |