#include "media/capture/content/capture_resolution_chooser.h"
#include <algorithm>
#include <limits>
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "media/base/video_util.h"
namespace media {
namespace {
const int kSnappedHeightStep = …;
const int kMinAreaDecreasePercent = …;
gfx::Size ComputeBoundedCaptureSize(const gfx::Size& size,
const gfx::Size& min_size,
const gfx::Size& max_size) { … }
bool CompareByArea(const gfx::Size& a, const gfx::Size& b) { … }
}
constexpr gfx::Size CaptureResolutionChooser::kDefaultCaptureSize;
CaptureResolutionChooser::CaptureResolutionChooser()
: … { … }
CaptureResolutionChooser::~CaptureResolutionChooser() = default;
void CaptureResolutionChooser::SetConstraints(const gfx::Size& min_frame_size,
const gfx::Size& max_frame_size,
bool use_fixed_aspect_ratio) { … }
void CaptureResolutionChooser::SetSourceSize(const gfx::Size& source_size) { … }
void CaptureResolutionChooser::SetTargetFrameArea(int area) { … }
gfx::Size CaptureResolutionChooser::FindNearestFrameSize(int area) const { … }
gfx::Size CaptureResolutionChooser::FindLargerFrameSize(
int area,
int num_steps_up) const { … }
gfx::Size CaptureResolutionChooser::FindSmallerFrameSize(
int area,
int num_steps_down) const { … }
void CaptureResolutionChooser::RecomputeCaptureSize() { … }
void CaptureResolutionChooser::UpdateSnappedFrameSizes() { … }
}