Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_CAPTURE_RESOLUTION_EVALUATOR_H_ | |
| 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_CAPTURE_RESOLUTION_EVALUATOR_H_ | |
| 7 | |
| 8 #include "content/common/content_export.h" | |
| 9 #include "media/base/video_capture_types.h" | |
| 10 #include "ui/gfx/geometry/size.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 // Encapsulates the logic that determines the capture frame resolution based on: | |
| 15 // 1. The configured maximum frame resolution and resolution change policy. | |
| 16 // 2. The resolution of the source content. | |
| 17 // 3. The current capabilities of the end-to-end system, in terms of data | |
| 18 // volume. | |
| 19 class CONTENT_EXPORT CaptureResolutionEvaluator { | |
|
Wez
2015/05/13 19:05:08
nit: Evaluator doesn't seem the right name for thi
miu
2015/05/14 01:21:32
Done. I like "chooser," since an upcoming change
| |
| 20 public: | |
| 21 CaptureResolutionEvaluator( | |
| 22 const gfx::Size& max_frame_size, | |
| 23 media::ResolutionChangePolicy resolution_change_policy); | |
|
Wez
2015/05/13 19:05:09
Suggest briefly explaining what resolution_change_
miu
2015/05/14 01:21:32
Done.
| |
| 24 ~CaptureResolutionEvaluator(); | |
| 25 | |
| 26 // Returns the current capture frame resolution to use. | |
| 27 gfx::Size capture_size() const { | |
| 28 return capture_size_; | |
| 29 } | |
| 30 | |
| 31 // Updates the capture size based on a change in the resolution of the source | |
| 32 // content. | |
| 33 void UpdateForNewSourceSize(const gfx::Size& source_size); | |
|
Wez
2015/05/13 19:05:08
nit: I'd suggest naming these SetSourceSize() and
miu
2015/05/14 01:21:32
Done.
| |
| 34 | |
| 35 // Updates the capture size to one that satisfies the current capabilities of | |
| 36 // the system, in terms of |num_pixels| per frame. | |
|
Wez
2015/05/13 19:05:09
I think it'd be clearer to split what the function
miu
2015/05/14 01:21:32
Done. I liked your wording, so I plagiarized it.
| |
| 37 void UpdateForNewCapabilityLimit(int num_pixels); | |
| 38 | |
| 39 private: | |
| 40 // Called after any update that requires |capture_size_| be re-computed. | |
| 41 void UpdateCaptureSize(); | |
|
Wez
2015/05/13 19:05:09
If you update the others to Set... then suggest th
miu
2015/05/14 01:21:32
Done.
| |
| 42 | |
| 43 // Hard constraints. | |
|
Wez
2015/05/13 19:05:08
Where does |min_frame_size_| come from - it doesn'
miu
2015/05/14 01:21:32
Done.
| |
| 44 const gfx::Size max_frame_size_; | |
| 45 const gfx::Size min_frame_size_; | |
| 46 | |
| 47 // Selects the set of heuristics to use. | |
|
Wez
2015/05/13 19:05:08
nit: Selects -> Specifies
miu
2015/05/14 01:21:32
Done.
| |
| 48 const media::ResolutionChangePolicy resolution_change_policy_; | |
| 49 | |
| 50 // The capture frame resolution to use, ignoring the limitations imposed by | |
| 51 // the capability metric. | |
|
Wez
2015/05/13 19:05:09
This isn't very clear; naively I'd assume this mus
miu
2015/05/14 01:21:32
Done. Agreed, I like your naming better.
| |
| 52 gfx::Size ideal_capture_size_; | |
| 53 | |
| 54 // The last computed capture frame resolution. | |
| 55 gfx::Size capture_size_; | |
|
Wez
2015/05/13 19:05:08
nit: "The current computed capture frame resolutio
miu
2015/05/14 01:21:32
Done.
| |
| 56 }; | |
| 57 | |
| 58 } // namespace content | |
| 59 | |
| 60 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_RESOLUTION_EVALUATOR_H_ | |
| OLD | NEW |