|
@@ -11,6 +11,13 @@ let USER_ID = "987412365",
|
|
|
COS_PREFIX = "error-bitstreams-auto-uploaded-from-application/",
|
|
|
FRAME_COMPOSE_LENGTH = 5;
|
|
|
|
|
|
+let testFrame = 0;
|
|
|
+
|
|
|
+Number.prototype.padLeft = function (n, str) {
|
|
|
+ return Array(n - String(this).length + 1).join(str || '0') + this;
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
import CircularArray from "./CircularArray.js";
|
|
|
import SecondArray from "./SecondArray.js";
|
|
|
import v2Decoder from "./v2Decoder/index.js";
|
|
@@ -340,6 +347,7 @@ export default class Workers {
|
|
|
displayTime: 0,
|
|
|
status: 0,
|
|
|
};
|
|
|
+
|
|
|
this.traceIdMap.set(o, d);
|
|
|
const _ = setTimeout(() => {
|
|
|
if ((_ && clearTimeout(_), this.traceIdMap.has(o))) {
|
|
@@ -434,6 +442,7 @@ export default class Workers {
|
|
|
}
|
|
|
}
|
|
|
UpdateStats(e) {
|
|
|
+ // console.log('UpdateStats',e.data);
|
|
|
var i;
|
|
|
(i = this._rtcp.connection) == null ||
|
|
|
i.getStats(null).then((o) => {
|
|
@@ -886,11 +895,11 @@ export default class Workers {
|
|
|
// "接受webrtc请求(定时执行UpdateYUV):" +
|
|
|
// JSON.stringify(this.cachedMetas[e])
|
|
|
// );
|
|
|
- // console.log('回传',{
|
|
|
- // signal: this.cachedMetas[e],
|
|
|
- // pts: this.cachedPtss[e],
|
|
|
- // alreadyUpdateYUV: true,
|
|
|
- // })
|
|
|
+ console.log("回传", {
|
|
|
+ signal: this.cachedMetas[e],
|
|
|
+ pts: this.cachedPtss[e],
|
|
|
+ alreadyUpdateYUV: true,
|
|
|
+ });
|
|
|
this.executeFunction("signal", {
|
|
|
signal: this.cachedMetas[e],
|
|
|
pts: this.cachedPtss[e],
|
|
@@ -1034,21 +1043,29 @@ export default class Workers {
|
|
|
|
|
|
this.calcSendTimeDiff(_e);
|
|
|
|
|
|
- // console.log("流--", e.byteLength);
|
|
|
+ // console.log("hey", Date.now() - _e);
|
|
|
|
|
|
- console.log("gemer", {
|
|
|
- byteLength: e.byteLength,
|
|
|
- frame: fCnt,
|
|
|
- mediaLen: $,
|
|
|
- metaLen: j,
|
|
|
- serverTime: _e,
|
|
|
- it: it,
|
|
|
- start: c,
|
|
|
- end: ot,
|
|
|
- total: nt,
|
|
|
- isPureMeta: ot === nt,
|
|
|
- at: at,
|
|
|
- });
|
|
|
+ // console.log("流--", e.byteLength);
|
|
|
+ if (b !== 255) {
|
|
|
+ console.log("gemer1", {
|
|
|
+ byteLength: e.byteLength,
|
|
|
+ frame: fCnt,
|
|
|
+ mediaLen: $,
|
|
|
+ metaLen: j,
|
|
|
+ b: b,
|
|
|
+ cachedKey: rt,
|
|
|
+ serverTime: _e,
|
|
|
+ it: it,
|
|
|
+ start: c,
|
|
|
+ ot: ot,
|
|
|
+ nt: nt,
|
|
|
+ total: nt,
|
|
|
+ tt: tt,
|
|
|
+ et: et,
|
|
|
+ isPureMeta: ot === nt,
|
|
|
+ at: at,
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
// debugger;
|
|
|
const down = Date.now();
|
|
@@ -1166,7 +1183,7 @@ export default class Workers {
|
|
|
cachedKey: rt,
|
|
|
position: st,
|
|
|
};
|
|
|
- // console.warn('Dt',Dt);
|
|
|
+ // console.error('Dt',Dt);
|
|
|
if (this.inPanoMode) {
|
|
|
// console.log('接受webrtc请求:'+JSON.stringify(Mt));
|
|
|
this.executeFunction("signal", {
|
|
@@ -1198,18 +1215,6 @@ export default class Workers {
|
|
|
}
|
|
|
} else {
|
|
|
const At = this.hasFrmCntInCache(fCnt);
|
|
|
- // console.log("At", At, at, it);
|
|
|
- // console.log(
|
|
|
- // "this.cacheFrameComposes[At].buffer",
|
|
|
- // this.cacheFrameComposes[At],
|
|
|
- // );
|
|
|
-
|
|
|
- // if (At !== -1) {
|
|
|
- // console.log(
|
|
|
- // "this.cacheFrameComposes[At].buffer",
|
|
|
- // this.cacheFrameComposes[At].buffer
|
|
|
- // );
|
|
|
- // }
|
|
|
|
|
|
if (At != -1)
|
|
|
if (
|
|
@@ -1305,13 +1310,17 @@ export default class Workers {
|
|
|
position: st,
|
|
|
};
|
|
|
//有效Iframe
|
|
|
+
|
|
|
console.error("IT", fCnt, It);
|
|
|
- console.error("IT", fCnt, JSON.stringify(Rt));
|
|
|
+ // testFrame += 1;
|
|
|
+ // console.error("IT", fCnt, JSON.stringify(Rt));
|
|
|
+ console.error("traceIds", fCnt, Rt.traceIds.length);
|
|
|
// console.log("IT-fCnt", It.data);
|
|
|
+ // console.log("testFrame", testFrame);
|
|
|
|
|
|
// this.downloadBlob(
|
|
|
// It.data.subarray(It.metaLen, It.metaLen + It.mediaLen),
|
|
|
- // `${It.frameCnt}.v2p.264`,
|
|
|
+ // `${testFrame.padLeft(4,'0')}.frame.h264`,
|
|
|
// "application/octet-stream"
|
|
|
// );
|
|
|
|
|
@@ -1337,7 +1346,6 @@ export default class Workers {
|
|
|
value: Dt,
|
|
|
group: "joinRoom",
|
|
|
});
|
|
|
-
|
|
|
this.firstMediaReceived = true;
|
|
|
}
|
|
|
} else
|