Skip to content

Commit

Permalink
Drop duplicate and out of order VideoFrames in MSTP
Browse files Browse the repository at this point in the history
Drop videoframes which arrive on a track with duplicate or out of order timestamps, to make
it easier for apps to handle frames without worrying about order.

Bug: 1271175
Change-Id: I20a7312a31d8122c77dccde6d5064b27f0637db3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3304220
Commit-Queue: Tony Herre <toprice@chromium.org>
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Johannes Kron <kron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946371}
  • Loading branch information
Tony Herre authored and chromium-wpt-export-bot committed Nov 30, 2021
1 parent b66d9d9 commit a50d831
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ <h1 class="instructions">Description</h1>
return promise;
}, "Tests that the reader of a video MediaStreamTrackProcessor produces VideoFrame objects and is closed on track stop while running on a worker");

function makeVideoFrame() {
function makeVideoFrame(timestamp) {
const canvas = new OffscreenCanvas(100, 100);
const ctx = canvas.getContext('2d');
return new VideoFrame(canvas);
return new VideoFrame(canvas, {timestamp});
}

promise_test(async t => {
Expand Down Expand Up @@ -80,7 +80,7 @@ <h1 class="instructions">Description</h1>
// Write video frames in different tasks to "slowly" settle the pending read
// requests.
for (let i = 0; i<numOperations; i++) {
await writer.write(makeVideoFrame());
await writer.write(makeVideoFrame(i));
await new Promise(r=>setTimeout(r,0));
}

Expand Down

0 comments on commit a50d831

Please sign in to comment.