#include "third_party/blink/renderer/modules/mediastream/media_constraints.h"
#include <math.h>
#include "base/containers/contains.h"
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h"
namespace blink {
namespace {
template <typename T>
void MaybeEmitNamedValue(StringBuilder& builder,
bool emit,
const char* name,
T value) { … }
void MaybeEmitNamedBoolean(StringBuilder& builder,
bool emit,
const char* name,
bool value) { … }
}
class MediaConstraintsPrivate final
: public ThreadSafeRefCounted<MediaConstraintsPrivate> { … };
scoped_refptr<MediaConstraintsPrivate> MediaConstraintsPrivate::Create() { … }
scoped_refptr<MediaConstraintsPrivate> MediaConstraintsPrivate::Create(
const MediaTrackConstraintSetPlatform& basic,
const Vector<MediaTrackConstraintSetPlatform>& advanced) { … }
MediaConstraintsPrivate::MediaConstraintsPrivate(
const MediaTrackConstraintSetPlatform& basic,
const Vector<MediaTrackConstraintSetPlatform>& advanced)
: … { … }
bool MediaConstraintsPrivate::IsUnconstrained() const { … }
const MediaTrackConstraintSetPlatform& MediaConstraintsPrivate::Basic() const { … }
MediaTrackConstraintSetPlatform& MediaConstraintsPrivate::MutableBasic() { … }
const Vector<MediaTrackConstraintSetPlatform>&
MediaConstraintsPrivate::Advanced() const { … }
const String MediaConstraintsPrivate::ToString() const { … }
BaseConstraint::BaseConstraint(const char* name) : … { … }
BaseConstraint::~BaseConstraint() = default;
bool BaseConstraint::HasMandatory() const { … }
LongConstraint::LongConstraint(const char* name)
: … { … }
bool LongConstraint::Matches(int32_t value) const { … }
bool LongConstraint::IsUnconstrained() const { … }
void LongConstraint::ResetToUnconstrained() { … }
String LongConstraint::ToString() const { … }
const double DoubleConstraint::kConstraintEpsilon = …;
DoubleConstraint::DoubleConstraint(const char* name)
: … { … }
bool DoubleConstraint::Matches(double value) const { … }
bool DoubleConstraint::IsUnconstrained() const { … }
void DoubleConstraint::ResetToUnconstrained() { … }
String DoubleConstraint::ToString() const { … }
StringConstraint::StringConstraint(const char* name)
: … { … }
bool StringConstraint::Matches(String value) const { … }
bool StringConstraint::IsUnconstrained() const { … }
const Vector<String>& StringConstraint::Exact() const { … }
const Vector<String>& StringConstraint::Ideal() const { … }
void StringConstraint::ResetToUnconstrained() { … }
String StringConstraint::ToString() const { … }
BooleanConstraint::BooleanConstraint(const char* name)
: … { … }
bool BooleanConstraint::Matches(bool value) const { … }
bool BooleanConstraint::IsUnconstrained() const { … }
void BooleanConstraint::ResetToUnconstrained() { … }
String BooleanConstraint::ToString() const { … }
MediaTrackConstraintSetPlatform::MediaTrackConstraintSetPlatform()
: … { … }
Vector<const BaseConstraint*> MediaTrackConstraintSetPlatform::AllConstraints()
const { … }
bool MediaTrackConstraintSetPlatform::IsUnconstrained() const { … }
bool MediaTrackConstraintSetPlatform::HasMandatoryOutsideSet(
const Vector<String>& good_names,
String& found_name) const { … }
bool MediaTrackConstraintSetPlatform::HasMandatory() const { … }
bool MediaTrackConstraintSetPlatform::HasMin() const { … }
bool MediaTrackConstraintSetPlatform::HasExact() const { … }
String MediaTrackConstraintSetPlatform::ToString() const { … }
void MediaConstraints::Assign(const MediaConstraints& other) { … }
MediaConstraints::MediaConstraints() = default;
MediaConstraints::MediaConstraints(const MediaConstraints& other) { … }
void MediaConstraints::Reset() { … }
bool MediaConstraints::IsUnconstrained() const { … }
void MediaConstraints::Initialize() { … }
void MediaConstraints::Initialize(
const MediaTrackConstraintSetPlatform& basic,
const Vector<MediaTrackConstraintSetPlatform>& advanced) { … }
const MediaTrackConstraintSetPlatform& MediaConstraints::Basic() const { … }
MediaTrackConstraintSetPlatform& MediaConstraints::MutableBasic() { … }
const Vector<MediaTrackConstraintSetPlatform>& MediaConstraints::Advanced()
const { … }
const String MediaConstraints::ToString() const { … }
}