#include "chrome/browser/ui/views/media_preview/camera_preview/video_format_comparison.h"
#include <algorithm>
#include "media/capture/video_capture_types.h"
#include "ui/gfx/geometry/size.h"
namespace video_format_comparison {
namespace {
constexpr float kAspectRatioFitnessWeight = …;
constexpr float kWidthFitnessWeight = …;
constexpr float kFrameRateFitnessWeight = …;
constexpr float kPunishmentDiscount = …;
float GetAspectRatioFitness(const media::VideoCaptureFormat& format) { … }
float GetFitnessValue(const float value, const float target) { … }
float GetFormatFitness(const media::VideoCaptureFormat& format,
const int view_width,
const float target_frame_rate) { … }
}
float GetFrameAspectRatio(const gfx::Size& frame_size) { … }
media::VideoCaptureFormat GetClosestVideoFormat(
const std::vector<media::VideoCaptureFormat>& formats,
const int view_width,
const float target_frame_rate) { … }
}