summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-corner-case-videos.html
blob: 0d7061c83f61dbc1634cee0d2813f66b1e034480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!--
Copyright (c) 2019 The Khronos Group Inc.
Use of this source code is governed by an MIT-style license that can be
found in the LICENSE.txt file.
-->

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
<script src="../../../js/js-test-pre.js"></script>
<script src="../../../js/webgl-test-utils.js"></script>
<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
<script src="../../../js/tests/texture-corner-case-videos.js"></script>
</head>
<body>
<canvas id="example" width="32" height="32"></canvas>
<canvas id="c2d" width="32" height="32"></canvas>
<div id="description"></div>
<div id="console"></div>
<script>
"use strict";
function testPrologue(gl) {
    return true;
}

generateTest(
    'Verify uploading various corner-case videos to 2D textures',
    "RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "", 1,
    [
        // Regression test for http://crbug.com/701060.
        // Generated with the following command line:
        // ffmpeg -r 25 -i red-green-480-272.png -vframes 10 -vcodec h264 -vf setsar=136:135,setdar=16:9 -pix_fmt yuv420p ...
        {
            comment: "Video whose natural size is larger than coded size due to uncommon pixel shape (Sample Aspect Ratio)",
            src: "../../../resources/red-green-480x272-sar-136x135-dar-16x9.mp4",
            type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
            // A fairly high tolerance is used because colorspace conversion seems to differ widely between
            // hardware-accelerated video decoders. At least on Windows / NVIDIA, this test was seen to convert
            // (0,255,0) to (13,238,14), and (255,0,0) to (238,14,14).
            tolerance: 18,
        }
    ])();
</script>
</body>
</html>