feat(scrcpy-decoder): record skipped frame count

This commit is contained in:
Simon Chan 2023-01-10 16:00:16 +08:00
parent 0df4c85ab1
commit b73737742c
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
6 changed files with 30 additions and 5 deletions

View file

@ -29,6 +29,11 @@ export class WebCodecsDecoder {
return this._frameRendered;
}
private _frameSkipped = 0;
public get frameSkipped() {
return this._frameSkipped;
}
private context: CanvasRenderingContext2D;
private decoder: VideoDecoder;
@ -43,6 +48,7 @@ export class WebCodecsDecoder {
this.decoder = new VideoDecoder({
output: (frame) => {
if (this.lastFrame) {
this._frameSkipped += 1;
this.lastFrame.close();
}
this.lastFrame = frame;