When copying a VideoFrame with a new visibleRect but no explicit display size, the display size is scaled proportionally. If the source frame has a very small display dimension relative to its visible size (e.g. displayHeight=1, visibleHeight=150), the scaled result can round to zero, which later triggers an assertion. Throw a TypeError instead, consistent with how explicit zero display dimensions are rejected in ValidateVideoFrameInit. Spec issue: https://github.com/w3c/webcodecs/issues/926 Differential Revision: https://phabricator.services.mozilla.com/D284123
18 lines
343 B
HTML
18 lines
343 B
HTML
<canvas id="c"></canvas>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const f0 = new VideoFrame(c, {
|
|
timestamp: 1993811,
|
|
displayWidth: 1280,
|
|
displayHeight: 1
|
|
})
|
|
const f1 = new VideoFrame(f0, {
|
|
visibleRect: {
|
|
width: 187,
|
|
height: 40
|
|
}
|
|
})
|
|
const _ = new VideoFrame(f1, { })
|
|
})
|
|
</script>
|