|
@@ -404,7 +404,17 @@ 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', mediaArray[index].pts, mediaArray[index].isIDR, mediaArray[index].media.length)
|
|
|
+ // if(mediaArray[index].media != null && mediaArray[index].media.byteLength != 0){
|
|
|
+ // console.log('[][Core][WASM], pts: %s, isIDR: %s, length: %s,trace_id: %s,time: %s', mediaArray[index].pts, mediaArray[index].isIDR, mediaArray[index].media.length,mediaArray[index].metadata.traceIds,new Date().getTime())
|
|
|
+ // }
|
|
|
+ self.postMessage({
|
|
|
+ t: 11,
|
|
|
+ pts: mediaArray[index].pts,
|
|
|
+ isIDR: mediaArray[index].isIDR,
|
|
|
+ mediaLength: mediaArray[index].media.length,
|
|
|
+ traceIds:mediaArray[index].metadata.traceIds,
|
|
|
+ time:new Date().getTime()
|
|
|
+ });
|
|
|
// var loginfo = 'pts: %s, isIDR: %s, length: %s', mediaArray[index].pts, mediaArray[index].isIDR, mediaArray[index].media.length
|
|
|
|
|
|
needToSkip = this.skipFrameUntilI && !mediaArray[index].isIDR
|
|
@@ -486,7 +496,7 @@ if ('function' === typeof importScripts) {
|
|
|
while (this.getNumOfPktToBeDec() > 0) {
|
|
|
index = this.readPtr
|
|
|
if (this.slotHasMedia(index)) {
|
|
|
- // dropMedia until IDR // \u6765\u4E0D\u53CA\u89E3\u7801\u4E22\u5E27
|
|
|
+ // dropMedia until IDR // 来不及解码丢帧
|
|
|
this.packetsDrop += 1
|
|
|
if (untilIDR) {
|
|
|
if (mediaArray[index].isIDR == true) {
|
|
@@ -637,14 +647,14 @@ if ('function' === typeof importScripts) {
|
|
|
t: MessageEvent.UpdateStats,
|
|
|
mediaBytesReceived: self.decoder.mediaBytesReceived,
|
|
|
metaBytesReceived: self.decoder.metaBytesReceived,
|
|
|
- packetsLost: self.decoder.packetsLost, // \u7F51\u7EDC\u4E22\u5E27
|
|
|
- packetsDrop: self.decoder.packetsDrop, // \u6765\u4E0D\u53CA\u89E3\u7801\u4E22\u5E27
|
|
|
+ packetsLost: self.decoder.packetsLost, // 网络丢帧
|
|
|
+ packetsDrop: self.decoder.packetsDrop, // 来不及解码丢帧
|
|
|
framesReceived: self.decoder.receivedMedia,
|
|
|
framesDecoded: self.decoder.receivedYUV,
|
|
|
framesRendered: self.decoder.receivedEmit,
|
|
|
framesReturned: framesReturned,
|
|
|
// framesAwait: leastReceivePts - lastProcessPts,
|
|
|
- framesAwait: self.decoder.getNumOfPktToBeDec(), // \u7B49\u5F85\u89E3\u7801\u7684\u5E27
|
|
|
+ framesAwait: self.decoder.getNumOfPktToBeDec(), // 等待解码的帧
|
|
|
decodeTimePerFrame: dtpf,
|
|
|
decodeTimeMaxFrame: dtmf,
|
|
|
sendOutBuffer: send_out_buffer,
|
|
@@ -1313,6 +1323,7 @@ if ('function' === typeof importScripts) {
|
|
|
// console.log(getRandomInt(30));
|
|
|
|
|
|
self.decoder = new Decoder()
|
|
|
+
|
|
|
netArray = []
|
|
|
|
|
|
var gTmpIdx = 0
|