"use strict";function receiveMessage(a){var b=a.data;switch(channelId=a.data.channelId,b.type){case"sdpInfo":sdpInfo=b.data,framerate=0,setVideoRtpSession(sdpInfo);break;case"MediaData":if(isStepPlay===!0){buffering(b);break}videoCHID=b.data.rtspInterleave[1],"undefined"!=typeof videoRtpSessionsArray[videoCHID]&&videoRtpSessionsArray[videoCHID].parseRTPData(b.data.rtspInterleave,b.data.payload,isBackupCommand,dropout,b.info);break;case"initStartTime":videoRtpSessionsArray[videoCHID].initStartTime()}}function setVideoRtpSession(a){videoRtpSessionsArray=[],isStepPlay=!1;for(var b=0;b0&&(sendMessage("mediaSample",b.mediaSample),sendMessage("videoRender",b.frameData))}else sendMessage("drop",a.decodedData);null!=a.resolution&&sendMessage("MSEResolutionChanged",a.resolution),null!=a.ivsDraw&&sendMessage("ivsDraw",a)}function sendMessage(a,b){var c={type:a,data:b,channelId:channelId};"canvasRender"===a?postMessage(c,[b.buffer]):postMessage(c)}function VideoBufferList(){function a(){b=360,c=240,d=null,this._length=0,this.head=null,this.tail=null,this.curIdx=0}var b=0,c=0,d=null;return a.prototype={push:function(a,b,e,f,g,h){var i=new VideoBufferNode(a,b,e,f,g,h);return this._length>0?(this.tail.next=i,i.previous=this.tail,this.tail=i):(this.head=i,this.tail=i),this._length+=1,null!==d&&this._length>=c?d():0,i},pop:function(){var a=null;return this._length>1&&(a=this.head,this.head=this.head.next,null!==this.head?this.head.previous=null:this.tail=null,this._length-=1),a},setMaxLength:function(a){b=a,b>360?b=360:30>b&&(b=30)},setBUFFERING:function(a){c=a,c>240?c=240:6>c&&(c=6)},setBufferFullCallback:function(a){d=a},searchTimestamp:function(a){var b=this.head,c=this._length,d=1,e={failure:"Failure: non-existent node in this list."};if(0===c||0>=a||null===b)throw new Error(e.failure);for(;null!==b&&(b.timeStamp.timestamp!==a.timestamp||b.timeStamp.timestamp_usec!==a.timestamp_usec);)b=b.next,d++;return d>c?b=null:this.curIdx=d,b},findIFrame:function(a){var b=this.head,c=this._length,d=1,e={failure:"Failure: non-existent node in this list."};if(0===c)throw new Error(e.failure);for(;dc?b=null:this.curIdx=d,b}},new a}importScripts("./public.js","./mp4remux.js","./h264Session.js","./Decode/h264Decoder.js","./h265Session.js","./Decode/h265Decoder.js","./mjpegSession.js","./Decode/MjpegDecoder.js","./ivsSession.js","./Decode/jsFFMPEG.js","./hashMap.js"),sendMessage("WorkerReady"),addEventListener("message",receiveMessage,!1);var videoRtpSessionsArray=[],sdpInfo=null,rtpSession=null,decodeMode="",isBackupCommand=!1,isStepPlay=!1,isForward=!0,framerate=0,backupFrameInfo=null,videoCHID=-1,h264Session=null,h265Session=null,mjpegSession=null,ivsSession=null,channelId=null,dropout=1;