Bug 1862098 [wpt PR 42856] - Prepare to enable HDR media capabilities by default., a=testonly

Automatic update from web-platform-tests
Prepare to enable HDR media capabilities by default.

I2S approved here:
https://groups.google.com/a/chromium.org/g/blink-dev/c/0neM-5GDn8I/m/ymH32sDDAgAJ

This cleans up an unnecessary feature flag and implements
the rest of the feature per the current spec. Adds a test
for mismatched color space information.

https://github.com/w3c/media-capabilities/issues/152 covers
how we should reject mismatched color parameters, though a
PR to add it to the spec hasn't yet been made. Safari has
implemented this behavior though, so copy it.

Bug: 1048045
Change-Id: I4fee62361c697922bb041724f4e4ac8c8e9d5c2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4989038
Reviewed-by: Johannes Kron <kron@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1217958}

--

wpt-commits: f1f1925c4876c73f932d35e0a038b619b861ed83
wpt-pr: 42856
This commit is contained in:
Dale Curtis 2023-11-08 08:33:17 +00:00 коммит произвёл moz-wptsync-bot
Родитель 5b44e328a8
Коммит 49fe199486
1 изменённых файлов: 29 добавлений и 9 удалений

Просмотреть файл

@ -3,7 +3,7 @@
// Minimal VideoConfiguration that will be allowed per spec. All optional // Minimal VideoConfiguration that will be allowed per spec. All optional
// properties are missing. // properties are missing.
var minimalVideoConfiguration = { const minimalVideoConfiguration = {
contentType: 'video/webm; codecs="vp09.00.10.08"', contentType: 'video/webm; codecs="vp09.00.10.08"',
width: 800, width: 800,
height: 600, height: 600,
@ -13,28 +13,29 @@ var minimalVideoConfiguration = {
// Minimal AudioConfiguration that will be allowed per spec. All optional // Minimal AudioConfiguration that will be allowed per spec. All optional
// properties are missing. // properties are missing.
var minimalAudioConfiguration = { const minimalAudioConfiguration = {
contentType: 'audio/webm; codecs="opus"', contentType: 'audio/webm; codecs="opus"',
}; };
// AudioConfiguration with optional spatialRendering param. // AudioConfiguration with optional spatialRendering param.
var audioConfigurationWithSpatialRendering = { const audioConfigurationWithSpatialRendering = {
contentType: 'audio/webm; codecs="opus"', contentType: 'audio/webm; codecs="opus"',
spatialRendering: true, spatialRendering: true,
}; };
// VideoConfiguration with optional hdrMetadataType, colorGamut, and // VideoConfiguration with optional hdrMetadataType, colorGamut, and
// transferFunction properties. // transferFunction properties.
var videoConfigurationWithDynamicRange = { const videoConfigurationWithDynamicRange = {
contentType: 'video/webm; codecs="vp09.00.10.08"', contentType: 'video/webm; codecs="vp09.00.10.08.00.09.16.09.00"',
width: 800, width: 800,
height: 600, height: 600,
bitrate: 3000, bitrate: 3000,
framerate: 24, framerate: 24,
hdrMetadataType: "smpteSt2086", hdrMetadataType: 'smpteSt2086',
colorGamut: "srgb", colorGamut: 'rec2020',
transferFunction: "srgb", transferFunction: 'pq',
} };
promise_test(t => { promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo()); return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo());
@ -363,6 +364,25 @@ promise_test(t => {
}); });
}, "Test that decodingInfo with hdrMetadataType, colorGamut, and transferFunction set returns a valid MediaCapabilitiesInfo objects"); }, "Test that decodingInfo with hdrMetadataType, colorGamut, and transferFunction set returns a valid MediaCapabilitiesInfo objects");
promise_test(t => {
// VP9 has a default color space of BT.709 in the codec string. So this will
// mismatch against the provided colorGamut and transferFunction.
let bt709Config = videoConfigurationWithDynamicRange;
bt709Config.contentType = 'video/webm; codecs="vp09.00.10.08"';
return navigator.mediaCapabilities
.decodingInfo({
type: 'file',
video: bt709Config,
})
.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');
assert_false(ability.supported);
});
}, 'Test that decodingInfo with mismatched codec color space is unsupported');
promise_test(t => { promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({
type: 'file', type: 'file',