#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 = …;
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() { … }
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) { … }
}
VideoCaptureSettings SelectSettingsVideoContentCapture(
const MediaConstraints& constraints,
mojom::MediaStreamType stream_type,
int screen_width,
int screen_height) { … }
}