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 // Notes about usage of this object by VideoCaptureImplManager. | 5 // Notes about usage of this object by VideoCaptureImplManager. |
6 // | 6 // |
7 // VideoCaptureImplManager access this object by using a Unretained() | 7 // VideoCaptureImplManager access this object by using a Unretained() |
8 // binding and tasks on the IO thread. It is then important that | 8 // binding and tasks on the IO thread. It is then important that |
9 // VideoCaptureImpl never post task to itself. All operations must be | 9 // VideoCaptureImpl never post task to itself. All operations must be |
10 // synchronous. | 10 // synchronous. |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 if (clients_.empty()) { | 211 if (clients_.empty()) { |
212 DVLOG(1) << "StopCapture: No more client, stopping ..."; | 212 DVLOG(1) << "StopCapture: No more client, stopping ..."; |
213 StopDevice(); | 213 StopDevice(); |
214 client_buffers_.clear(); | 214 client_buffers_.clear(); |
215 client_buffer2s_.clear(); | 215 client_buffer2s_.clear(); |
216 weak_factory_.InvalidateWeakPtrs(); | 216 weak_factory_.InvalidateWeakPtrs(); |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
| 220 void VideoCaptureImpl::RequestRefreshFrame() { |
| 221 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 222 Send(new VideoCaptureHostMsg_RequestRefreshFrame(device_id_)); |
| 223 } |
| 224 |
220 void VideoCaptureImpl::GetDeviceSupportedFormats( | 225 void VideoCaptureImpl::GetDeviceSupportedFormats( |
221 const VideoCaptureDeviceFormatsCB& callback) { | 226 const VideoCaptureDeviceFormatsCB& callback) { |
222 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 227 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
223 device_formats_cb_queue_.push_back(callback); | 228 device_formats_cb_queue_.push_back(callback); |
224 if (device_formats_cb_queue_.size() == 1) | 229 if (device_formats_cb_queue_.size() == 1) |
225 Send(new VideoCaptureHostMsg_GetDeviceSupportedFormats(device_id_, | 230 Send(new VideoCaptureHostMsg_GetDeviceSupportedFormats(device_id_, |
226 session_id_)); | 231 session_id_)); |
227 } | 232 } |
228 | 233 |
229 void VideoCaptureImpl::GetDeviceFormatsInUse( | 234 void VideoCaptureImpl::GetDeviceFormatsInUse( |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 double consumer_resource_utilization = -1.0; | 557 double consumer_resource_utilization = -1.0; |
553 if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, | 558 if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, |
554 &consumer_resource_utilization)) { | 559 &consumer_resource_utilization)) { |
555 consumer_resource_utilization = -1.0; | 560 consumer_resource_utilization = -1.0; |
556 } | 561 } |
557 | 562 |
558 callback_to_io_thread.Run(*release_sync_token, consumer_resource_utilization); | 563 callback_to_io_thread.Run(*release_sync_token, consumer_resource_utilization); |
559 } | 564 } |
560 | 565 |
561 } // namespace content | 566 } // namespace content |
OLD | NEW |