|
@@ -383,26 +383,26 @@ export default class Workers {
|
|
|
if(this.cachedStreams[this.setPtr] != null && this.cachedStreams[this.setPtr].byteLength != 0)
|
|
|
{
|
|
|
if(e.data.data == null){
|
|
|
- // this.executeFunction("stream", {
|
|
|
- // stream: this.cachedStreams[this.setPtr],
|
|
|
- // width: this.cachedResolution[this.setPtr].width,
|
|
|
- // height: this.cachedResolution[this.setPtr].height,
|
|
|
- // pts: this.cachedPtss[this.setPtr]
|
|
|
- // }),
|
|
|
- // this.executeFunction("signal", {
|
|
|
- // signal: this.cachedMetas[this.setPtr],
|
|
|
- // pts: this.cachedPtss[this.setPtr],
|
|
|
- // alreadyUpdateYUV: !0
|
|
|
- // })
|
|
|
+ this.executeFunction("stream", {
|
|
|
+ stream: this.cachedStreams[this.setPtr],
|
|
|
+ width: this.cachedResolution[this.setPtr].width,
|
|
|
+ height: this.cachedResolution[this.setPtr].height,
|
|
|
+ pts: this.cachedPtss[this.setPtr]
|
|
|
+ }),
|
|
|
+ this.executeFunction("signal", {
|
|
|
+ signal: this.cachedMetas[this.setPtr],
|
|
|
+ pts: this.cachedPtss[this.setPtr],
|
|
|
+ alreadyUpdateYUV: !0
|
|
|
+ })
|
|
|
}
|
|
|
else{
|
|
|
this.updateDropFrame += 1
|
|
|
}
|
|
|
- // this.decoderWorker.postMessage({
|
|
|
- // t: 2,
|
|
|
- // frameCnt: this.cachedPtss[this.setPtr],
|
|
|
- // buffer: this.cachedStreams[this.setPtr]
|
|
|
- // }, [this.cachedStreams[this.setPtr].buffer])
|
|
|
+ this.decoderWorker.postMessage({
|
|
|
+ t: 2,
|
|
|
+ frameCnt: this.cachedPtss[this.setPtr],
|
|
|
+ buffer: this.cachedStreams[this.setPtr]
|
|
|
+ }, [this.cachedStreams[this.setPtr].buffer])
|
|
|
}
|
|
|
this.getPtr = (this.getPtr + 1) % this.cachedLength
|
|
|
}
|
|
@@ -650,42 +650,42 @@ export default class Workers {
|
|
|
frameCnt: this.cachedPtss[e],
|
|
|
buffer: this.cachedStreams[e]
|
|
|
}, [this.cachedStreams[e].buffer]);
|
|
|
- // const a = Date.now()
|
|
|
- // , s = o - n
|
|
|
- // , l = a - o;
|
|
|
- // (s > 33 || l > 10) && defaultLogger.debug("[wwwarning] updateYUV takes ", s, " ms, postMessage takes ", l, " ms for index ", this.cachedPtss[e]),
|
|
|
- // o - this.lastRenderTs > 84 && this.JankTimes++,
|
|
|
- // o - this.lastRenderTs > 125 && this.bigJankTimes++,
|
|
|
- // this.lastRenderTs = o;
|
|
|
- // const u = o - n;
|
|
|
- // this.updateYUVCircular.add(u);
|
|
|
- // const c = this.cachedMetas[e];
|
|
|
- // if ((r = c == null ? void 0 : c.traceIds) != null && r.length) {
|
|
|
- // for (const h of c.traceIds)
|
|
|
- // if (this.traceIdMap.has(h)) {
|
|
|
- // const f = this.traceIdMap.get(h);
|
|
|
- // if (f != null) {
|
|
|
- // f.displayTime = Date.now(),
|
|
|
- // f.status = 3;
|
|
|
- // const d = f.receiveTime - f.startTime
|
|
|
- // , _ = f.readyTime - f.receiveTime
|
|
|
- // , g = f.displayTime - f.readyTime
|
|
|
- // , m = f.displayTime - f.startTime;
|
|
|
- // this.responseTimeArray.push(d),
|
|
|
- // this.processTimeArray.push(_),
|
|
|
- // this.displayTimeArray.push(g),
|
|
|
- // this.overallTimeArray.push(m),
|
|
|
- // this.traceIdMap.delete(h)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.cachedPtss[e] == this.moveStartPts && (this.MoveDisplayDelay = Date.now() - this.StartMovingTs)
|
|
|
- // if (this.inMovingMode) {
|
|
|
- // const h = Date.now()
|
|
|
- // , f = h - this.lastMoveDisplayTime;
|
|
|
- // this.moveDisplayCircular.add(f),
|
|
|
- // this.lastMoveDisplayTime = h
|
|
|
- // }
|
|
|
+ const a = Date.now()
|
|
|
+ , s = o - n
|
|
|
+ , l = a - o;
|
|
|
+ (s > 33 || l > 10) && defaultLogger.debug("[wwwarning] updateYUV takes ", s, " ms, postMessage takes ", l, " ms for index ", this.cachedPtss[e]),
|
|
|
+ o - this.lastRenderTs > 84 && this.JankTimes++,
|
|
|
+ o - this.lastRenderTs > 125 && this.bigJankTimes++,
|
|
|
+ this.lastRenderTs = o;
|
|
|
+ const u = o - n;
|
|
|
+ this.updateYUVCircular.add(u);
|
|
|
+ const c = this.cachedMetas[e];
|
|
|
+ if ((r = c == null ? void 0 : c.traceIds) != null && r.length) {
|
|
|
+ for (const h of c.traceIds)
|
|
|
+ if (this.traceIdMap.has(h)) {
|
|
|
+ const f = this.traceIdMap.get(h);
|
|
|
+ if (f != null) {
|
|
|
+ f.displayTime = Date.now(),
|
|
|
+ f.status = 3;
|
|
|
+ const d = f.receiveTime - f.startTime
|
|
|
+ , _ = f.readyTime - f.receiveTime
|
|
|
+ , g = f.displayTime - f.readyTime
|
|
|
+ , m = f.displayTime - f.startTime;
|
|
|
+ this.responseTimeArray.push(d),
|
|
|
+ this.processTimeArray.push(_),
|
|
|
+ this.displayTimeArray.push(g),
|
|
|
+ this.overallTimeArray.push(m),
|
|
|
+ this.traceIdMap.delete(h)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.cachedPtss[e] == this.moveStartPts && (this.MoveDisplayDelay = Date.now() - this.StartMovingTs)
|
|
|
+ if (this.inMovingMode) {
|
|
|
+ const h = Date.now()
|
|
|
+ , f = h - this.lastMoveDisplayTime;
|
|
|
+ this.moveDisplayCircular.add(f),
|
|
|
+ this.lastMoveDisplayTime = h
|
|
|
+ }
|
|
|
this.executeFunction("signal", {
|
|
|
signal: this.cachedMetas[e],
|
|
|
pts: this.cachedPtss[e],
|