chromium/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_content.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_content.h"

#include <algorithm>
#include <cmath>
#include <utility>

#include "base/feature_list.h"
#include "media/base/limits.h"
#include "media/base/video_types.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/mediastream/media_stream_controls.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h"
#include "third_party/blink/renderer/modules/mediastream/media_constraints.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_sets.h"

namespace blink {

const int kMinScreenCastDimension =;
// Use kMaxDimension/2 as maximum to ensure selected resolutions have area less
// than media::limits::kMaxCanvas.
const int kMaxScreenCastDimension =;
static_assert;

const int kDefaultScreenCastWidth =;
const int kDefaultScreenCastHeight =;
static_assert;
static_assert;

const double kMaxScreenCastFrameRate =;
const double kDefaultScreenCastFrameRate =;

namespace {

ResolutionSet;
Point;
StringSet;
BoolSet;
DoubleRangeSet;

constexpr double kMinScreenCastAspectRatio =;
constexpr double kMaxScreenCastAspectRatio =;

class VideoContentCaptureCandidates {};

ResolutionSet ScreenCastResolutionCapabilities() {}

// This algorithm for selecting policy matches the old non-spec compliant
// algorithm in order to be more compatible with existing applications.
// TODO(guidou): Update this algorithm to properly take into account the minimum
// width and height, and the aspect_ratio constraint once most existing
// applications migrate to the new syntax. See https://crbug.com/701302.
media::ResolutionChangePolicy SelectResolutionPolicyFromCandidates(
    const ResolutionSet& resolution_set,
    media::ResolutionChangePolicy default_policy) {}

int RoundToInt(double d) {}

gfx::Size ToGfxSize(const Point& point) {}

double SelectFrameRateFromCandidates(
    const DoubleRangeSet& candidate_set,
    const MediaTrackConstraintSetPlatform& basic_constraint_set,
    double default_frame_rate) {}

media::VideoCaptureParams SelectVideoCaptureParamsFromCandidates(
    const VideoContentCaptureCandidates& candidates,
    const MediaTrackConstraintSetPlatform& basic_constraint_set,
    int default_height,
    int default_width,
    double default_frame_rate,
    media::ResolutionChangePolicy default_resolution_policy) {}

std::string SelectDeviceIDFromCandidates(
    const StringSet& candidates,
    const MediaTrackConstraintSetPlatform& basic_constraint_set) {}

std::optional<bool> SelectNoiseReductionFromCandidates(
    const BoolSet& candidates,
    const MediaTrackConstraintSetPlatform& basic_constraint_set) {}

bool SelectRescaleFromCandidates(
    const BoolSet& candidates,
    const MediaTrackConstraintSetPlatform& basic_constraint_set) {}

int ClampToValidScreenCastDimension(int value) {}

VideoCaptureSettings SelectResultFromCandidates(
    const VideoContentCaptureCandidates& candidates,
    const MediaTrackConstraintSetPlatform& basic_constraint_set,
    mojom::MediaStreamType stream_type,
    int screen_width,
    int screen_height) {}

VideoCaptureSettings UnsatisfiedConstraintsResult(
    const VideoContentCaptureCandidates& candidates,
    const MediaTrackConstraintSetPlatform& constraint_set) {}

}  // namespace

VideoCaptureSettings SelectSettingsVideoContentCapture(
    const MediaConstraints& constraints,
    mojom::MediaStreamType stream_type,
    int screen_width,
    int screen_height) {}

}  // namespace blink