mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 85ffed21f7a96f6d67a5a0110459d67f50cff624
This commit is contained in:
parent
bdfa6b0751
commit
ab5c81c0bb
240 changed files with 2991 additions and 918 deletions
|
@ -594,7 +594,8 @@ const trackFactories = {
|
|||
ctx.fillStyle = `rgb(${count%255}, ${count*count%255}, ${count%255})`;
|
||||
count += 1;
|
||||
ctx.fillRect(0, 0, width, height);
|
||||
// If signal is set, add a constant-color box to the video frame.
|
||||
// If signal is set, add a constant-color box to the video frame
|
||||
// at coordinates 10 to 30 in both X and Y direction.
|
||||
if (signal !== null) {
|
||||
ctx.fillStyle = `rgb(${signal}, ${signal}, ${signal})`;
|
||||
ctx.fillRect(10, 10, 20, 20);
|
||||
|
@ -623,7 +624,9 @@ function getVideoSignal(v) {
|
|||
context.drawImage(v, 0, 0, v.videoWidth, v.videoHeight);
|
||||
// Extract pixel value at position 20, 20
|
||||
let pixel = context.getImageData(20, 20, 1, 1);
|
||||
return (pixel.data[0] + pixel.data[1] + pixel.data[2]) / 3;
|
||||
// Use luma reconstruction to get back original value according to
|
||||
// ITU-R rec BT.709
|
||||
return (pixel.data[0] * 0.21 + pixel.data[1] * 0.72 + pixel.data[2] * 0.07);
|
||||
}
|
||||
|
||||
function detectSignal(t, v, value) {
|
||||
|
@ -633,6 +636,8 @@ function detectSignal(t, v, value) {
|
|||
if (signal !== null && signal < value + 1 && signal > value - 1) {
|
||||
resolve();
|
||||
} else {
|
||||
// We would like to wait for each new frame instead here,
|
||||
// but there seems to be no such callback.
|
||||
t.step_timeout(check, 100);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue