|
@@ -12,6 +12,7 @@ const USER_ID = "987412365"
|
|
|
, FRAME_COMPOSE_LENGTH = 5;
|
|
|
|
|
|
import CircularArray from "./CircularArray.js"
|
|
|
+import ServerData from "./ServerData.js"
|
|
|
|
|
|
export default class Workers {
|
|
|
constructor(e, t) {
|
|
@@ -641,18 +642,21 @@ export default class Workers {
|
|
|
}),
|
|
|
this.firstUpdateYUV = !1
|
|
|
}
|
|
|
+
|
|
|
this.cachedStreams[e] != null && this.executeFunction("stream", {
|
|
|
stream: this.cachedStreams[e],
|
|
|
width: this.cachedResolution[e].width,
|
|
|
height: this.cachedResolution[e].height,
|
|
|
pts: this.cachedPtss[e]
|
|
|
});
|
|
|
- const o = Date.now();
|
|
|
- this.cachedStreams[e] != null && this.decoderWorker.postMessage({
|
|
|
- t: 2,
|
|
|
- frameCnt: this.cachedPtss[e],
|
|
|
- buffer: this.cachedStreams[e]
|
|
|
- }, [this.cachedStreams[e].buffer]);
|
|
|
+
|
|
|
+ // const o = Date.now();
|
|
|
+ // this.cachedStreams[e] != null && this.decoderWorker.postMessage({
|
|
|
+ // t: 2,
|
|
|
+ // frameCnt: this.cachedPtss[e],
|
|
|
+ // buffer: this.cachedStreams[e]
|
|
|
+ // }, [this.cachedStreams[e].buffer]);
|
|
|
+
|
|
|
// const a = Date.now()
|
|
|
// , s = o - n
|
|
|
// , l = a - o;
|
|
@@ -690,12 +694,12 @@ export default class Workers {
|
|
|
// this.lastMoveDisplayTime = h
|
|
|
// }
|
|
|
|
|
|
-
|
|
|
this.executeFunction("signal", {
|
|
|
- signal: this.cachedMetas[e],
|
|
|
- pts: this.cachedPtss[e],
|
|
|
+ signal: ServerData.star.signal, //this.cachedMetas[e],
|
|
|
+ pts: ServerData.star.pts, //this.cachedPtss[e],
|
|
|
alreadyUpdateYUV: !0
|
|
|
})
|
|
|
+
|
|
|
this.cachedRender[e] = !0;
|
|
|
this.getPtr = (this.getPtr + 1) % this.cachedLength
|
|
|
|
|
@@ -970,11 +974,11 @@ export default class Workers {
|
|
|
};
|
|
|
if (this.inPanoMode)
|
|
|
{
|
|
|
- this.executeFunction("signal", {
|
|
|
- signal: L,
|
|
|
- pts: -1,
|
|
|
- alreadyUpdateYUV: !0
|
|
|
- });
|
|
|
+ // this.executeFunction("signal", {
|
|
|
+ // signal: L,
|
|
|
+ // pts: -1,
|
|
|
+ // alreadyUpdateYUV: !0
|
|
|
+ // });
|
|
|
return !0;
|
|
|
}
|
|
|
this.decoderWorker.postMessage(z, [D.buffer]);
|
|
@@ -1026,45 +1030,46 @@ export default class Workers {
|
|
|
defaultLogger.debug("hhh")
|
|
|
}
|
|
|
dataHandle(e) {
|
|
|
- if(this.saveframe){
|
|
|
- this.decoderWorker.postMessage({
|
|
|
- t: 6
|
|
|
- }),
|
|
|
- this.saveframe = !1
|
|
|
- }
|
|
|
+ // if(this.saveframe){
|
|
|
+ // this.decoderWorker.postMessage({
|
|
|
+ // t: 6
|
|
|
+ // }),
|
|
|
+ // this.saveframe = !1
|
|
|
+ // }
|
|
|
|
|
|
- if(this.SaveMediaStream){
|
|
|
- this.decoderWorker.postMessage({
|
|
|
- t: 7
|
|
|
- }),
|
|
|
- this.SaveMediaStream = !1
|
|
|
- }
|
|
|
+ // if(this.SaveMediaStream){
|
|
|
+ // this.decoderWorker.postMessage({
|
|
|
+ // t: 7
|
|
|
+ // }),
|
|
|
+ // this.SaveMediaStream = !1
|
|
|
+ // }
|
|
|
|
|
|
const t = new Uint8Array(e);
|
|
|
if (t.length >= 4 && this.isHeartBeatPacket(t.buffer, t.length) == !0)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
if (t.length > 36 && this.unmarshalStream(t.buffer) == !0) {
|
|
|
- if(this.reconnectSignal){
|
|
|
- this.executeFunction("reconnectedFrame", {});
|
|
|
- this.reconnectSignal = !1
|
|
|
- }
|
|
|
+ // if(this.reconnectSignal){
|
|
|
+ // this.executeFunction("reconnectedFrame", {});
|
|
|
+ // this.reconnectSignal = !1
|
|
|
+ // }
|
|
|
return
|
|
|
}
|
|
|
- if (t.length > 20 && this.unmarshalPano(t.buffer) == !0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.noWasmBytesReceived += e.byteLength;
|
|
|
- const r = JSON.parse(this.Stringify(t));
|
|
|
+ // if (t.length > 20 && this.unmarshalPano(t.buffer) == !0)
|
|
|
+ // {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // this.noWasmBytesReceived += e.byteLength;
|
|
|
+ // const r = JSON.parse(this.Stringify(t));
|
|
|
|
|
|
- console.log('接收webrtc的json数据:'+JSON.stringify(r));
|
|
|
- this.executeFunction("signal", {
|
|
|
- signal: r,
|
|
|
- pts: -1,
|
|
|
- alreadyUpdateYUV: !0
|
|
|
- })
|
|
|
+ // console.log('接收webrtc的json数据:'+JSON.stringify(r));
|
|
|
+ // this.executeFunction("signal", {
|
|
|
+ // signal: r,
|
|
|
+ // pts: -1,
|
|
|
+ // alreadyUpdateYUV: !0
|
|
|
+ // })
|
|
|
}
|
|
|
changePanoMode(e) {
|
|
|
this.inPanoMode = e
|
|
@@ -1235,8 +1240,8 @@ export default class Workers {
|
|
|
maxServerDiff: J,
|
|
|
streamType: WASM_Version
|
|
|
};
|
|
|
- return this.lastReturnFrames = this.returnFrames,
|
|
|
- this.lastReceivedEmit = this.receivedEmit,
|
|
|
- re
|
|
|
+ this.lastReturnFrames = this.returnFrames;
|
|
|
+ this.lastReceivedEmit = this.receivedEmit;
|
|
|
+ return re
|
|
|
}
|
|
|
}
|