Bug 1615460 [wpt PR 21791] - Implement MediaCapabilities: HDR decoding query, a=testonly

Automatic update from web-platform-tests
Implement MediaCapabilities: HDR decoding query

This CL allows for HDR to be queried with MediaCapabilities.decodingInfo
with hdrMetadataType, colorGamut, and transferFunction. Both Blink- and
Media-side changes are included. The feature is flagged by
MediaCapabilitiesDynamicRange.

Bug: 1048045
Change-Id: I9f144726bbc7aaead4dcc1c9f69cf536da1bf2a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035053
Commit-Queue: Vi Nguyen <ving@microsoft.com>
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756829}

--

wpt-commits: 52b1ba4e190f45ab8d49ebe2a1c3d79f6d3c6f06
wpt-pr: 21791
This commit is contained in:
Vi Nguyen 2020-04-10 14:26:46 +00:00 committed by moz-wptsync-bot
parent 80b4416527
commit b0b1b82c3f

View File

@ -23,6 +23,19 @@ var audioConfigurationWithSpatialRendering = {
spatialRendering: true,
};
// VideoConfiguration with optional hdrMetadataType, colorGamut, and
// transferFunction properties.
var videoConfigurationWithDynamicRange = {
contentType: 'video/webm; codecs="vp09.00.10.08"',
width: 800,
height: 600,
bitrate: 3000,
framerate: 24,
hdrMetadataType: "smpteSt2086",
colorGamut: "srgb",
transferFunction: "srgb",
}
promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo());
}, "Test that decodingInfo rejects if it doesn't get a configuration");
@ -314,3 +327,57 @@ promise_test(t => {
assert_equals(typeof ability.keySystemAccess, "object");
});
}, "Test that decodingInfo with spatialRendering set returns a valid MediaCapabilitiesInfo objects");
promise_test(t => {
return navigator.mediaCapabilities.decodingInfo({
type: 'file',
video: videoConfigurationWithDynamicRange,
}).then(ability => {
assert_equals(typeof ability.supported, "boolean");
assert_equals(typeof ability.smooth, "boolean");
assert_equals(typeof ability.powerEfficient, "boolean");
assert_equals(typeof ability.keySystemAccess, "object");
});
}, "Test that decodingInfo with hdrMetadataType, colorGamut, and transferFunction set returns a valid MediaCapabilitiesInfo objects");
promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({
type: 'file',
video: {
contentType: 'video/webm; codecs="vp09.00.10.08"',
width: 800,
height: 600,
bitrate: 3000,
framerate: 24,
hdrMetadataType: ""
},
}));
}, "Test that decodingInfo rejects if the video configuration has an empty hdrMetadataType");
promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({
type: 'file',
video: {
contentType: 'video/webm; codecs="vp09.00.10.08"',
width: 800,
height: 600,
bitrate: 3000,
framerate: 24,
colorGamut: true
},
}));
}, "Test that decodingInfo rejects if the video configuration has a colorGamut set to true");
promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({
type: 'file',
video: {
contentType: 'video/webm; codecs="vp09.00.10.08"',
width: 800,
height: 600,
bitrate: 3000,
framerate: 24,
transferFunction: 3
},
}));
}, "Test that decodingInfo rejects if the video configuration has a transferFunction set to 3");