|
@ -67,15 +67,14 @@ Decoder.prototype.decode=function(){ |
|
|
Module.HEAPU8.set(typedArray, cacheBuffer); |
|
|
Module.HEAPU8.set(typedArray, cacheBuffer); |
|
|
// totalSize += size
|
|
|
// totalSize += size
|
|
|
// console.log("[" + (++readerIndex) + "] Read len = ", size + ", Total size = " + totalSize)
|
|
|
// console.log("[" + (++readerIndex) + "] Read len = ", size + ", Total size = " + totalSize)
|
|
|
const t2 = new Date().getTime()-decodet1; |
|
|
|
|
|
console.log("decode time:"+t2+" len:"+size);//+" data:"+typedArray.toString(16));
|
|
|
|
|
|
Module._decodeData(cacheBuffer, size, pts++) |
|
|
Module._decodeData(cacheBuffer, size, pts++) |
|
|
if (cacheBuffer != null) { |
|
|
if (cacheBuffer != null) { |
|
|
Module._free(cacheBuffer); |
|
|
Module._free(cacheBuffer); |
|
|
cacheBuffer = null; |
|
|
cacheBuffer = null; |
|
|
} |
|
|
} |
|
|
H265Frame.shift(); |
|
|
H265Frame.shift(); |
|
|
decodet1=new Date().getTime(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -84,7 +83,7 @@ Decoder.prototype.startDecoding = function (interval) { |
|
|
if (this.decodeTimer) { |
|
|
if (this.decodeTimer) { |
|
|
clearInterval(this.decodeTimer); |
|
|
clearInterval(this.decodeTimer); |
|
|
} |
|
|
} |
|
|
this.decodeTimer = setInterval(this.decode, interval); |
|
|
this.decodeTimer = setInterval(this.decode, 0);//interval);
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
Decoder.prototype.pauseDecoding = function () { |
|
|
Decoder.prototype.pauseDecoding = function () { |
|
@ -155,6 +154,9 @@ Decoder.prototype.decode_seq=function() { |
|
|
d: obj |
|
|
d: obj |
|
|
}; |
|
|
}; |
|
|
self.postMessage(objData, [objData.d.data.buffer]); |
|
|
self.postMessage(objData, [objData.d.data.buffer]); |
|
|
|
|
|
const t2 = new Date().getTime()-decodet1; |
|
|
|
|
|
console.log("decode time:"+t2+" len:"+size);//+" data:"+typedArray.toString(16));
|
|
|
|
|
|
decodet1=new Date().getTime(); |
|
|
// displayVideoFrame(obj);
|
|
|
// displayVideoFrame(obj);
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -171,6 +173,7 @@ Decoder.prototype.decode_seq=function() { |
|
|
}; |
|
|
}; |
|
|
self.postMessage(objData); |
|
|
self.postMessage(objData); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Decoder.prototype.sendVideoFrame = function(data,len){ |
|
|
Decoder.prototype.sendVideoFrame = function(data,len){ |
|
|