chromium/media/capture/content/capture_resolution_chooser.cc

// Copyright 2015 The Chromium Authors
// 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 <algorithm>
#include <limits>

#include "base/logging.h"
#include "base/strings/string_util.h"
#include "media/base/video_util.h"

namespace media {

namespace {

// Each snapped frame size is an integer multiple of this many lines apart.
// This is ideal for 16:9 content, but seems to also work well for many
// arbitrary aspect ratios.
const int kSnappedHeightStep =;

// The minimum amount of decrease in area between consecutive snapped frame
// sizes.  This matters externally, where the end-to-end system is hunting for a
// capture size that works within all resource bottlenecks.  If the snapped
// frame sizes are too-close together, the end-to-end system cannot stabilize.
// If they are too-far apart, quality is being sacrificed.
const int kMinAreaDecreasePercent =;

// Returns |size|, unless it exceeds |max_size| or is under |min_size|.  When
// the bounds are exceeded, computes and returns an alternate size of similar
// aspect ratio that is within the bounds.
gfx::Size ComputeBoundedCaptureSize(const gfx::Size& size,
                                    const gfx::Size& min_size,
                                    const gfx::Size& max_size) {}

// Returns true if the area of |a| is less than that of |b|.
bool CompareByArea(const gfx::Size& a, const gfx::Size& b) {}

}  // namespace

// static
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() {}

}  // namespace media