Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: media/capture/content/thread_safe_capture_oracle.cc

Issue 2415703002: Move files video_capture*.* from media/base to media/capture (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/capture/content/capture_resolution_chooser.h ('k') | media/capture/ipc/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « media/capture/content/capture_resolution_chooser.h ('k') | media/capture/ipc/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698