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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/bits.h" | 13 #include "base/bits.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/numerics/safe_conversions.h" | 15 #include "base/numerics/safe_conversions.h" |
16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "base/trace_event/trace_event.h" | 18 #include "base/trace_event/trace_event.h" |
19 #include "media/base/video_capture_types.h" | |
20 #include "media/base/video_frame.h" | 19 #include "media/base/video_frame.h" |
21 #include "media/base/video_frame_metadata.h" | 20 #include "media/base/video_frame_metadata.h" |
22 #include "media/base/video_util.h" | 21 #include "media/base/video_util.h" |
| 22 #include "media/capture/video_capture_types.h" |
23 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
24 | 24 |
25 namespace media { | 25 namespace media { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 // The target maximum amount of the buffer pool to utilize. Actual buffer pool | 29 // The target maximum amount of the buffer pool to utilize. Actual buffer pool |
30 // utilization is attenuated by this amount before being reported to the | 30 // utilization is attenuated by this amount before being reported to the |
31 // VideoCaptureOracle. This value takes into account the maximum number of | 31 // VideoCaptureOracle. This value takes into account the maximum number of |
32 // buffer pool buffers and a desired safety margin. | 32 // buffer pool buffers and a desired safety margin. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // destructor. |metadata| is still valid for read-access at this point. | 243 // destructor. |metadata| is still valid for read-access at this point. |
244 double utilization = -1.0; | 244 double utilization = -1.0; |
245 if (metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, | 245 if (metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, |
246 &utilization)) { | 246 &utilization)) { |
247 base::AutoLock guard(lock_); | 247 base::AutoLock guard(lock_); |
248 oracle_.RecordConsumerFeedback(frame_number, utilization); | 248 oracle_.RecordConsumerFeedback(frame_number, utilization); |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 } // namespace media | 252 } // namespace media |
OLD | NEW |