| 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. |
| 11 | 11 |
| 12 #include "content/renderer/media/video_capture_impl.h" | 12 #include "content/renderer/media/video_capture_impl.h" |
| 13 | 13 |
| 14 #include <stddef.h> | 14 #include <stddef.h> |
| 15 #include <utility> | 15 #include <utility> |
| 16 | 16 |
| 17 #include "base/bind.h" | 17 #include "base/bind.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/stl_util.h" | 19 #include "base/stl_util.h" |
| 20 #include "base/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "content/child/child_process.h" | 21 #include "content/child/child_process.h" |
| 22 #include "content/common/media/video_capture_messages.h" | 22 #include "content/common/media/video_capture_messages.h" |
| 23 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" | 23 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" |
| 24 #include "media/base/bind_to_current_loop.h" | 24 #include "media/base/bind_to_current_loop.h" |
| 25 #include "media/base/limits.h" | 25 #include "media/base/limits.h" |
| 26 #include "media/base/video_frame.h" | 26 #include "media/base/video_frame.h" |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 | 29 |
| 30 // A holder of a memory-backed buffer and accessors to it. | 30 // A holder of a memory-backed buffer and accessors to it. |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 double consumer_resource_utilization = -1.0; | 558 double consumer_resource_utilization = -1.0; |
| 559 if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, | 559 if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, |
| 560 &consumer_resource_utilization)) { | 560 &consumer_resource_utilization)) { |
| 561 consumer_resource_utilization = -1.0; | 561 consumer_resource_utilization = -1.0; |
| 562 } | 562 } |
| 563 | 563 |
| 564 callback_to_io_thread.Run(*release_sync_token, consumer_resource_utilization); | 564 callback_to_io_thread.Run(*release_sync_token, consumer_resource_utilization); |
| 565 } | 565 } |
| 566 | 566 |
| 567 } // namespace content | 567 } // namespace content |
| OLD | NEW |