|
@@ -398,8 +398,12 @@ if ("function" === typeof importScripts) {
|
|
|
|
|
|
Decoder.prototype.procBufItem = function (index) {
|
|
|
this.dumpJitterBufInfo("Entering Decoder.prototype.procBufItem");
|
|
|
- console.log(
|
|
|
- "[][Core][WASM], pts: %s, isIDR: %s, length: %s",
|
|
|
+ // console.log("[][Core][WASM], pts: %s, isIDR: %s, length: %s",
|
|
|
+ // mediaArray[index].pts,
|
|
|
+ // mediaArray[index].isIDR,
|
|
|
+ // mediaArray[index].media.length
|
|
|
+ // );
|
|
|
+ console.log("metaverse----core, pts: %s, isIDR: %s, length: %s",
|
|
|
mediaArray[index].pts,
|
|
|
mediaArray[index].isIDR,
|
|
|
mediaArray[index].media.length
|
|
@@ -730,7 +734,7 @@ if ("function" === typeof importScripts) {
|
|
|
printConsole.log("Going to open decoder " + String(Date.now()));
|
|
|
var ret0 = Module._openDecoder(0, decoder_type, LOG_LEVEL_WASM);
|
|
|
if (ret0 == 0) {
|
|
|
- self.decoder.startDecoding();
|
|
|
+ self.decoder.startDecoding(); //开始解码
|
|
|
self.postMessage({
|
|
|
t: MessageEvent.WASMReady,
|
|
|
wasm_ready: true,
|
|
@@ -777,17 +781,38 @@ if ("function" === typeof importScripts) {
|
|
|
|
|
|
Decoder.prototype.isIFrame = function (isIDR, mediaLen) {
|
|
|
// return data.isIDR && media.byteLength !=0
|
|
|
- return isIDR && mediaLen != 0;
|
|
|
+ let flag = isIDR && mediaLen != 0;
|
|
|
+ if(flag){
|
|
|
+ console.log('metaverse---------是IFrame');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ console.log('metaverse---------不是IFrame');
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
};
|
|
|
|
|
|
Decoder.prototype.isPFrame = function (isIDR, mediaLen) {
|
|
|
// return !data.isIDR && media.byteLength !=0
|
|
|
- return !isIDR && mediaLen != 0;
|
|
|
+ let flag = !isIDR && mediaLen != 0;
|
|
|
+ if(flag){
|
|
|
+ console.log('metaverse---------是PFrame');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ console.log('metaverse---------不是PFrame');
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
};
|
|
|
|
|
|
Decoder.prototype.isPureMeta = function (metaLen, mediaLen) {
|
|
|
// return media.byteLength == 0 && meta.byteLength !=0
|
|
|
- return mediaLen == 0 && metaLen != 0;
|
|
|
+ let flag = mediaLen == 0 && metaLen != 0;
|
|
|
+ if(flag){
|
|
|
+ console.log('metaverse---------是PureMeta');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ console.log('metaverse---------不是PureMeta');
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
};
|
|
|
|
|
|
Decoder.prototype.isInvalidPkt = function (isIDR, mediaLen, metaLen) {
|
|
@@ -838,10 +863,9 @@ if ("function" === typeof importScripts) {
|
|
|
var pts = data.frameCnt;
|
|
|
var meta = data.data.subarray(0, data.metaLen);
|
|
|
var media;
|
|
|
-
|
|
|
+
|
|
|
if (data.cached) {
|
|
|
- media = IFrameCacheBuffer[JSON.stringify(data.position)][key];
|
|
|
-
|
|
|
+ media = IFrameCacheBuffer[JSON.stringify(data.position)][key];
|
|
|
} else if (data.cacheRequest) {
|
|
|
media = data.data.subarray(data.metaLen, data.metaLen + data.mediaLen);
|
|
|
self.decoder.cacheFrame(data);
|
|
@@ -850,7 +874,6 @@ if ("function" === typeof importScripts) {
|
|
|
}
|
|
|
|
|
|
// console.log("[xmedia] media1", media);
|
|
|
-
|
|
|
// this.updateMediaMetaStats(data);
|
|
|
|
|
|
if (this.isFirstFrame) {
|
|
@@ -1019,6 +1042,7 @@ if ("function" === typeof importScripts) {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ /*
|
|
|
Decoder.prototype.decodePanorama = function (data) {
|
|
|
console.log("upload pano data");
|
|
|
var content = data.data.data;
|
|
@@ -1142,9 +1166,11 @@ if ("function" === typeof importScripts) {
|
|
|
return 1;
|
|
|
}
|
|
|
};
|
|
|
+ */
|
|
|
|
|
|
Decoder.prototype.decodeFrame = function (data) {
|
|
|
var content = data.media;
|
|
|
+
|
|
|
if (typeof content == "undefined") {
|
|
|
printConsole.error("null content in decoder", "5999");
|
|
|
return;
|
|
@@ -1157,7 +1183,7 @@ if ("function" === typeof importScripts) {
|
|
|
const index = data.frameCnt % CACHE_BUF_LENGTH;
|
|
|
mediaArray[index].decode_ts = Date.now();
|
|
|
var objData;
|
|
|
-
|
|
|
+
|
|
|
// debugger
|
|
|
if (content_size != 0) {
|
|
|
// var date = Date.now()
|
|
@@ -1179,6 +1205,7 @@ if ("function" === typeof importScripts) {
|
|
|
let start_ts = Date.now();
|
|
|
let ret = 0;
|
|
|
try {
|
|
|
+ console.log('metaverse----WASM:cacheBuffer:'+cacheBuffer+',content_size:'+content_size+',resultBuffer:'+resultBuffer);
|
|
|
ret = Module._decodeData(
|
|
|
0,
|
|
|
data.frameCnt,
|