зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to inbound. a=merge CLOSED TREE
This commit is contained in:
Коммит
386468ce92
|
@ -324,10 +324,6 @@ GeolocationInsecureRequestIsForbidden=A Geolocation request can only be fulfille
|
|||
LargeAllocationNonWin32=This page would be loaded in a new process due to a Large-Allocation header, however Large-Allocation process creation is disabled on non-Win32 platforms.
|
||||
# LOCALIZATION NOTE: Do not translate URL.createObjectURL(MediaStream).
|
||||
URLCreateObjectURL_MediaStreamWarning=URL.createObjectURL(MediaStream) is deprecated and will be removed soon.
|
||||
# LOCALIZATION NOTE: Do not translate MozAutoGainControl or autoGainControl.
|
||||
MozAutoGainControlWarning=mozAutoGainControl is deprecated. Use autoGainControl instead.
|
||||
# LOCALIZATION NOTE: Do not translate mozNoiseSuppression or noiseSuppression.
|
||||
MozNoiseSuppressionWarning=mozNoiseSuppression is deprecated. Use noiseSuppression instead.
|
||||
# LOCALIZATION NOTE: Do not translate xml:base.
|
||||
XMLBaseAttributeWarning=Use of xml:base attribute is deprecated and will be removed soon. Please remove any use of it.
|
||||
# LOCALIZATION NOTE: Do not translate "content", "Window", and "window.top"
|
||||
|
|
|
@ -2798,14 +2798,6 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
|
|||
|
||||
if (c.mAudio.IsMediaTrackConstraints()) {
|
||||
auto& ac = c.mAudio.GetAsMediaTrackConstraints();
|
||||
MediaConstraintsHelper::ConvertOldWithWarning(ac.mMozAutoGainControl,
|
||||
ac.mAutoGainControl,
|
||||
"MozAutoGainControlWarning",
|
||||
aWindow);
|
||||
MediaConstraintsHelper::ConvertOldWithWarning(ac.mMozNoiseSuppression,
|
||||
ac.mNoiseSuppression,
|
||||
"MozNoiseSuppressionWarning",
|
||||
aWindow);
|
||||
audioType = StringToEnum(dom::MediaSourceEnumValues::strings,
|
||||
ac.mMediaSource,
|
||||
MediaSourceEnum::Other);
|
||||
|
@ -4829,7 +4821,7 @@ RefPtr<SourceListener::ApplyConstraintsPromise>
|
|||
SourceListener::ApplyConstraintsToTrack(
|
||||
nsPIDOMWindowInner* aWindow,
|
||||
TrackID aTrackID,
|
||||
const MediaTrackConstraints& aConstraintsPassedIn,
|
||||
const MediaTrackConstraints& aConstraints,
|
||||
dom::CallerType aCallerType)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
@ -4841,37 +4833,27 @@ SourceListener::ApplyConstraintsToTrack(
|
|||
return ApplyConstraintsPromise::CreateAndResolve(false, __func__);
|
||||
}
|
||||
|
||||
MediaTrackConstraints c(aConstraintsPassedIn); // use a modifiable copy
|
||||
MediaConstraintsHelper::ConvertOldWithWarning(c.mMozAutoGainControl,
|
||||
c.mAutoGainControl,
|
||||
"MozAutoGainControlWarning",
|
||||
aWindow);
|
||||
MediaConstraintsHelper::ConvertOldWithWarning(c.mMozNoiseSuppression,
|
||||
c.mNoiseSuppression,
|
||||
"MozNoiseSuppressionWarning",
|
||||
aWindow);
|
||||
|
||||
MediaManager* mgr = MediaManager::GetIfExists();
|
||||
if (!mgr) {
|
||||
return ApplyConstraintsPromise::CreateAndResolve(false, __func__);
|
||||
}
|
||||
|
||||
return MediaManager::PostTask<ApplyConstraintsPromise>(__func__,
|
||||
[device = state.mDevice, c,
|
||||
[device = state.mDevice, aConstraints,
|
||||
isChrome = aCallerType == dom::CallerType::System]
|
||||
(MozPromiseHolder<ApplyConstraintsPromise>& aHolder) mutable {
|
||||
MOZ_ASSERT(MediaManager::IsInMediaThread());
|
||||
MediaManager* mgr = MediaManager::GetIfExists();
|
||||
MOZ_RELEASE_ASSERT(mgr); // Must exist while media thread is alive
|
||||
const char* badConstraint = nullptr;
|
||||
nsresult rv = device->Reconfigure(c, mgr->mPrefs, &badConstraint);
|
||||
nsresult rv = device->Reconfigure(aConstraints, mgr->mPrefs, &badConstraint);
|
||||
if (rv == NS_ERROR_INVALID_ARG) {
|
||||
// Reconfigure failed due to constraints
|
||||
if (!badConstraint) {
|
||||
nsTArray<RefPtr<MediaDevice>> devices;
|
||||
devices.AppendElement(device);
|
||||
badConstraint = MediaConstraintsHelper::SelectSettings(
|
||||
NormalizedConstraints(c), devices, isChrome);
|
||||
NormalizedConstraints(aConstraints), devices, isChrome);
|
||||
}
|
||||
|
||||
aHolder.Reject(Some(NS_ConvertASCIItoUTF16(badConstraint)), __func__);
|
||||
|
|
|
@ -625,33 +625,6 @@ MediaConstraintsHelper::FindBadConstraint(
|
|||
return FindBadConstraint(aConstraints, devices);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
MediaConstraintsHelper::ConvertOldWithWarning(
|
||||
const dom::OwningBooleanOrConstrainBooleanParameters& old,
|
||||
dom::OwningBooleanOrConstrainBooleanParameters& to,
|
||||
const char* aMessageName,
|
||||
nsPIDOMWindowInner* aWindow) {
|
||||
if ((old.IsBoolean() ||
|
||||
old.GetAsConstrainBooleanParameters().mExact.WasPassed() ||
|
||||
old.GetAsConstrainBooleanParameters().mIdeal.WasPassed()) &&
|
||||
!(to.IsBoolean() ||
|
||||
to.GetAsConstrainBooleanParameters().mExact.WasPassed() ||
|
||||
to.GetAsConstrainBooleanParameters().mIdeal.WasPassed())) {
|
||||
nsCOMPtr<nsIDocument> doc = aWindow->GetDoc();
|
||||
if (doc) {
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("DOM"), doc,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
aMessageName);
|
||||
}
|
||||
if (old.IsBoolean()) {
|
||||
to.SetAsBoolean() = old.GetAsBoolean();
|
||||
} else {
|
||||
to.SetAsConstrainBooleanParameters() = old.GetAsConstrainBooleanParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LogConstraintStringRange(const NormalizedConstraintSet::StringRange& aRange)
|
||||
{
|
||||
|
|
|
@ -338,14 +338,6 @@ public:
|
|||
const RefPtr<MediaEngineSource>& aMediaEngineSource,
|
||||
const nsString& aDeviceId);
|
||||
|
||||
// Warn on and convert use of deprecated constraints to new ones
|
||||
static void
|
||||
ConvertOldWithWarning(
|
||||
const dom::OwningBooleanOrConstrainBooleanParameters& old,
|
||||
dom::OwningBooleanOrConstrainBooleanParameters& to,
|
||||
const char* aMessageName,
|
||||
nsPIDOMWindowInner* aWindow);
|
||||
|
||||
static void LogConstraints(const NormalizedConstraintSet& aConstraints);
|
||||
};
|
||||
|
||||
|
|
|
@ -58,9 +58,6 @@ dictionary MediaTrackConstraintSet {
|
|||
ConstrainBoolean noiseSuppression;
|
||||
ConstrainBoolean autoGainControl;
|
||||
ConstrainLong channelCount;
|
||||
|
||||
ConstrainBoolean mozNoiseSuppression;
|
||||
ConstrainBoolean mozAutoGainControl;
|
||||
};
|
||||
|
||||
dictionary MediaTrackConstraints : MediaTrackConstraintSet {
|
||||
|
|
Загрузка…
Ссылка в новой задаче