Commit d9a6ec05 authored by Armando Miraglia's avatar Armando Miraglia Committed by Commit Bot

[MediaStreamTrack] Remove tests and existing support for the 'volume' property.

Since 'volume' has been removed from the standard specification[1], this
CL removes support for the 'volume' from the output of
MediaStreamTrack.getSettings(). Further, this CL removes the related
existing tests.

Intent to deprecate and remove:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/8-Qn7pu41Kk

[1] https://github.com/w3c/mediacapture-main/issues/585

BUG=942016

Change-Id: I8cfcd5d119f79d4da73ee5aa94770f2cd2b7f881
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1630156Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Armando Miraglia <armax@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664126}
parent 73bac857
......@@ -226,13 +226,6 @@ void MediaStreamCenter::GetSourceSettings(
// kSampleFormatS16 is the format used for all audio input streams.
settings.sample_size =
media::SampleFormatToBitsPerChannel(media::kSampleFormatS16);
ProcessedLocalAudioSource* const processed_source =
ProcessedLocalAudioSource::From(source);
settings.volume = processed_source
? static_cast<double>(processed_source->Volume()) /
processed_source->MaxVolume()
: 1.0;
}
} // namespace content
......@@ -60,7 +60,6 @@ class WebMediaStreamTrack {
bool HasSampleSize() const { return sample_size >= 0; }
bool HasChannelCount() const { return channel_count >= 0; }
bool HasLatency() const { return latency >= 0; }
bool HasVolume() const { return volume >= 0; }
bool HasVideoKind() const { return !video_kind.IsNull(); }
// The variables are read from
// MediaStreamTrack::GetSettings only.
......@@ -80,7 +79,6 @@ class WebMediaStreamTrack {
int32_t sample_size = -1;
int32_t channel_count = -1;
double latency = -1.0;
double volume = -1.0;
// Media Capture Depth Stream Extensions.
WebString video_kind;
......
......@@ -648,10 +648,6 @@ void CopyConstraintSet(const MediaTrackConstraintSet* constraints_in,
CopyStringConstraint(constraints_in->resizeMode(), naked_treatment,
constraint_buffer.resize_mode);
}
if (constraints_in->hasVolume()) {
CopyDoubleConstraint(constraints_in->volume(), naked_treatment,
constraint_buffer.volume);
}
if (constraints_in->hasSampleRate()) {
CopyLongConstraint(constraints_in->sampleRate(), naked_treatment,
constraint_buffer.sample_rate);
......@@ -903,8 +899,6 @@ void ConvertConstraintSet(const WebMediaTrackConstraintSet& input,
output->setFacingMode(ConvertString(input.facing_mode, naked_treatment));
if (!input.resize_mode.IsEmpty())
output->setResizeMode(ConvertString(input.resize_mode, naked_treatment));
if (!input.volume.IsEmpty())
output->setVolume(ConvertDouble(input.volume, naked_treatment));
if (!input.sample_rate.IsEmpty())
output->setSampleRate(ConvertLong(input.sample_rate, naked_treatment));
if (!input.sample_size.IsEmpty())
......
......@@ -92,8 +92,7 @@ bool ConstraintSetHasNonImageCapture(
constraint_set->hasFrameRate() || constraint_set->hasGroupId() ||
constraint_set->hasHeight() || constraint_set->hasLatency() ||
constraint_set->hasSampleRate() || constraint_set->hasSampleSize() ||
constraint_set->hasVideoKind() || constraint_set->hasVolume() ||
constraint_set->hasWidth();
constraint_set->hasVideoKind() || constraint_set->hasWidth();
}
bool ConstraintSetHasImageAndNonImageCapture(
......@@ -517,8 +516,6 @@ MediaTrackSettings* MediaStreamTrack::getSettings() const {
settings->setChannelCount(platform_settings.channel_count);
if (platform_settings.HasLatency())
settings->setLatency(platform_settings.latency);
if (platform_settings.HasVolume())
settings->setVolume(platform_settings.volume);
if (image_capture_)
image_capture_->GetMediaTrackSettings(settings);
......
......@@ -17,7 +17,6 @@ dictionary MediaTrackConstraintSet {
ConstrainDouble frameRate;
ConstrainDOMString facingMode;
ConstrainDOMString resizeMode;
ConstrainDouble volume;
ConstrainLong sampleRate;
ConstrainLong sampleSize;
ConstrainBoolean echoCancellation;
......
......@@ -11,7 +11,6 @@ dictionary MediaTrackSettings {
double frameRate;
DOMString facingMode;
DOMString resizeMode;
double volume;
long sampleRate;
long sampleSize;
boolean echoCancellation;
......
......@@ -14,7 +14,6 @@ dictionary MediaTrackSupportedConstraints {
boolean frameRate = true;
boolean facingMode = true;
boolean resizeMode = true;
boolean volume = true;
boolean sampleRate = true;
boolean sampleSize = true;
boolean echoCancellation = true;
......
......@@ -27,7 +27,6 @@ test(() => {
"frameRate",
"facingMode",
"resizeMode",
"volume",
"sampleRate",
"sampleSize",
"echoCancellation",
......
This is a testharness.js-based test.
Found 112 tests; 108 PASS, 4 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Setup audio MediaStreamTrack getCapabilities() test for volume
PASS Setup audio MediaStreamTrack getCapabilities() test for sampleRate
PASS Setup audio MediaStreamTrack getCapabilities() test for sampleSize
PASS Setup audio MediaStreamTrack getCapabilities() test for echoCancellation
PASS Setup audio MediaStreamTrack getCapabilities() test for autoGainControl
PASS Setup audio MediaStreamTrack getCapabilities() test for noiseSuppression
PASS Setup audio MediaStreamTrack getCapabilities() test for latency
PASS Setup audio MediaStreamTrack getCapabilities() test for channelCount
PASS Setup audio MediaStreamTrack getCapabilities() test for deviceId
PASS Setup audio MediaStreamTrack getCapabilities() test for groupId
PASS Setup video MediaStreamTrack getCapabilities() test for width
PASS Setup video MediaStreamTrack getCapabilities() test for height
PASS Setup video MediaStreamTrack getCapabilities() test for aspectRatio
PASS Setup video MediaStreamTrack getCapabilities() test for frameRate
PASS Setup video MediaStreamTrack getCapabilities() test for facingMode
PASS Setup video MediaStreamTrack getCapabilities() test for resizeMode
PASS Setup video MediaStreamTrack getCapabilities() test for deviceId
PASS Setup video MediaStreamTrack getCapabilities() test for groupId
PASS Setup audio InputDeviceInfo getCapabilities() test for volume
PASS Setup audio InputDeviceInfo getCapabilities() test for sampleRate
PASS Setup audio InputDeviceInfo getCapabilities() test for sampleSize
PASS Setup audio InputDeviceInfo getCapabilities() test for echoCancellation
PASS Setup audio InputDeviceInfo getCapabilities() test for autoGainControl
PASS Setup audio InputDeviceInfo getCapabilities() test for noiseSuppression
PASS Setup audio InputDeviceInfo getCapabilities() test for latency
PASS Setup audio InputDeviceInfo getCapabilities() test for channelCount
PASS Setup audio InputDeviceInfo getCapabilities() test for deviceId
PASS Setup audio InputDeviceInfo getCapabilities() test for groupId
PASS Setup video InputDeviceInfo getCapabilities() test for width
PASS Setup video InputDeviceInfo getCapabilities() test for height
PASS Setup video InputDeviceInfo getCapabilities() test for aspectRatio
PASS Setup video InputDeviceInfo getCapabilities() test for frameRate
PASS Setup video InputDeviceInfo getCapabilities() test for facingMode
PASS Setup video InputDeviceInfo getCapabilities() test for resizeMode
PASS Setup video InputDeviceInfo getCapabilities() test for deviceId
PASS Setup video InputDeviceInfo getCapabilities() test for groupId
FAIL Audio track getCapabilities() volume property present. assert_true: expected true got false
FAIL Audio track getCapabilities() volume properly supported. assert_equals: expected "object" but got "undefined"
PASS Audio track getCapabilities() sampleRate property present.
PASS Audio track getCapabilities() sampleRate properly supported.
PASS Audio track getCapabilities() sampleSize property present.
PASS Audio track getCapabilities() sampleSize properly supported.
PASS Audio track getCapabilities() echoCancellation property present.
PASS Audio track getCapabilities() echoCancellation properly supported.
PASS Audio track getCapabilities() autoGainControl property present.
PASS Audio track getCapabilities() autoGainControl properly supported.
PASS Audio track getCapabilities() noiseSuppression property present.
PASS Audio track getCapabilities() noiseSuppression properly supported.
PASS Audio track getCapabilities() latency property present.
PASS Audio track getCapabilities() latency properly supported.
PASS Audio track getCapabilities() channelCount property present.
PASS Audio track getCapabilities() channelCount properly supported.
PASS Audio track getCapabilities() deviceId property present.
PASS Audio track getCapabilities() deviceId properly supported.
PASS Audio track getCapabilities() groupId property present.
PASS Audio track getCapabilities() groupId properly supported.
PASS Video track getCapabilities() width property present.
PASS Video track getCapabilities() width properly supported.
PASS Video track getCapabilities() height property present.
PASS Video track getCapabilities() height properly supported.
PASS Video track getCapabilities() aspectRatio property present.
PASS Video track getCapabilities() aspectRatio properly supported.
PASS Video track getCapabilities() frameRate property present.
PASS Video track getCapabilities() frameRate properly supported.
PASS Video track getCapabilities() facingMode property present.
PASS Video track getCapabilities() facingMode properly supported.
PASS Video track getCapabilities() resizeMode property present.
PASS Video track getCapabilities() resizeMode properly supported.
PASS Video track getCapabilities() resizeMode properly supported. Value: none
PASS Video track getCapabilities() resizeMode properly supported. Value: crop-and-scale
PASS Video track getCapabilities() deviceId property present.
PASS Video track getCapabilities() deviceId properly supported.
PASS Video track getCapabilities() groupId property present.
PASS Video track getCapabilities() groupId properly supported.
FAIL Audio device getCapabilities() volume property present. assert_true: expected true got false
FAIL Audio device getCapabilities() volume properly supported. assert_equals: expected "object" but got "undefined"
PASS Audio device getCapabilities() sampleRate property present.
PASS Audio device getCapabilities() sampleRate properly supported.
PASS Audio device getCapabilities() sampleSize property present.
PASS Audio device getCapabilities() sampleSize properly supported.
PASS Audio device getCapabilities() echoCancellation property present.
PASS Audio device getCapabilities() echoCancellation properly supported.
PASS Audio device getCapabilities() autoGainControl property present.
PASS Audio device getCapabilities() autoGainControl properly supported.
PASS Audio device getCapabilities() noiseSuppression property present.
PASS Audio device getCapabilities() noiseSuppression properly supported.
PASS Audio device getCapabilities() latency property present.
PASS Audio device getCapabilities() latency properly supported.
PASS Audio device getCapabilities() channelCount property present.
PASS Audio device getCapabilities() channelCount properly supported.
PASS Audio device getCapabilities() deviceId property present.
PASS Audio device getCapabilities() deviceId properly supported.
PASS Audio device getCapabilities() groupId property present.
PASS Audio device getCapabilities() groupId properly supported.
PASS Video device getCapabilities() width property present.
PASS Video device getCapabilities() width properly supported.
PASS Video device getCapabilities() height property present.
PASS Video device getCapabilities() height properly supported.
PASS Video device getCapabilities() aspectRatio property present.
PASS Video device getCapabilities() aspectRatio properly supported.
PASS Video device getCapabilities() frameRate property present.
PASS Video device getCapabilities() frameRate properly supported.
PASS Video device getCapabilities() facingMode property present.
PASS Video device getCapabilities() facingMode properly supported.
PASS Video device getCapabilities() resizeMode property present.
PASS Video device getCapabilities() resizeMode properly supported.
PASS Video device getCapabilities() resizeMode properly supported. Value: none
PASS Video device getCapabilities() resizeMode properly supported. Value: crop-and-scale
PASS Video device getCapabilities() deviceId property present.
PASS Video device getCapabilities() deviceId properly supported.
PASS Video device getCapabilities() groupId property present.
PASS Video device getCapabilities() groupId properly supported.
Harness: the test ran to completion.
......@@ -5,7 +5,6 @@
<script>
const audioProperties = [
{name: "volume", type: "number"},
{name: "sampleRate", type: "number"},
{name: "sampleSize", type: "number"},
{name: "echoCancellation", type: "boolean"},
......
......@@ -95,13 +95,6 @@
"groupId should exist and it should be a string.");
}, 'groupId is reported by getSettings() for getUserMedia() audio tracks');
promise_test(async t => {
const settings = await createAudioStreamAndGetSettings(t);
assert_equals(typeof(settings.volume), "number",
"volume should exist and it should be a number.");
assert_between_inclusive(settings.volume, 0.0, 1.0);
}, 'volume is reported by getSettings() for getUserMedia() audio tracks');
promise_test(async t => {
const settings = await createAudioStreamAndGetSettings(t);
assert_equals(typeof(settings.sampleRate), "number",
......
......@@ -13,7 +13,6 @@ test(function() {
assert_true(supported_constraints.frameRate);
assert_true(supported_constraints.facingMode);
assert_true(supported_constraints.resizeMode);
assert_true(supported_constraints.volume);
assert_true(supported_constraints.sampleRate);
assert_true(supported_constraints.sampleSize);
assert_true(supported_constraints.echoCancellation);
......
......@@ -96,7 +96,6 @@ promise_test(() => {
facingMode: { ideal: "user" },
aspectRatio: { ideal: 1.3333333, exact: 1.4444 },
volume: 1.0,
sampleRate: { ideal: 42, min: 31, max: 54 },
sampleSize: 3,
echoCancellation: { ideal: false, exact: true },
......
......@@ -68,7 +68,6 @@ promise_test(function() {
// These constraints are syntactically valid, but may cause rejection.
// They are included in an "advanced" constraint.
const ignorableConstraintSet = {
volume: { ideal: 1.0 },
sampleRate: { ideal: 42 },
sampleSize: { ideal: 3 },
echoCancellation: { ideal: false },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment