1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14

content / test / data / gpu / webcodecs / webrtc-peer-connection-worker.js [blame]

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

importScripts('webcodecs_common.js');

self.onmessage = async e => {
  const source = new CanvasSource(e.data.width, e.data.height);
  const writer = e.data.writable.getWriter();
  // write frames continuously until test is completed
  setInterval(async () => {
    await writer.write(await source.getNextFrame());
  }, 100);
};