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

Unified Diff: device/capture/content/capture_resolution_chooser.cc

Issue 2214533002: move //media/capture to //device/capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: device/capture/content/capture_resolution_chooser.cc
diff --git a/media/capture/content/capture_resolution_chooser.cc b/device/capture/content/capture_resolution_chooser.cc
similarity index 90%
rename from media/capture/content/capture_resolution_chooser.cc
rename to device/capture/content/capture_resolution_chooser.cc
index 3c7f3e58515ac5abed5c2476edccbc6bb0407d0c..f7242e0cedf9f7b3d343874fa5ea3aa87fd931fd 100644
--- a/media/capture/content/capture_resolution_chooser.cc
+++ b/device/capture/content/capture_resolution_chooser.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "media/capture/content/capture_resolution_chooser.h"
+#include "device/capture/content/capture_resolution_chooser.h"
#include <algorithm>
#include <limits>
@@ -11,7 +11,7 @@
#include "media/base/limits.h"
#include "media/base/video_util.h"
-namespace media {
+namespace device {
namespace {
@@ -33,9 +33,9 @@ gfx::Size ComputeMinimumCaptureSize(
const gfx::Size& max_frame_size,
ResolutionChangePolicy resolution_change_policy) {
switch (resolution_change_policy) {
- case RESOLUTION_POLICY_FIXED_RESOLUTION:
+ case media::RESOLUTION_POLICY_FIXED_RESOLUTION:
return max_frame_size;
- case RESOLUTION_POLICY_FIXED_ASPECT_RATIO: {
+ case media::RESOLUTION_POLICY_FIXED_ASPECT_RATIO: {
// TODO(miu): This is a place-holder until "min constraints" are plumbed-
// in from the MediaStream framework. http://crbug.com/473336
const int kMinLines = 180;
@@ -44,11 +44,11 @@ gfx::Size ComputeMinimumCaptureSize(
const gfx::Size result(
kMinLines * max_frame_size.width() / max_frame_size.height(),
kMinLines);
- if (result.width() <= 0 || result.width() > limits::kMaxDimension)
+ if (result.width() <= 0 || result.width() > media::limits::kMaxDimension)
return max_frame_size;
return result;
}
- case RESOLUTION_POLICY_ANY_WITHIN_LIMIT:
+ case media::RESOLUTION_POLICY_ANY_WITHIN_LIMIT:
return gfx::Size(1, 1);
}
NOTREACHED();
@@ -62,12 +62,12 @@ gfx::Size ComputeBoundedCaptureSize(const gfx::Size& size,
const gfx::Size& min_size,
const gfx::Size& max_size) {
if (size.width() > max_size.width() || size.height() > max_size.height()) {
- gfx::Size result = ScaleSizeToFitWithinTarget(size, max_size);
+ gfx::Size result = media::ScaleSizeToFitWithinTarget(size, max_size);
result.SetToMax(min_size);
return result;
} else if (size.width() < min_size.width() ||
size.height() < min_size.height()) {
- gfx::Size result = ScaleSizeToEncompassTarget(size, min_size);
+ gfx::Size result = media::ScaleSizeToEncompassTarget(size, min_size);
result.SetToMin(max_size);
return result;
} else {
@@ -94,7 +94,7 @@ CaptureResolutionChooser::CaptureResolutionChooser(
DCHECK_LT(0, max_frame_size_.height());
DCHECK_LE(min_frame_size_.width(), max_frame_size_.width());
DCHECK_LE(min_frame_size_.height(), max_frame_size_.height());
- DCHECK_LE(resolution_change_policy_, RESOLUTION_POLICY_LAST);
+ DCHECK_LE(resolution_change_policy_, media::RESOLUTION_POLICY_LAST);
UpdateSnappedFrameSizes(max_frame_size_);
RecomputeCaptureSize();
@@ -108,19 +108,19 @@ void CaptureResolutionChooser::SetSourceSize(const gfx::Size& source_size) {
return;
switch (resolution_change_policy_) {
- case RESOLUTION_POLICY_FIXED_RESOLUTION:
+ case media::RESOLUTION_POLICY_FIXED_RESOLUTION:
// Source size changes do not affect the frame resolution. Frame
// resolution is always fixed to |max_frame_size_|.
break;
- case RESOLUTION_POLICY_FIXED_ASPECT_RATIO:
+ case media::RESOLUTION_POLICY_FIXED_ASPECT_RATIO:
UpdateSnappedFrameSizes(ComputeBoundedCaptureSize(
- PadToMatchAspectRatio(source_size, max_frame_size_), min_frame_size_,
- max_frame_size_));
+ media::PadToMatchAspectRatio(source_size, max_frame_size_),
+ min_frame_size_, max_frame_size_));
RecomputeCaptureSize();
break;
- case RESOLUTION_POLICY_ANY_WITHIN_LIMIT:
+ case media::RESOLUTION_POLICY_ANY_WITHIN_LIMIT:
UpdateSnappedFrameSizes(ComputeBoundedCaptureSize(
source_size, min_frame_size_, max_frame_size_));
RecomputeCaptureSize();
@@ -236,4 +236,4 @@ void CaptureResolutionChooser::UpdateSnappedFrameSizes(
}
}
-} // namespace media
+} // namespace device
« no previous file with comments | « device/capture/content/capture_resolution_chooser.h ('k') | device/capture/content/capture_resolution_chooser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698