| 1 |
- !function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";var a=r(1);Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserDetect=function(){var e=navigator.userAgent.toLowerCase(),t=navigator.appName,r=null;"Microsoft Internet Explorer"===t||e.indexOf("trident")>-1||e.indexOf("edge/")>-1?(r="ie","Microsoft Internet Explorer"===t?(e=/msie ([0-9]{1,}[\.0-9]{0,})/.exec(e),r+=parseInt(e[1])):e.indexOf("trident")>-1?r+=11:e.indexOf("edge/")>-1&&(r="edge")):e.indexOf("safari")>-1?r=e.indexOf("chrome")>-1?"chrome":"safari":e.indexOf("firefox")>-1&&(r="firefox");return r},t.BrowserDetectDetail=function(){var e=navigator.userAgent.toLowerCase(),t=navigator.platform.toLowerCase(),r=e.match(/(opera|ie|trident|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|rv:(\d.?)|$)/)||[null,"unknown",0],a=("ie"==r[1]||"trident"==r[1])&&document.documentMode,n={name:"version"==r[1]?r[3]:"trident"==r[1]?"ie":r[1],version:a||parseFloat("opera"==r[1]&&r[4]?r[4]:"trident"==r[1]&&r[5]?r[5]:r[2]),Platform:{name:e.match(/ip(?:ad|od|hone)/)?"ios":(e.match(/(?:webos|android)/)||t.match(/mac|win|linux/)||["other"])[0]}};n[n.name]=!0,n[n.name+parseInt(n.version,10)]=!0,n.Platform[n.Platform.name]=!0,n.Platform.ios&&(n.Platform.ipod=!0);n.Engine={};var i=function(e,t){n.Engine.name=e,n.Engine[e+t]=!0,n.Engine.version=t};if(n.ie)switch(n.Engine.trident=!0,n.version){case 6:i("trident",4);break;case 7:i("trident",5);break;case 8:i("trident",6)}n.firefox&&(n.Engine.gecko=!0,n.version>=3?i("gecko",19):i("gecko",18));if(n.safari||n.chrome)switch(n.Engine.webkit=!0,n.version){case 2:i("webkit",419);break;case 3:i("webkit",420);break;case 4:i("webkit",525)}n.opera&&(n.Engine.presto=!0,n.version>=9.6?i("presto",960):n.version>=9.5?i("presto",950):i("presto",925));if("unknown"==n.name)switch((e.match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":n.Engine.webkit=!0;break;case"gecko":n.Engine.gecko=!0}return n},t.CommonAudioUtil=function(){var e=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384],t=function(e,t,r){var a=0,n=0;for(a=0;a<r&&!(e<t[n]);a++)n++;return a},r=function(r,a){var n=0,i=0,o=0,s=0,u=0;return i=t(n=r>0?r:8191&-r,e,15)-6,o=i+(a>>6&15)-13,s=(0===n?32:i>=0?n>>i:n<<-i)*(a&parseInt("077",8))+48>>4,u=o>=0?s<<o&32767:s>>-o,(r^a)<0?-u:u};this.g726InitState=function(){var e={},t=0;for(e.pp=new Array(2),e.zp=new Array(6),e.pk=new Array(2),e.dq=new Array(6),e.sr=new Array(2),e.yl=34816,e.yu=544,e.dms=0,e.dml=0,e.ppp=0,t=0;t<2;t++)e.pp[t]=0,e.pk[t]=0,e.sr[t]=32;for(t=0;t<6;t++)e.zp[t]=0,e.dq[t]=32;return e.td=0,e},this.predictorZero=function(e){var t=0,a=0;for(a=r(e.zp[0]>>2,e.dq[0]),t=1;t<6;t++)a+=r(e.zp[t]>>2,e.dq[t]);return a},this.predictorPole=function(e){return r(e.pp[1]>>2,e.sr[1])+r(e.pp[0]>>2,e.sr[0])},this.stepSize=function(e){var t=0,r=0,a=0;return e.ppp>=256?e.yu:(t=e.yl>>6,r=e.yu-t,a=e.ppp>>2,r>0?t+=r*a>>6:r<0&&(t+=r*a+63>>6),t)},this.quantize=function(r,a,n,i){var o=0,s=0,u=0;return o=Math.abs(r),s=t(o>>1,e,15),u=t((s<<7)+(o<<7>>s&127)-(a>>2),n,i),r<0?1+(i<<1)-u:0===u?1+(i<<1):u},this.reconstruct=function(e,t,r){var a=0,n=0;return(a=t+(r>>2))<0?e?-32768:0:(n=128+(127&a)<<7>>14-(a>>7&15),e?n-32768:n)},this.update=function(r,a,n,i,o,s,u,f){var l=0,c=0,p=0,d=0,_=0,m=0,h=0,g=0,v=0,y=0,b=0,D=0,S=0,T=0;if(T=u<0?1:0,c=32767&o,v=f.yl>>15,D=f.yl>>10&31,S=32+D<<v,b=(y=v>9?31744:S)+(y>>1)>>1,g=0===f.td?0:c<=b?0:1,f.yu=a+(n-a>>5),f.yu<544?f.yu=544:f.yu>5120&&(f.yu=5120),f.yl+=f.yu+(-f.yl>>6),1===g)f.pp[0]=0,f.pp[1]=0,f.zp[0]=0,f.zp[1]=0,f.zp[2]=0,f.zp[3]=0,f.zp[4]=0,f.zp[5]=0,d=0;else for(m=T^f.pk[0],d=f.pp[1]-(f.pp[1]>>7),0!==u&&((h=m?f.pp[0]:-f.pp[0])<-8191?d-=256:d+=h>8191?255:h>>5,T^f.pk[1]?d<=-12160?d=-12288:d>=12416?d=12288:d-=128:d<=-12416?d=-12288:d>=12160?d=12288:d+=128),f.pp[1]=d,f.pp[0]-=f.pp[0]>>8,0!==u&&(0===m?f.pp[0]+=192:f.pp[0]-=192),_=15360-d,f.pp[0]<-_?f.pp[0]=-_:f.pp[0]>_&&(f.pp[0]=_),l=0;l<6;l++)f.zp[l]-=5===r?f.zp[l]>>9:f.zp[l]>>8,32767&o&&((o^f.dq[l])>=0?f.zp[l]+=128:f.zp[l]-=128);for(l=5;l>0;l--)f.dq[l]=f.dq[l-1];return 0===c?f.dq[0]=o>=0?32:64544:(p=t(c,e,15),f.dq[0]=o>=0?(p<<6)+(c<<6>>p):(p<<6)+(c<<6>>p)-1024),f.sr[1]=f.sr[0],0===s?f.sr[0]=32:s>0?(p=t(s,e,15),f.sr[0]=(p<<6)+(s<<6>>p)):s>-32768?(p=t(c=-s,e,15),f.sr[0]=(p<<6)+(c<<6>>p)-1024):f.sr[0]=64544,f.pk[1]=f.pk[0],f.pk[0]=T,f.td=1===g?0:d<-11776?1:0,f.dms+=i-f.dms>>5,f.dml+=(i<<2)-f.dml>>7,1===g?f.ppp=256:a<1536?f.ppp+=512-f.ppp>>4:1===f.td?f.ppp+=512-f.ppp>>4:Math.abs((f.dms<<2)-f.dml)>=f.dml>>3?f.ppp+=512-f.ppp>>4:f.ppp+=-f.ppp>>4,f}},t.Texture=t.Shader=t.Script=t.Queue=t.Program=t.PLAYER_STATE_CODE=void 0,t.VideoBufferList=function(){var e=0,t=0,r=null;function a(){e=360,t=240,r=null,this._length=0,this.head=null,this.tail=null,this.curIdx=0}return a.prototype={push:function(e,a,n,i,o,s){var u=new VideoBufferNode(e,a,n,i,o,s);return this._length>0?(this.tail.next=u,u.previous=this.tail,this.tail=u):(this.head=u,this.tail=u),this._length+=1,null!==r&&this._length>=t&&r(),u},pop:function(){var e=null;return this._length>1&&(e=this.head,this.head=this.head.next,null!==this.head?this.head.previous=null:this.tail=null,this._length-=1),e},setMaxLength:function(t){(e=t)>360?e=360:e<30&&(e=30)},setBUFFERING:function(e){(t=e)>240?t=240:t<6&&(t=6)},setBufferFullCallback:function(e){r=e},searchTimestamp:function(e){var t=this.head,r=this._length,a=1;if(0===r||e<=0||null===t)throw new Error("Failure: non-existent node in this list.");for(;null!==t&&(t.timeStamp.timestamp!==e.timestamp||t.timeStamp.timestamp_usec!==e.timestamp_usec);)t=t.next,a++;return r<a?t=null:this.curIdx=a,t},findIFrame:function(e){var t=this.head,r=this._length,a=1;if(0===r)throw new Error("Failure: non-existent node in this list.");for(;a<this.curIdx;)t=t.next,a++;if(!0===e)for(;"I"!==t.frameType;)t=t.next,a++;else for(;"I"!==t.frameType;)t=t.previous,a--;return r<a?t=null:this.curIdx=a,t}},new a},t.debug=t.commonOption=t.YUV2RGBMODE=void 0,t.formAuthorizationResponse=function(e,t,r,a,n,i){var s=null,u=null;return s=(0,o.default)(e+":"+a+":"+t).toLowerCase(),u=(0,o.default)(i+":"+r).toLowerCase(),(0,o.default)(s+":"+n+":"+u).toLowerCase()},t.pubsub=void 0,t.stringToUint8Array=function(e){for(var t=e.length,r=new Uint8Array(new ArrayBuffer(t)),a=0;a<t;a++)r[a]=e.charCodeAt(a);return r};var n=a(r(6)),i=a(r(7)),o=a(r(8)),s={log:function(){},error:function(){},count:function(){},info:function(){}};t.debug=s;var u={};t.commonOption=u,u.VIDEOENCODETYPE={H264:1,H265:2},u.AUDIOENCODETYPE={G711A:1,G711U:2};t.YUV2RGBMODE={BT709:"bt709",FULLRANGE:"fullrange",BT601:"bt601",LIMITED:"limited"};t.PLAYER_STATE_CODE={TIMEOUT:101,NOT_SUPPORT_MIME:102,LIMIT_SPEED:103,ADDBUFFER_ERROR:104,MSE_ERROR:105,UNSUPPORTED_AUDIO_FORMAT:201,OPEN_WS_ERROR:202,KMS_NOT_CONNECTED:203,CHANNEL_AUTH_FAILED:204,PASSWORD_NOT_INITIALIZE:205,MAX_NUMBER_CONNECTION:206,WS_CLOSED:207,RTSP_NOT_FOUND:404,INVALID_RANGE:457,INTERNAL_SERVER_ERROR:500,SERVICE_UNAVILABLE:503,TALK_SERVICE_UNAVILABLE:504,TALK_BUSY_LINE:505,TALK_ClOSE:506};var f=function(){function e(){}return e.createFromElementId=function(t){for(var r=document.getElementById(t),a="",n=r.firstChild;n;)3===n.nodeType&&(a+=n.textContent),n=n.nextSibling;var i=new e;return i.type=r.type,i.source=a,i},e.createFromSource=function(t,r){var a=new e;return a.type=t,a.source=r,a},e}();t.Script=f;var l=function(){return function(e,t){if("x-shader/x-fragment"===t.type)this.shader=e.createShader(e.FRAGMENT_SHADER);else{if("x-shader/x-vertex"!==t.type)return void error("Unknown shader type: "+t.type);this.shader=e.createShader(e.VERTEX_SHADER)}e.shaderSource(this.shader,t.source),e.compileShader(this.shader),e.getShaderParameter(this.shader,e.COMPILE_STATUS)||error("An error occurred compiling the shaders: "+e.getShaderInfoLog(this.shader))}}();t.Shader=l;var c=function(){function e(e){this.gl=e,this.program=this.gl.createProgram()}return e.prototype={attach:function(e){this.gl.attachShader(this.program,e.shader)},link:function(){this.gl.linkProgram(this.program)},use:function(){this.gl.useProgram(this.program)},getAttributeLocation:function(e){return this.gl.getAttribLocation(this.program,e)},setMatrixUniform:function(e,t){var r=this.gl.getUniformLocation(this.program,e);this.gl.uniformMatrix4fv(r,!1,t)}},e}();t.Program=c;var p=function(){var e=null;function t(e,t,r){this.gl=e,this.size=t,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),this.format=r||e.LUMINANCE,e.texImage2D(e.TEXTURE_2D,0,this.format,t.w,t.h,0,this.format,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.pixelStorei(e.UNPACK_ALIGNMENT,1)}return t.prototype={fill:function(e,t){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),t?r.texSubImage2D(r.TEXTURE_2D,0,0,0,this.size.w,this.size.h,this.format,r.UNSIGNED_BYTE,e):r.texImage2D(r.TEXTURE_2D,0,this.format,this.size.w,this.size.h,0,this.format,r.UNSIGNED_BYTE,e)},bind:function(t,r,a){var n=this.gl;e||(e=[n.TEXTURE0,n.TEXTURE1,n.TEXTURE2]),n.activeTexture(e[t]),n.bindTexture(n.TEXTURE_2D,this.texture),n.uniform1i(n.getUniformLocation(r.program,a),t)}},t}();t.Texture=p;var d=function(){function e(){(0,n.default)(this,e),this.first=null,this.size=0}return(0,i.default)(e,[{key:"enqueue",value:function(e){if(null===this.first)this.first=e;else{for(var t=this.first;null!==t.next;)t=t.next;t.next=e}this.size+=1}},{key:"dequeue",value:function(){var e=null;return null!==this.first&&(e=this.first,this.first=this.first.next,this.size-=1),e}},{key:"clear",value:function(){this.size=0,this.first=null}}]),e}();t.Queue=d;var _={},m=-1,h={publish:function(e,t){if(!_[e])return!1;for(var r=_[e],a=r?r.length:0;a--;)r[a].func(t);return this},subscribe:function(e,t){_[e]||(_[e]=[]);var r=(++m).toString();return _[e].push({token:r,func:t}),r},unsubscribe:function(e){for(var t in _)if(_[t])for(var r=0,a=_[t].length;r<a;r++)if(_[t][r].token===e)return _[t].splice(r,1),e},getTopicFunc:function(e){return _[e]?_[e]:[]}};t.pubsub=h},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(0),n=function(e){var t=[],r={},n=e||a.commonOption.VIDEOENCODETYPE.H264;function i(){for(var e in t)t[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)];a.commonOption.VIDEOENCODETYPE.H264===n?r.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]):a.commonOption.VIDEOENCODETYPE.H265===n&&(r.FTYP=new Uint8Array([105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,97,118,99,49,109,112,52,49])),r.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),r.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),r.STSC=r.STCO=r.STTS,r.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),r.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),r.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),r.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}t={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],hev1:[],hvcC:[]};var o=function(e){for(var t=8,r=Array.prototype.slice.call(arguments,1),a=0;a<r.length;a++)t+=r[a].byteLength;var n=new Uint8Array(t),i=0;for(n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t,n.set(e,i),i+=4,a=0;a<r.length;a++)n.set(r[a],i),i+=r[a].byteLength;return n},s=function(e){return o(t.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),function(e){var r=e.config,a=r.length,n=new Uint8Array([0,0,0,0,3,23+a,0,1,0,4,15+a,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([a]).concat(r).concat([6,1,2]));return o(t.esds,n)}(e))},u=function(e){return"audio"===e.type?o(t.stsd,r.STSD_PREFIX,s(e)):o(t.stsd,r.STSD_PREFIX,function(e){var r=e.sps||[],i=e.pps||[],s=[],u=[],f=[],l=e.vps||[],c=0;for(c=0;c<l.length;c++)f.push((65280&l[c].byteLength)>>>8),f.push(255&l[c].byteLength),f=f.concat(Array.prototype.slice.call(l[c]));for(c=0;c<r.length;c++)s.push((65280&r[c].byteLength)>>>8),s.push(255&r[c].byteLength),s=s.concat(Array.prototype.slice.call(r[c]));for(c=0;c<i.length;c++)u.push((65280&i[c].byteLength)>>>8),u.push(255&i[c].byteLength),u=u.concat(Array.prototype.slice.call(i[c]));return a.commonOption.VIDEOENCODETYPE.H264===n?o(t.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(t.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length]).concat(s).concat([i.length]).concat(u)))):a.commonOption.VIDEOENCODETYPE.H265===n?o(t.hev1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(t.hvcC,new Uint8Array([1,e.general_profile_flag,(4278190080&e.general_profile_compatibility_flags)>>>24,(16711680&e.general_profile_compatibility_flags)>>>16,(65280&e.general_profile_compatibility_flags)>>>8,255&e.general_profile_compatibility_flags,(0xff0000000000&e.general_constraint_indicator_flags)>>>40,(0xff00000000&e.general_constraint_indicator_flags)>>>32,(4278190080&e.general_constraint_indicator_flags)>>>24,(16711680&e.general_constraint_indicator_flags)>>>16,(65280&e.general_constraint_indicator_flags)>>>8,255&e.general_constraint_indicator_flags,e.general_level_idc,240,0,252,252|e.chroma_format_idc,248|e.bitDepthLumaMinus8,248|e.bitDepthChromaMinus8,0,0,e.rate_layers_nested_length,3].concat([32,0,1]).concat(f).concat([33,0,1]).concat(s).concat([34,0,1]).concat(u)))):void 0}(e))},f=function(e){var a=null;return a="audio"===e.type?o(t.smhd,r.SMHD):o(t.vmhd,r.VMHD),o(t.minf,a,o(t.dinf,o(t.dref,r.DREF)),function(e){return o(t.stbl,u(e),o(t.stts,r.STTS),o(t.stsc,r.STSC),o(t.stsz,r.STSZ),o(t.stco,r.STCO))}(e))},l=function(e){return o(t.mdia,function(e){var r=e.timescale,a=e.duration;return o(t.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,a>>>24&255,a>>>16&255,a>>>8&255,255&a,85,196,0,0]))}(e),function(e){var a=null;return a="audio"===e.type?r.HDLR_AUDIO:r.HDLR_VIDEO,o(t.hdlr,a)}(e),f(e))},c=function(e){return o(t.trak,function(e){var r=e.id,a=e.duration,n=e.width,i=e.height;return o(t.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>>8&255,255&n,0,0,i>>>8&255,255&i,0,0]))}(e),l(e))},p=function(e){return o(t.mvex,function(e){var r=e.id,a=new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o(t.trex,a)}(e))},d=function(e){var r,a,n=(r=e.timescale,a=e.duration,o(t.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,a>>>24&255,a>>>16&255,a>>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))),i=c(e),s=p(e);return o(t.moov,n,i,s)},_=function(e,r){return"audio"===e.type?audioTrun(e,r):function(e,r){var a,n=null,i=null,s=0,u=r;if(null===(a=e.samples||[])[0].frameDuration)for(u+=24+4*a.length,n=trunHeader(a,u),s=0;s<a.length;s++)i=a[s],n=n.concat([(4278190080&i.size)>>>24,(16711680&i.size)>>>16,(65280&i.size)>>>8,255&i.size]);else for(n=function(e,t){return[0,0,3,5,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t,0,0,0,0]}(a,u+=24+4*a.length+4*a.length),s=0;s<a.length;s++)i=a[s],n=n.concat([(4278190080&i.frameDuration)>>>24,(16711680&i.frameDuration)>>>16,(65280&i.frameDuration)>>>8,255&i.frameDuration,(4278190080&i.size)>>>24,(16711680&i.size)>>>16,(65280&i.size)>>>8,255&i.size]);return o(t.trun,new Uint8Array(n))}(e,r)},m=function(e,r){return o(t.moof,function(e){var r=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return o(t.mfhd,r)}(e),function(e){var r,a,n;return r=o(t.tfhd,new Uint8Array([0,2,0,0,0,0,0,1])),a=o(t.tfdt,new Uint8Array([0,0,0,0,e.baseMediaDecodeTime>>>24&255,e.baseMediaDecodeTime>>>16&255,e.baseMediaDecodeTime>>>8&255,255&e.baseMediaDecodeTime])),n=_(e,72),o(t.traf,r,a,n)}(r))};return i.prototype={initSegment:function(e){var a=o(t.ftyp,r.FTYP),n=d(e),i=new Uint8Array(a.byteLength+n.byteLength);return i.set(a,0),i.set(n,a.byteLength),i},mediaSegment:function(e,r,a,n){var i=m(e,r),s=function(e){return o(t.mdat,e)}(a),u=null;return(u=new Uint8Array(i.byteLength+s.byteLength)).set(i),u.set(s,i.byteLength),u}},new i};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(){this.map={}};a.prototype={put:function(e,t){this.map[e]=t},get:function(e){return this.map[e]},containsKey:function(e){return e in this.map},containsValue:function(e){for(var t in this.map)if(this.map[t]===e)return!0;return!1},isEmpty:function(e){return 0===this.size()},clear:function(){for(var e in this.map)delete this.map[e]},remove:function(e){delete this.map[e]},keys:function(){var e=new Array;for(var t in this.map)e.push(t);return e},values:function(){var e=new Array;for(var t in this.map)e.push(this.map[t]);return e},size:function(){var e=0;for(var t in this.map)e++;return e}};var n=a;t.default=n},function(e,t,r){"use strict";var a=r(1),n=a(r(5)),i=a(r(11)),o=a(r(13)),s=a(r(15));r(0);importScripts("./libDecodeSDK.js"),addEventListener("message",function(e){var t=e.data;switch(y=e.data.channelId,t.type){case"sdpInfo":f=t.data,0,function(e){u=[],d=!1;for(var t=0;t<e.sdpInfo.length;t++){if(l=null,c=e.decodeMode,"SVAC2"===e.sdpInfo[t].codecName||"H264"===e.sdpInfo[t].codecName||"RAW"===e.sdpInfo[t].codecName&&e.mp4Codec&&"H264"===e.mp4Codec.VideoCodec)null===m&&(m=(0,n.default)()),(l=m).init(e.decodeMode),l.setFramerate(e.sdpInfo[t].Framerate),l.setGovLength(e.govLength),l.setCheckDelay(e.checkDelay),l.setLessRate(e.lessRateCanvas);else if("H265"===e.sdpInfo[t].codecName||"RAW"===e.sdpInfo[t].codecName&&e.mp4Codec&&"H265"===e.mp4Codec.VideoCodec){null===h&&(h=(0,i.default)()),l=h;var r={};r.h265AccelerationEnabled=e.h265AccelerationEnabled,l.init(r),l.setFramerate(e.sdpInfo[t].Framerate),l.setGovLength(e.govLength),l.setCheckDelay(e.checkDelay)}else"JPEG"===e.sdpInfo[t].codecName?(null===g&&(g=(0,o.default)()),(l=g).init(),l.setFramerate(e.sdpInfo[t].Framerate)):"stream-assist-frame"===e.sdpInfo[t].codecName&&(null===v&&(v=(0,s.default)()),(l=v).init());"undefined"!==typeof e.sdpInfo[t].Framerate&&e.sdpInfo[t].Framerate,null!==l&&(l.setBufferfullCallback(E),l.setReturnCallback(C),_=e.sdpInfo[t].RtpInterlevedID,u[_]=l)}}(f);break;case"MediaData":if(!0===d){!function(e){_=e.data.rtspInterleave[1],"undefined"!==typeof u[_]&&u[_].bufferingRtpData(e.data.rtspInterleave,e.data.header,e.data.payload)}(t);break}t.use&&"I"===t.use?(w=!0,"H265"===t.data.codecName?(null===S&&(S=(0,i.default)()).setReturnCallback(C),S.parseRTPDataIFrame(t.data.payload,t.info)):"H264"===t.data.codecName?(null===D&&(D=(0,n.default)()).setReturnCallback(C),D.parseRTPDataIFrame(t.data.payload,t.info)):"JPEG"===t.data.codecName&&(null===T&&(T=(0,o.default)()).setReturnCallback(C),T.parseRTPDataIFrame(t.data.payload,t.info))):(_=t.data.rtspInterleave[1],"undefined"!==typeof u[_]&&u[_].parseRTPData(t.data.rtspInterleave,t.data.payload,p,b,t.info,t.channel));break;case"initStartTime":u[_].initStartTime();break;case"end":I("end")}},!1),Module.onRuntimeInitialized=function(){Module._DECODE_Init(),I("WorkerReady")};var u=[],f=null,l=null,c="",p=!1,d=!1,_=-1,m=null,h=null,g=null,v=null,y=null,b=1,D=null,S=null,T=null,w=!1;function E(){u[_].findCurrent(),I("stepPlay","BufferFull")}function C(e){var t=null;if(null===e||"undefined"===typeof e)return t=null,void null;if("undefined"!==typeof e.error?(I("error",e.error),t=e.decodedData):(t=e.decodedData,null!==e.decodeMode&&"undefined"!==typeof e.decodeMode&&(c=e.decodeMode,I("setVideoTagMode",e.decodeMode))),null!=e.decodeStart&&(!w&&I("DecodeStart",e.decodeStart),c=e.decodeStart.decodeMode),null!==t&&"undefined"!==typeof t)if(void 0!==t.frameData&&null!==t.frameData&&"canvas"===c){!0===t.frameData.firstFrame&&!w&&I("firstFrame",t.frameData.firstFrame);var r={bufferIdx:t.frameData.bufferIdx,width:t.frameData.width,height:t.frameData.height,codecType:t.frameData.codecType,frameType:t.frameData.frameType,timeStamp:null,frameIndex:t.frameData.frameIndex};null!==t.timeStamp&&"undefined"!==typeof t.timeStamp&&(r.timeStamp=t.timeStamp),I("videoInfo",r),"undefined"!==typeof t.frameData.data&&null!==t.frameData.data&&(!0===w&&(t.frameData.option=t.frameData.option||{},t.frameData.option.decodeOnlyI=!0),I("canvasRender",t.frameData.data,t.frameData.option))}else if(null!==t.frameData&&"video"===c){null!==t.initSegmentData&&(I("codecInfo",t.codecInfo),I("initSegment",t.initSegmentData));r={codecType:t.frameData.codecType,frameIndex:t.frameData.frameIndex};"undefined"!==typeof t.frameData.width&&(r.width=t.frameData.width,r.height=t.frameData.height),I("videoInfo",r),I("videoTimeStamp",t.timeStamp),t.frameData.length>0&&(I("mediaSample",t.mediaSample),I("videoRender",t.frameData))}else I("drop",e.decodedData);null!=e.resolution&&I("MSEResolutionChanged",e.resolution),null!=e.ivsDraw&&I("ivsDraw",e)}function I(e,t,r){var a={type:e,data:t,channelId:y,option:r};"canvasRender"===e?postMessage(a,[t.buffer]):postMessage(a)}},function(e,t,r){"use strict";var a=r(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(0),i=a(r(10)),o=a(r(2)),s=a(r(3)),u=null,f=null;function l(){var e=7,t=7,r=2,a=3,i=4,o=5,l=8,c=16,p=32,d=255,_=0,m=null;function h(){_=0,m=new s.default}function g(r,n){var i=n,o=_+i>>a;return i=_+n&e,r[o]>>t-(i&t)&1}function v(e,t){var r=_>>a,n=8*(r+1)-_;if(n<8)for(var i=0;i<3;i++){var o=e[r+i];o=0==i?o>>n<<n:2==i?o&255>>8-n|1<<n:0,e.set([o],r+i)}else e.set([0],r),e.set([1],r+1)}function y(e,t){var r=0;if(1===t)r=g(e,0);else for(var a=0;a<t;a++)r=(r<<1)+g(e,a);return _+=t,r}function b(e,t){for(var a=0,n=0,i=t;_+i<8*e.length&&!g(e,i++);)a++;if(0===a)return _+=1,0;n=1<<a;for(var o=a-1;o>=0;o--,i++)n|=g(e,i)<<o;return _+=a*r+1,n-1}function D(e,t){var a=b(e,t);return 1&a?(a+1)/r:-a/r}function S(e){m.put("cpb_cnt_minus1",b(e,0)),m.put("bit_rate_scale",y(e,i)),m.put("cpb_size_scale",y(e,i));for(var t=m.get("cpb_cnt_minus1"),r=new Array(t),a=new Array(t),n=new Array(t),s=0;s<=t;s++)r[s]=b(e,0),a[s]=b(e,0),n[s]=y(e,1);m.put("bit_rate_value_minus1",r),m.put("cpb_size_value_minus1",a),m.put("cbr_flag",n),m.put("initial_cpb_removal_delay_length_minus1",y(e,o)),m.put("cpb_removal_delay_length_minus1",y(e,o)),m.put("dpb_output_delay_length_minus1",y(e,o)),m.put("time_offset_length",y(e,o))}return h.prototype={parse:function(e){_=0,m.clear(),m.put("forbidden_zero_bit",y(e,1)),m.put("nal_ref_idc",y(e,r)),m.put("nal_unit_type",y(e,o)),m.put("profile_idc",y(e,l)),m.put("profile_compatibility",y(e,l)),m.put("level_idc",y(e,l)),m.put("seq_parameter_set_id",b(e,0));var t=m.get("profile_idc");if((100===t||110===t||122===t||244===t||44===t||83===t||86===t||118===t||128===t||138===t||139===t||134===t)&&(m.put("chroma_format_idc",b(e,0)),m.get("chroma_format_idc")===a&&m.put("separate_colour_plane_flag",y(e,1)),m.put("bit_depth_luma_minus8",b(e,0)),m.put("bit_depth_chroma_minus8",b(e,0)),m.put("qpprime_y_zero_transform_bypass_flag",y(e,1)),m.put("seq_scaling_matrix_present_flag",y(e,1)),m.get("seq_scaling_matrix_present_flag"))){for(var i=m.get("chroma_format_idc")!==a?l:12,s=new Array(i),h=0;h<i;h++)if(s[h]=y(e,1),s[h])for(var g=h<6?c:64,T=8,w=8,E=0;E<g;E++)w&&(w=(T+D(e,0)+256)%256),T=0===w?T:w;m.put("seq_scaling_list_present_flag",s)}if(m.put("log2_max_frame_num_minus4",b(e,0)),m.put("pic_order_cnt_type",b(e,0)),0===m.get("pic_order_cnt_type"))m.put("log2_max_pic_order_cnt_lsb_minus4",b(e,0));else if(1===m.get("pic_order_cnt_type")){m.put("delta_pic_order_always_zero_flag",y(e,1)),m.put("offset_for_non_ref_pic",D(e,0)),m.put("offset_for_top_to_bottom_field",D(e,0)),m.put("num_ref_frames_in_pic_order_cnt_cycle",b(e,0));for(var C=0;C<m.get("num_ref_frames_in_pic_order_cnt_cycle");C++)m.put("num_ref_frames_in_pic_order_cnt_cycle",D(e,0))}return m.put("num_ref_frames",b(e,0)),m.put("gaps_in_frame_num_value_allowed_flag",y(e,1)),m.put("pic_width_in_mbs_minus1",b(e,0)),m.put("pic_height_in_map_units_minus1",b(e,0)),m.put("frame_mbs_only_flag",y(e,1)),0===m.get("frame_mbs_only_flag")&&m.put("mb_adaptive_frame_field_flag",y(e,1)),m.put("direct_8x8_interence_flag",y(e,1)),m.put("frame_cropping_flag",y(e,1)),1===m.get("frame_cropping_flag")&&(m.put("frame_cropping_rect_left_offset",b(e,0)),m.put("frame_cropping_rect_right_offset",b(e,0)),m.put("frame_cropping_rect_top_offset",b(e,0)),m.put("frame_cropping_rect_bottom_offset",b(e,0))),m.put("vui_parameters_present_flag",y(e,1)),m.get("vui_parameters_present_flag")&&function(e){m.put("aspect_ratio_info_present_flag",y(e,1)),m.get("aspect_ratio_info_present_flag")&&(m.put("aspect_ratio_idc",y(e,l)),m.get("aspect_ratio_idc")===d&&(v(e),m.put("sar_width",y(e,c)),v(e),m.put("sar_height",y(e,c)))),m.put("overscan_info_present_flag",y(e,1)),m.get("overscan_info_present_flag")&&m.put("overscan_appropriate_flag",y(e,1)),m.put("video_signal_type_present_flag",y(e,1)),m.get("video_signal_type_present_flag")&&(m.put("video_format",y(e,a)),m.put("video_full_range_flag",y(e,1)),m.put("colour_description_present_flag",y(e,1)),1==m.get("video_full_range_flag")&&(f=n.YUV2RGBMODE.FULLRANGE),m.get("colour_description_present_flag")&&(m.put("colour_primaries",y(e,l)),m.put("transfer_characteristics",y(e,l)),m.put("matrix_coefficients",y(e,l)),1!=m.get("colour_description_present_flag")||5!=m.get("colour_primaries")&&6!=m.get("colour_primaries")&&6!=m.get("transfer_characteristics")&&5!=m.get("matrix_coefficients")&&6!=m.get("matrix_coefficients")||(u=n.YUV2RGBMODE.BT601))),m.put("chroma_loc_info_present_flag",y(e,1)),m.get("chroma_loc_info_present_flag")&&(m.put("chroma_sample_loc_type_top_field",b(e,0)),m.put("chroma_sample_loc_type_bottom_field",b(e,0))),m.put("timing_info_present_flag",y(e,1)),m.get("timing_info_present_flag")&&(m.put("num_units_in_tick",y(e,p)),m.put("time_scale",y(e,p)),m.put("fixed_frame_rate_flag",y(e,1))),m.put("nal_hrd_parameters_present_flag",y(e,1)),m.get("nal_hrd_parameters_present_flag")&&S(e),m.put("vcl_hrd_parameters_present_flag",y(e,1)),m.get("vcl_hrd_parameters_present_flag")&&S(e),(m.get("nal_hrd_parameters_present_flag")||m.get("vcl_hrd_parameters_present_flag"))&&m.put("low_delay_hrd_flag",y(e,1)),m.put("pic_struct_present_flag",y(e,1)),m.put("bitstream_restriction_flag",y(e,1)),m.get("bitstream_restriction_flag")&&(m.put("motion_vectors_over_pic_boundaries_flag",y(e,1)),m.put("max_bytes_per_pic_denom",b(e,0)),m.put("max_bits_per_mb_denom",b(e,0)))}(e),!0},getSizeInfo:function(){var e=0,t=0;0===m.get("chroma_format_idc")?e=t=0:1===m.get("chroma_format_idc")?e=t=r:m.get("chroma_format_idc")===r?(e=r,t=1):m.get("chroma_format_idc")===a&&(0===m.get("separate_colour_plane_flag")?e=t=1:1===m.get("separate_colour_plane_flag")&&(e=t=0));var n=m.get("pic_width_in_mbs_minus1")+1,i=m.get("pic_height_in_map_units_minus1")+1,o=(r-m.get("frame_mbs_only_flag"))*i,s=0,u=0,f=0,l=0;1===m.get("frame_cropping_flag")&&(s=m.get("frame_cropping_rect_left_offset"),u=m.get("frame_cropping_rect_right_offset"),f=m.get("frame_cropping_rect_top_offset"),l=m.get("frame_cropping_rect_bottom_offset"));var p=n*c*(o*c);return{width:n*c-e*(s+u),height:o*c-t*(r-m.get("frame_mbs_only_flag"))*(f+l),decodeSize:p}},getSpsValue:function(e){return m.get(e)},getCodecInfo:function(){var e='video/mp4;codecs="avc1.';return e=e+m.get("profile_idc").toString(c)+(m.get("profile_compatibility")<15?"0"+m.get("profile_compatibility").toString(c):m.get("profile_compatibility").toString(c))+m.get("level_idc").toString(c)+'"'}},new h}var c=function(){var e=0,t=0,r=!1,a=(new Uint8Array(1048576),new Uint8Array(["0x00","0x00","0x00","0x01"]),new l),s=0,c=null,p=null,d=0,_=!1,m={frameData:null,timeStamp:null,initSegmentData:null,mediaSample:null,dropPercent:0,dropCount:0,codecInfo:"",playback:!1},h={timestamp:null,timezone:null},g={},v=null,y=null,b=!1,D=!1,S=0,T=0,w=0,E=!0,C=0,I=!1,A=0,M=null,x=null,P="",k=null,O=0,L=0,R={width:0,height:0},F=null,U=!1,B=null,N={SVAC2:15},z=0;function V(e){var t=0,r=e[t+=1];e[++t],t++;var a=String.fromCharCode.apply(null,e.subarray(t,t+16))||"";if(5===r&&a.indexOf("SPSVuiParse")>-1)for(var n=t+=16;n<e.length;n+=2){var i=e[n],o=e[n+1];1===i&&1===o&&(z=1)}}function j(e){e!==P&&("video"===e?P="video":(P="canvas",_=!0,m.frameData.firstFrame=!0))}function H(e,t,r,a){var n="";return e*t>1280&&!1===r&&a.encode_type!==N.SVAC2&&!a.h264_svc_flag?(n="video",U&&O>0&&O<=3&&(n="canvas")):n="canvas",n}function G(){this.decoder=new i.default,this.firstDiffTime=0,this.firstTime=0,this.lastMSW=0}return G.prototype={setReturnCallback:function(e){this.rtpReturnCallback=e},setBufferfullCallback:function(e){null!==this.videoBufferList&&this.videoBufferList.setBufferFullCallback(e)},getVideoBuffer:function(e){if(null!==this.videoBufferList)return this.videoBufferList.searchNodeAt(e)},clearBuffer:function(){null!==this.videoBufferList&&this.videoBufferList.clear()},findCurrent:function(){null!==this.videoBufferList&&this.videoBufferList.searchTimestamp(this.getTimeStamp())},setTimeStamp:function(e){this.timeData=e},getTimeStamp:function(){return this.timeData},ntohl:function(e){return(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3]>>>0},appendBuffer:function(e,t,r){if(r+t.length>=e.length){var a=new Uint8Array(e.length+1048576);a.set(e,0),e=a}return e.set(t,r),e},getFramerate:function(){return O},setGovLength:function(e){k=e},getGovLength:function(){return k},setDecodingTime:function(e){this.decodingTime=e},getDropPercent:function(){return 0},getDropCount:function(){return 0},initStartTime:function(){this.firstDiffTime=0,this.calcGov=0},setCheckDelay:function(e){this.checkDelay=e},init:function(e){b=!1,r=!1,P=e,this.decoder.setIsFirstFrame(!1),this.videoBufferList=new n.VideoBufferList,this.firstDiffTime=0,this.checkDelay=!0,this.timeData=null},setFramerate:function(e){0<e&&"undefined"!==typeof e&&(O=e,null!==this.videoBufferList&&(this.videoBufferList.setMaxLength(6*O),this.videoBufferList.setBUFFERING(4*O)))},parseRTPData:function(i,l,k,O,U){var G,W=null,Y={},X=(l[19]<<24)+(l[18]<<16)+(l[17]<<8)+l[16]>>>0;G=X>>>26===0?"2000":"20"+(X>>>26);var q=Date.UTC(G,(X>>>22&15)-1,X>>>17&31,X>>>12&31,X>>>6&63,63&X)/1e3;if(q+=(new Date).getTimezoneOffset()/60*3600,P||253!==l[4]||(F=0!==l[5],P=H(U.width,U.height,F,U)),""!==P){if(0==this.firstTime)this.firstTime=q,this.lastMSW=0,x=(l[21]<<8)+l[20],h={timestamp:this.firstTime,timestamp_usec:0};else{var K,J=(l[21]<<8)+l[20];K=J>x?J-x:J+65535-x,this.lastMSW+=K,q>this.firstTime&&(this.lastMSW-=1e3),this.firstTime=q,h={timestamp:q,timestamp_usec:this.lastMSW},x=J}0!==this.getFramerate()&&"undefined"!==typeof this.getFramerate()||"undefined"===typeof this.getTimeStamp()||this.setFramerate(Math.round(1e3/((h.timestamp-this.getTimeStamp().timestamp===0?0:1e3)+(h.timestamp_usec-this.getTimeStamp().timestamp_usec)))),this.setTimeStamp(h);for(var Z=l[22],Q=l.subarray(24+Z,l.length-8),$=l.subarray(l.length-8,l.length),ee=($[7],$[6],$[5],$[4],[]),te=0;te<=Q.length;)if(0==Q[te])if(0==Q[te+1])if(1==Q[te+2]){if(ee.push(te),5==(31&Q[te+=3])||1==(31&Q[te]))break}else 0==Q[te+2]?te++:te+=3;else te+=2;else te+=1;var re="P";e=(l[21]<<8)+l[20];var ae=0;if(!0===U.h264_svc_flag||U.encode_type===N.SVAC2){var ne={};ne.width=U.width,ne.height=U.height,w=U.width,C=U.height,s=ne.width*U.height,re=U.IPFrame,!0===E&&(Y.decodeStart=ne,Y.decodeStart.decodeMode="canvas",Y.decodeStart.encodeMode="h264"),E=!1}else for(te=0;te<ee.length;te++)switch(W=Q.subarray(ee[te]+3,ee[te+1]),31&Q[ee[te]+3]){default:break;case 1:re="P",ae=ee[te]-1;break;case 5:re="I",ae=ee[te]-1;break;case 28:break;case 7:a.parse(W);var ie=U;s=a.getSizeInfo().decodeSize,null!==c&&null!==p&&c.width===ie.width&&c.height===ie.height&&p===a.getCodecInfo()||(b=!1,c=ie,p=a.getCodecInfo(),this.decoder.setIsFirstFrame(!1)),w=S=ie.width,C=T=ie.height,v=W,R.width==ie.width&&R.height==ie.height||(0!=R.width?(R.width=ie.width,R.height=ie.height,Y.resolution=R,Y.resolution.decodeMode=H(R.width,R.height,F,U),Y.resolution.encodeMode="h264"):(R.width=ie.width,R.height=ie.height,Y.decodeStart=R,Y.decodeStart.decodeMode=P,Y.decodeStart.encodeMode="h264"));break;case 8:y=W;break;case 6:V(W);break;case 9:}if(k&&!1===_&&(Y.backupData={stream:new Uint8Array(Q),frameType:re,width:w,height:C,codecType:"h264"},null!==h.timestamp&&"undefined"!==typeof h.timestamp?Y.backupData.timestamp_usec=h.timestamp_usec:Y.backupData.timestamp=(e/90).toFixed(0)),"canvas"===P){var oe=1e3*h.timestamp+h.timestamp_usec;if(0==this.firstDiffTime?(d=0,this.firstDiffTime=Date.now()-oe):(oe-M<0&&(this.firstDiffTime=d+(Date.now()-oe).toFixed(0)),(d=Date.now()-oe-this.firstDiffTime)<0&&(this.firstDiffTime=0,d=0),d>8e3&&(Y.error={errorCode:n.PLAYER_STATE_CODE.TIMEOUT},this.rtpReturnCallback(Y))),M=oe,t!==s&&(this.decoder.free(),t=s,this.decoder.setOutputSize(t)),!0!==U.h264_svc_flag&&U.encode_type!==N.SVAC2){if(!0===_&&"P"===re)return;!0===_&&(_=!1)}m.frameData=null,!0===k&&!0===r||(m.frameData=this.decoder.decode(l)),m.timeStamp=null,h=null===h.timestamp?this.getTimeStamp():h,m.timeStamp=h}else{var se=null;if(b?m.initSegmentData=null:(b=!0,U={id:1,width:S,height:T,type:"video",profileIdc:a.getSpsValue("profile_idc"),profileCompatibility:0,levelIdc:a.getSpsValue("level_idc"),sps:[v],pps:[y],timescale:1e3,fps:this.getFramerate()},null==B&&(B=new o.default(n.commonOption.VIDEOENCODETYPE.H264)),m.initSegmentData=B.initSegment(U),m.codecInfo=a.getCodecInfo()),"I"===re){var ue=ae;se=Q.subarray(ue,Q.length)}else se=Q.subarray(ae,Q.length);var fe=se.length-4;se[0]=(4278190080&fe)>>>24,se[1]=(16711680&fe)>>>16,se[2]=(65280&fe)>>>8,se[3]=255&fe;var le=this.getFramerate(),ce={duration:Math.round(1/le*1e3),size:se.length,frame_time_stamp:null,frameDuration:null};if(r)ce.frame_time_stamp=e,m.frameData=new Uint8Array(se),m.mediaSample=ce;else{if(!1===k){if(ce.frame_time_stamp=1e3*h.timestamp+h.timestamp_usec-L,!1===D)ce.frame_time_stamp=0,L=1e3*h.timestamp+h.timestamp_usec,ce.frameDuration=0,g=ce,D=!0;else{var pe=g.frame_time_stamp,de=ce.frame_time_stamp;ce.frameDuration=Math.abs(de-pe),ce.frameDuration>3e3&&(ce.frameDuration=0),g=ce}m.frameData=new Uint8Array(se),m.mediaSample=ce}h=null===h.timestamp?this.getTimeStamp():h,m.timeStamp=h}}var _e=w*C;if(!0===r&&(NaN.toFixed(0),_e>786432?(j("video"),Y.decodeMode="video"):(j("canvas"),Y.decodeMode="canvas")),m.playback=r,m.frameData.frameIndex=U.frameIndex,m&&m.frameData&&m.frameData.option&&1===z&&(m.frameData.option.colour_description_present=u,m.frameData.option.signal_type_present=f),Y.decodedData=m,!0===I)return"I"===re&&A++,2===A&&(A=0,I=!1),void n.debug.info("H264Session::stop");this.rtpReturnCallback(Y)}},parseRTPDataIFrame:function(e,r){for(var n=null,i={},o=e[22],u=e.subarray(24+o,e.length-8),f=[],l=0;l<=u.length;)if(0==u[l])if(0==u[l+1])if(1==u[l+2]){if(f.push(l),5==(31&u[l+=3])||1==(31&u[l]))break}else 0==u[l+2]?l++:l+=3;else l+=2;else l+=1;for(l=0;l<f.length;l++)switch(n=u.subarray(f[l]+3,f[l+1]),31&u[f[l]+3]){default:break;case 7:a.parse(n),s=a.getSizeInfo().decodeSize}t!==s&&(this.decoder.free(),t=s,this.decoder.setOutputSize(t)),m.frameData=null,m.frameData=this.decoder.decode(e,"I",{use:"I"}),m.frameData&&m.frameData.option&&(m.frameData.option.channelId=r.channel),i.decodeStart={},i.decodeStart.decodeMode="canvas",i.decodedData=m,this.rtpReturnCallback(i)},findIFrame:function(){if(null!==this.videoBufferList){var e=this.videoBufferList.findIFrame();if(null===e||"undefined"===typeof e)return!1;var t={};return this.setTimeStamp(e.timeStamp),t.frameData=this.decoder.decode(e.buffer),t.timeStamp=e.timeStamp,t}},setInitSegment:function(){b=!1,c=null,p=null},setLessRate:function(e){U=e}},new G};t.default=c},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}e.exports=function(e,t,a){return t&&r(e.prototype,t),a&&r(e,a),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var a=r(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(9));if("undefined"==typeof i)var i={};i.MD5=function(e){function t(e){var t=(e>>>0).toString(16);return"00000000".substr(0,8-t.length)+t}function r(e,t,r){return e&t|~e&r}function a(e,t,r){return r&e|~r&t}function i(e,t,r){return e^t^r}function o(e,t,r){return t^(e|~r)}function s(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e){for(var t=[],r=0;r<e.length;r++)if(e.charCodeAt(r)<=127)t.push(e.charCodeAt(r));else for(var a=encodeURIComponent(e.charAt(r)).substr(1).split("%"),n=0;n<a.length;n++)t.push(parseInt(a[n],16));return t}function f(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}var l=null,c=null;function p(e,t){return 4294967295&e+t}return"string"==typeof e?l=u(e):e.constructor==Array?0===e.length?l=e:"string"==typeof e[0]?l=function(e){for(var t=[],r=0;r<e.length;r++)t=t.concat(u(e[r]));return t}(e):"number"==typeof e[0]?l=e:c=(0,n.default)(e[0]):"undefined"!=typeof ArrayBuffer?e instanceof ArrayBuffer?l=f(new Uint8Array(e)):e instanceof Uint8Array||e instanceof Int8Array?l=f(e):e instanceof Uint32Array||e instanceof Int32Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Float32Array||e instanceof Float64Array?l=f(new Uint8Array(e.buffer)):c=(0,n.default)(e):c=(0,n.default)(e),c&&alert("MD5 type mismatch, cannot process "+c),function(){function e(e,t,r,a){var n,i,o=y;y=v,v=g,g=p(g,(n=p(h,p(e,p(t,r))))<<(i=a)&4294967295|n>>>32-i),h=o}var n=l.length;l.push(128);var u=l.length%64;if(u>56){for(var f=0;f<64-u;f++)l.push(0);u=l.length%64}for(f=0;f<56-u;f++)l.push(0);l=l.concat(function(e){for(var t=[],r=0;r<8;r++)t.push(255&e),e>>>=8;return t}(8*n));var c=1732584193,d=4023233417,_=2562383102,m=271733878,h=0,g=0,v=0,y=0;for(f=0;f<l.length/64;f++){h=c;var b=64*f;e(r(g=d,v=_,y=m),3614090360,s(l,b),7),e(r(g,v,y),3905402710,s(l,b+4),12),e(r(g,v,y),606105819,s(l,b+8),17),e(r(g,v,y),3250441966,s(l,b+12),22),e(r(g,v,y),4118548399,s(l,b+16),7),e(r(g,v,y),1200080426,s(l,b+20),12),e(r(g,v,y),2821735955,s(l,b+24),17),e(r(g,v,y),4249261313,s(l,b+28),22),e(r(g,v,y),1770035416,s(l,b+32),7),e(r(g,v,y),2336552879,s(l,b+36),12),e(r(g,v,y),4294925233,s(l,b+40),17),e(r(g,v,y),2304563134,s(l,b+44),22),e(r(g,v,y),1804603682,s(l,b+48),7),e(r(g,v,y),4254626195,s(l,b+52),12),e(r(g,v,y),2792965006,s(l,b+56),17),e(r(g,v,y),1236535329,s(l,b+60),22),e(a(g,v,y),4129170786,s(l,b+4),5),e(a(g,v,y),3225465664,s(l,b+24),9),e(a(g,v,y),643717713,s(l,b+44),14),e(a(g,v,y),3921069994,s(l,b),20),e(a(g,v,y),3593408605,s(l,b+20),5),e(a(g,v,y),38016083,s(l,b+40),9),e(a(g,v,y),3634488961,s(l,b+60),14),e(a(g,v,y),3889429448,s(l,b+16),20),e(a(g,v,y),568446438,s(l,b+36),5),e(a(g,v,y),3275163606,s(l,b+56),9),e(a(g,v,y),4107603335,s(l,b+12),14),e(a(g,v,y),1163531501,s(l,b+32),20),e(a(g,v,y),2850285829,s(l,b+52),5),e(a(g,v,y),4243563512,s(l,b+8),9),e(a(g,v,y),1735328473,s(l,b+28),14),e(a(g,v,y),2368359562,s(l,b+48),20),e(i(g,v,y),4294588738,s(l,b+20),4),e(i(g,v,y),2272392833,s(l,b+32),11),e(i(g,v,y),1839030562,s(l,b+44),16),e(i(g,v,y),4259657740,s(l,b+56),23),e(i(g,v,y),2763975236,s(l,b+4),4),e(i(g,v,y),1272893353,s(l,b+16),11),e(i(g,v,y),4139469664,s(l,b+28),16),e(i(g,v,y),3200236656,s(l,b+40),23),e(i(g,v,y),681279174,s(l,b+52),4),e(i(g,v,y),3936430074,s(l,b),11),e(i(g,v,y),3572445317,s(l,b+12),16),e(i(g,v,y),76029189,s(l,b+24),23),e(i(g,v,y),3654602809,s(l,b+36),4),e(i(g,v,y),3873151461,s(l,b+48),11),e(i(g,v,y),530742520,s(l,b+60),16),e(i(g,v,y),3299628645,s(l,b+8),23),e(o(g,v,y),4096336452,s(l,b),6),e(o(g,v,y),1126891415,s(l,b+28),10),e(o(g,v,y),2878612391,s(l,b+56),15),e(o(g,v,y),4237533241,s(l,b+20),21),e(o(g,v,y),1700485571,s(l,b+48),6),e(o(g,v,y),2399980690,s(l,b+12),10),e(o(g,v,y),4293915773,s(l,b+40),15),e(o(g,v,y),2240044497,s(l,b+4),21),e(o(g,v,y),1873313359,s(l,b+32),6),e(o(g,v,y),4264355552,s(l,b+60),10),e(o(g,v,y),2734768916,s(l,b+24),15),e(o(g,v,y),1309151649,s(l,b+52),21),e(o(g,v,y),4149444226,s(l,b+16),6),e(o(g,v,y),3174756917,s(l,b+44),10),e(o(g,v,y),718787259,s(l,b+8),15),e(o(g,v,y),3951481745,s(l,b+36),21),c=p(c,h),d=p(d,g),_=p(_,v),m=p(m,y)}return function(e,r,a,n){for(var i="",o=0,s=0,u=3;u>=0;u--)o=255&(s=arguments[u]),o<<=8,o|=255&(s>>>=8),o<<=8,o|=255&(s>>>=8),o<<=8,i+=t(o|=s>>>=8);return i}(m,_,d,c).toUpperCase()}()};var o=function(e){return i.MD5(e)};t.default=o},function(e,t){function r(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;r(0);var a=function(){var e,t,r,a,n,i,o,s,u,f,l,c,p,d,_,m=!1,h=0;function g(){g.prototype.setIsFirstFrame(!1)}return g.prototype={init:function(){},setOutputSize:function(e){if(n!==2*e){n=2*e;var t=Module._malloc(1),r=new Uint8Array(Module.HEAPU8.buffer,t,1);Module._DECODE_GetFreePort(r.byteOffset),h=r[0],r=null,Module._free(t),Module._DECODE_Init(h),i=Module._malloc(5242880),o=new Uint8Array(Module.HEAPU8.buffer,i,5242880);var a=2*e;s=Module._malloc(a),u=new Uint8Array(Module.HEAPU8.buffer,s,a),f=Module._malloc(4),l=new Uint8Array(Module.HEAPU8.buffer,f,4),c=Module._malloc(40),p=new Uint8Array(Module.HEAPU8.buffer,c,40)}},decode:function(n,i,s){var f=n[4],c=n[5],m=s&&s.use&&"I"===s.use;e=Date.now(),o.set(n),Module._DECODE_InputOneFrame(h,o.byteOffset,n.length,u.byteOffset,l.byteOffset,p.byteOffset),a=p[16]+(p[17]<<8),r=p[18]+(p[19]<<8);var v=a*r*3/2;return _=null,d=null,_=new ArrayBuffer(v),(d=new Uint8Array(_)).set(Module.HEAPU8.subarray(u.byteOffset,u.byteOffset+v)),t=Date.now()-e,!0===m||g.prototype.isFirstFrame()?a>0&&r>0?(e=Date.now(),{data:d,option:{ylen:a,height:r,mediaType:f,subMediaType:c,beforeDecoding:e},width:a,height:r,codecType:"h264",decodingTime:t,frameType:i}):void 0:(g.prototype.setIsFirstFrame(!0),{firstFrame:!0})},setIsFirstFrame:function(e){m=e},isFirstFrame:function(){return m},free:function(){Module._DECODE_Stop(h),o=null,Module._free(i),u=null,Module._free(s),l=null,Module._free(f),p=null,Module._free(c),_=null,d=null}},new g};t.default=a},function(e,t,r){"use strict";var a=r(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(0),i=a(r(12)),o=a(r(2)),s=a(r(3)),u=null,f=null;function l(){var e=3,t=8,r=16,a=32,i=255,o=null,l=null,c=0,p=0,d=0,_=0,m=0;function h(){0,o=new s.default}function g(){return 0==d&&(_=function(){if(p>=c)return 0;var e=l[p++];return 0==e?(m++,p<c&&2==m&&3==l[p]&&(p++,m=0)):m=0,e}(),d=8),_>>--d&1}function v(e,t){for(var r=0;t>0;)r<<=1,r|=g(),t--;return r}function y(e,t){for(var r=0;p<c&&0==g();)r++;return v(0,r)+((1<<r)-1)}return h.prototype={parse:function(e){e,0,o.clear(),o.put("forbidden_zero_bit",v(0,1)),o.put("nal_unit_type",v(0,6)),o.put("nuh_layer_id",v(0,6)),o.put("nuh_temporal_id_plus1",v(0,3)),o.put("sps_video_parameter_set_id",v(0,4)),0===o.get("nuh_layer_id")?o.put("sps_max_sub_layers_minus1",v(0,3)):o.put("sps_ext_or_max_sub_layers_minus1",v(0,3));var t=0!==o.get("nuh_layer_id")&&7===o.get("sps_ext_or_max_sub_layers_minus1");return t||(o.put("sps_max_sub_layers_minus1",v(0,1)),function(e,t){if(e){o.put("general_profile_space",v(0,2)),o.put("general_tier_flag",v(0,1)),o.put("general_profile_idc",v(0,5));for(var r=new Array(32),a=0;a<32;a++)r[a]=v(0,1);o.put("general_progressive_source_flag",v(0,1)),o.put("general_interlaced_source_flag",v(0,1)),o.put("general_non_packed_constraint_flag",v(0,1)),o.put("general_frame_only_constraint_flag",v(0,1));var n=o.get("general_profile_idc");4===n||r[4]||5===n||r[5]||6===n||r[6]||7===n||r[7]||8===n||r[8]||9===n||r[9]||10===n||r[10]?(o.put("general_max_12bit_constraint_flag",v(0,1)),o.put("general_max_10bit_constraint_flag",v(0,1)),o.put("general_max_8bit_constraint_flag",v(0,1)),o.put("general_max_422chroma_constraint_flag",v(0,1)),o.put("general_max_420chroma_constraint_flag",v(0,1)),o.put("general_max_monochrome_constraint_flag",v(0,1)),o.put("general_intra_constraint_flag",v(0,1)),o.put("general_one_picture_only_constraint_flag",v(0,1)),o.put("general_lower_bit_rate_constraint_flag",v(0,1)),5===n||r[5]||9===n||r[9]||10===n||r[10]?(o.put("general_max_14bit_constraint_flag",v(0,1)),o.put("general_reserved_zero_33bits",v(0,33))):o.put("general_reserved_zero_34bits",v(0,34))):o.put("general_reserved_zero_43bits",v(0,43)),n>=1&&n<=5||r[1]||r[2]||r[3]||r[4]||r[5]||r[9]?o.put("general_inbld_flag",v(0,1)):o.put("general_reserved_zero_bit",v(0,1))}o.put("general_level_idc",v(0,8));var i=new Array(t),s=new Array(t);for(_=0;_<t;_++)i[_]=v(0,1),s[_]=v(0,1);var u=new Array(8),f=new Array(t),l=new Array(t),c=new Array(t),p=[],d=new Array(t);if(t>0)for(var _=t;_<8;_++)u[_]=v(0,2);for(_=0;_<t;_++){if(i[_]){for(l[_]=v(0,2),c[_]=v(0,1),f[_]=v(0,5),a=0;a<32;a++)p[_][a]=v(0,1);o.put("sub_layer_progressive_source_flag",v(0,1)),o.put("sub_layer_interlaced_source_flag",v(0,1)),o.put("sub_layer_non_packed_constraint_flag",v(0,1)),o.put("sub_layer_frame_only_constraint_flag",v(0,1)),4===f[_]||p[_][4]||5===f[_]||p[_][5]||6===f[_]||p[_][6]||7===f[_]||p[_][7]||8===f[_]||p[_][8]||9===f[_]||p[_][9]||10===f[_]||p[_][10]?(o.put("sub_layer_max_12bit_constraint_flag",v(0,1)),o.put("sub_layer_max_10bit_constraint_flag",v(0,1)),o.put("sub_layer_max_8bit_constraint_flag",v(0,1)),o.put("sub_layer_max_422chroma_constraint_flag",v(0,1)),o.put("sub_layer_max_420chroma_constraint_flag",v(0,1)),o.put("sub_layer_max_monochrome_constraint_flag",v(0,1)),o.put("sub_layer_intra_constraint_flag",v(0,1)),o.put("sub_layer_one_picture_only_constraint_flag",v(0,1)),o.put("sub_layer_lower_bit_rate_constraint_flag",v(0,1)),5===f[_]||p[_][5]?(o.put("sub_layer_max_14bit_constraint_flag",v(0,1)),o.put("sub_layer_lower_bit_rate_constraint_flag",v(0,1)),d[_]=v(0,33)):d[_]=v(0,34)):o.put("sub_layer_reserved_zero_43bits",v(0,43)),f[_]>=1&&f[_]<=5||9==f[_]||p[1]||p[2]||p[3]||p[4]||p[5]||p[9]?o.put("sub_layer_inbld_flag",v(0,1)):o.put("sub_layer_reserved_zero_bit",v(0,1))}s[_]&&o.put("sub_layer_level_idc",v(0,8))}}(1,o.get("sps_max_sub_layers_minus1"))),v(0,84),o.put("sps_seq_parameter_set_id",y()),t?(o.put("update_rep_format_flag",v(0,1)),o.get("update_rep_format_flag")&&o.put("sps_rep_format_idx",v(0,8))):(o.put("chroma_format_idc",y()),3===o.get("chroma_format_idc")&&o.put("separate_colour_plane_flag",v(0,1)),o.put("pic_width_in_luma_samples",y()),o.put("pic_height_in_luma_samples",y()),o.put("conformance_window_flag",v(0,1)),o.get("conformance_window_flag")&&(o.put("conf_win_left_offset",y()),o.put("conf_win_right_offset",y()),o.put("conf_win_top_offset",y()),o.put("conf_win_bottom_offset",y()))),!0},parse2:function(s){var h=s.length;if(s,l=s,c=s.length,p=0,d=0,_=0,m=0,0,o.clear(),h<20)return!1;v(0,16),v(0,4);var g=v(0,3);if(o.put("sps_max_sub_layers_minus1",g),g>6)return!1;v(0,1),v(0,2),v(0,1);v(0,5);v(0,32),v(0,1),v(0,1),v(0,1),v(0,1),v(0,43),v(0,1),o.put("general_level_idc",v(0,8));for(var b=[],D=[],S=0;S<g;S++)b[S]=v(0,1),D[S]=v(0,1);if(g>0)for(S=g;S<8;S++)v(0,2);for(S=0;S<g;S++)b[S]&&(v(0,2),v(0,1),v(0,5),v(0,32),v(0,1),v(0,1),v(0,1),v(0,1),v(0,44)),D[S]&&v(0,8);var T=y();if(o.put("sps_seq_parameter_set_id",T),T>15)return!1;var w=y();if(o.put("chroma_format_idc",w),T>3)return!1;if(3==w&&v(0,1),o.put("pic_width_in_luma_samples",y()),o.put("pic_height_in_luma_samples",y()),v(0,1)&&(y(),y(),y(),y()),y()!=y())return!1;y();for(S=v(0,1)?0:g;S<=g;S++)y(),y(),y();y(),y(),y(),y(),y(),y();var E;v(0,1)&&(E?v(0,6):v(0,1)),v(0,1),v(0,1),v(0,1)&&(v(0,4),v(0,4),y(),y(),v(0,1));for(var C=y(),I=[],A=0;A<C;A++){var M=0;if(A>0&&(M=v(0,1)),A&&M){v(0,1),y(),I[A]=0;for(var x=0;x<=I[A-1];x++){var P=0,k=v(0,1);k||(P=v(0,1)),(k||P)&&I[A]++}}else{var O=y(),L=y();I[A]=O+L;for(x=0;x<O;x++)y(),v(0,1);for(x=0;x<L;x++)y(),v(0,1)}}if(v(0,1)){var R=y();for(S=0;S<R;S++)y(),v(0,1)}v(0,1),v(0,1);return v(0,1)&&(o.put("aspect_ratio_info_present_flag",v(0,1)),o.get("aspect_ratio_info_present_flag")&&(o.put("aspect_ratio_idc",v(0,t)),o.get("aspect_ratio_idc")===i&&(o.put("sar_width",v(0,r)),o.put("sar_height",v(0,r)))),o.put("overscan_info_present_flag",v(0,1)),o.get("overscan_info_present_flag")&&o.put("overscan_appropriate_flag",v(0,1)),o.put("video_signal_type_present_flag",v(0,1)),o.get("video_signal_type_present_flag")&&(o.put("video_format",v(0,e)),o.put("video_full_range_flag",v(0,1)),o.put("colour_description_present_flag",v(0,1)),1==o.get("video_full_range_flag")&&(f=n.YUV2RGBMODE.FULLRANGE),o.get("colour_description_present_flag")&&(o.put("colour_primaries",v(0,t)),o.put("transfer_characteristics",v(0,t)),o.put("matrix_coefficients",v(0,t)),1!=o.get("colour_description_present_flag")||5!=o.get("colour_primaries")&&6!=o.get("colour_primaries")&&6!=o.get("transfer_characteristics")&&5!=o.get("matrix_coefficients")&&6!=o.get("matrix_coefficients")||(u=n.YUV2RGBMODE.BT601))),o.put("chroma_loc_info_present_flag",v(0,1)),o.get("chroma_loc_info_present_flag")&&(o.put("chroma_sample_loc_type_top_field",y()),o.put("chroma_sample_loc_type_bottom_field",y())),o.put("timing_info_present_flag",v(0,1)),o.get("timing_info_present_flag")&&(o.put("num_units_in_tick",v(0,a)),o.put("time_scale",v(0,a)),o.put("fixed_frame_rate_flag",v(0,1))),o.put("nal_hrd_parameters_present_flag",v(0,1)),o.get("nal_hrd_parameters_present_flag"),o.put("vcl_hrd_parameters_present_flag",v(0,1)),o.get("vcl_hrd_parameters_present_flag"),(o.get("nal_hrd_parameters_present_flag")||o.get("vcl_hrd_parameters_present_flag"))&&o.put("low_delay_hrd_flag",v(0,1)),o.put("pic_struct_present_flag",v(0,1)),o.put("bitstream_restriction_flag",v(0,1)),o.get("bitstream_restriction_flag")&&(o.put("motion_vectors_over_pic_boundaries_flag",v(0,1)),o.put("max_bytes_per_pic_denom",y()),o.put("max_bits_per_mb_denom",y()))),!0},getSizeInfo:function(){var e=o.get("pic_width_in_luma_samples"),t=o.get("pic_height_in_luma_samples");if(o.get("conformance_window_flag")){var r=o.get("chroma_format_idc"),a=o.get("separate_colour_plane_flag");"undefined"===typeof a&&(a=0);var n=1!==r&&2!==r||0!==a?1:2,i=1===r&&0===a?2:1;e-=n*o.get("conf_win_right_offset")+n*o.get("conf_win_left_offset"),t-=i*o.get("conf_win_bottom_offset")+i*o.get("conf_win_top_offset")}return{width:e,height:t,decodeSize:e*t}},getSpsValue:function(e){return o.get(e)}},new h}function c(){var e=7,t=7,r=2,a=3,n=0,i=null;function o(){n=0,i=new s.default}function u(r,i){var o=i,s=n+o>>a;return o=n+i&e,r[s]>>t-(o&t)&1}function f(e,t){return t<=25?l(e,t):l(e,16)<<t-16|l(e,t-16)}function l(e,t){var r=0;if(1===t)r=u(e,0);else for(var a=0;a<t;a++)r=(r<<1)+u(e,a);return n+=t,r}function c(e,t){for(var a=0,i=0,o=t;n+o<8*e.length&&!u(e,o++);)a++;if(0===a)return n+=1,0;i=1<<a;for(var s=a-1;s>=0;s--,o++)i|=u(e,o)<<s;return n+=a*r+1,i-1}return o.prototype={parse:function(e){n=0,i.clear();var t=new ArrayBuffer(256),r=new Uint8Array(t);!function(e,t,r,a){for(var n=0,i=0;n+2<t&&i+2<a;++n)0==e[n]&&0==e[n+1]&&3==e[n+2]?(r[i++]=e[n++],r[i++]=e[n++]):r[i++]=e[n];for(;n<t&&i<a;)r[i++]=e[n++]}(e,e.length,r,256);var a=[],o=[];l(r,4);var s,u,p=l(r,3);i.put("temporalIdNested",l(r,1)),i.put("general_profile_space",l(r,2)),i.put("general_tier_flag",l(r,1)),i.put("general_profile_idc",l(r,5)),i.put("general_profile_compatibility",l(e,8)),i.put("general_profile_compatibility_flags",f(r,32)),i.put("general_constraint_indicator_flags",(s=r,(u=48)<=32?f(s,u):f(s,u-32)<<32|f(s,32))),i.put("general_level_idc",l(r,8));var d=0;for(d=0;d<p&&d<6;d++)a[d]=l(r,1),o[d]=l(r,1);if(p>0)for(d=p;d<8;d++)l(r,2);for(d=0;d<p&&d<6;d++)o[d]&&l(r,8);c(r,0);i.put("chroma_format_idc",c(r,0));c(r,0),c(r,0);return l(r,1),c(r,0),c(r,0),c(r,0),c(r,0),i.put("bitDepthLumaMinus8",c(r,0)+8),i.put("bitDepthChromaMinus8",c(r,0)+8),t=null,r=null,!0},parse2:function(e){var t=e.length,r=e;e.length;if(i.clear(),t<20)return!1;l(r,16),l(r,4);var a=l(r,3);if(i.put("sps_max_sub_layers_minus1",a),a>6)return!1;l(r,1),l(r,2),l(r,1);l(r,5);l(r,32),l(r,1),l(r,1),l(r,1),l(r,1),l(r,43),l(r,1),i.put("general_level_idc",l(r,8));for(var n=[],o=[],s=0;s<a;s++)n[s]=l(r,1),o[s]=l(r,1);if(a>0)for(s=a;s<8;s++)l(r,2);for(s=0;s<a;s++)n[s]&&(l(r,2),l(r,1),l(r,5),l(r,32),l(r,1),l(r,1),l(r,1),l(r,1),l(r,44)),o[s]&&l(r,8);var u=c(r,0);if(i.put("sps_seq_parameter_set_id",u),u>15)return!1;var f=c(r,0);return i.put("chroma_format_idc",f),!(u>3)&&(3==f&&l(r,1),i.put("pic_width_in_luma_samples",c(r,0)),i.put("pic_height_in_luma_samples",c(r,0)),l(r,1)&&(c(r,0),c(r,0),c(r,0),c(r,0)),c(r,0)==c(r,0))},getSizeInfo:function(){var e=i.get("pic_width_in_luma_samples"),t=i.get("pic_height_in_luma_samples");if(i.get("conformance_window_flag")){var r=i.get("chroma_format_idc"),a=i.get("separate_colour_plane_flag");"undefined"===typeof a&&(a=0);var n=1!==r&&2!==r||0!==a?1:2,o=1===r&&0===a?2:1;e-=n*i.get("conf_win_right_offset")+n*i.get("conf_win_left_offset"),t-=o*i.get("conf_win_bottom_offset")+o*i.get("conf_win_top_offset")}return{width:e,height:t,decodeSize:e*t}},getSpsValue:function(e){return i.get(e)},getCodecInfo:function(){return'video/mp4; codecs="hvc1.1.6.L30.B0"'}},new o}var p=function(){var e,t,r,a=0,s=0,p=!1,d=0,_=0,m=new c,h=new l,g={frameData:null,timeStamp:null,initSegmentData:null,mediaSample:null,dropPercent:0,dropCount:0,codecInfo:"",playback:!1},v={timestamp:null,timezone:null},y=0,b=0,D=null,S=0,T=0,w={width:0,height:0},E=0,C=0,I=null,A=null,M=null,x=!1,P=!1,k=!1,O={},L=!1,R=null,F=0;function U(){this.decoder=(0,i.default)(),this.firstTime=0,this.lastMSW=0}function B(e){var t=0,r=e[t+=2];e[++t],t++;var a=String.fromCharCode.apply(null,e.subarray(t,t+16))||"";if(5===r&&a.indexOf("SPSVuiParse")>-1)for(var n=t+=16;n<e.length;n+=2){var i=e[n],o=e[n+1];1===i&&1===o&&(F=1)}}return U.prototype={setReturnCallback:function(e){this.rtpReturnCallback=e},setBufferfullCallback:function(e){null!==this.videoBufferList&&this.videoBufferList.setBufferFullCallback(e)},getVideoBuffer:function(e){if(null!==this.videoBufferList)return this.videoBufferList.searchNodeAt(e)},clearBuffer:function(){null!==this.videoBufferList&&this.videoBufferList.clear()},findCurrent:function(){null!==this.videoBufferList&&this.videoBufferList.searchTimestamp(this.getTimeStamp())},ntohl:function(e){return(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3]>>>0},appendBuffer:function(e,t,r){if(r+t.length>=e.length){var a=new Uint8Array(e.length+1048576);a.set(e,0),e=a}return e.set(t,r),e},setGovLength:function(e){D=e},getGovLength:function(){return D},setDecodingTime:function(e){this.decodingTime=e},getDropPercent:function(){return 0},getDropCount:function(){return 0},initStartTime:function(){this.firstDiffTime=0,this.calcGov=0},setCheckDelay:function(e){this.checkDelay=e},init:function(e){P=!1,p=!1,this.decoder.setIsFirstFrame(!1),this.videoBufferList=new n.VideoBufferList,this.firstDiffTime=0,this.checkDelay=!0,this.timeData=null,k=e.h265AccelerationEnabled},setInitSegment:function(){P=!1},parseRTPDataH265Acceleration:function(i,u,f,l,c){var d=null,_={},h=(u[19]<<24)+(u[18]<<16)+(u[17]<<8)+u[16]>>>0,D=Date.UTC("20"+(h>>>26),(h>>>22&15)-1,h>>>17&31,h>>>12&31,h>>>6&63,63&h)/1e3;if(c.timeStampmsw,D-=28800,0==this.firstTime)this.firstTime=D,this.lastMSW=0,s=(u[21]<<8)+u[20],v={timestamp:this.firstTime,timestamp_usec:0};else{var S,E=(u[21]<<8)+u[20];S=E>s?E-s:E+65535-s,this.lastMSW+=S,D>this.firstTime&&(this.lastMSW-=1e3),this.firstTime=D,v={timestamp:D,timestamp_usec:this.lastMSW},s=E}0!==this.getFramerate()&&"undefined"!==typeof this.getFramerate()||"undefined"===typeof this.getTimeStamp()||this.setFramerate(Math.round(1e3/((v.timestamp-this.getTimeStamp().timestamp===0?0:1e3)+(v.timestamp_usec-this.getTimeStamp().timestamp_usec)))),this.setTimeStamp(v);for(var C=u[22],k=u.subarray(24+C,u.length-8),F=u.subarray(u.length-8,u.length),U=(F[7],F[6],F[5],F[4],[]),B=0;B<=k.length;)if(0==k[B])if(0==k[B+1])if(1==k[B+2]){if(U.push(B),38==(255&k[B+=3])||2==(255&k[B]))break}else 0==k[B+2]?B++:B+=3;else B+=2;else B+=1;a=(u[21]<<8)+u[20];var N=0;for(B=0;B<U.length;B++)switch(d=k.subarray(U[B]+3,U[B+1]-1),255&k[U[B]+3]){case 2:N=U[B]-1,e=k.subarray(N,k.length);break;case 38:N=U[B]-1,e=k.subarray(N,k.length);var z=c;y=t=z.width,b=r=z.height,0===w.width&&0===w.height?(w.width=y,w.height=b,_.decodeStart=w,_.decodeStart.decodeMode="video",_.decodeStart.encodeMode="h265"):w.width===y&&w.height===b||(P=!1,w.width=y,w.height=b,_.resolution=w);break;case 64:I=d;break;case 66:var V=k.subarray(U[B]+5,U[B+1]-1);m.parse(V),M=d;break;case 68:A=d}if(P)g.initSegmentData=null;else{P=!0;var j=m.getSpsValue("general_profile_space"),H=m.getSpsValue("general_tier_flag"),G=m.getSpsValue("general_profile_idc"),W=m.getSpsValue("temporalIdNested");m.getSpsValue("general_profile_compatibility_flags"),m.getSpsValue("general_constraint_indicator_flags"),c={id:1,width:t,height:r,type:"video",general_profile_flag:j<<6|H<<5|G,general_profile_compatibility_flags:m.getSpsValue("general_profile_compatibility_flags"),general_constraint_indicator_flags:m.getSpsValue("general_constraint_indicator_flags"),general_level_idc:m.getSpsValue("general_level_idc"),chroma_format_idc:m.getSpsValue("chroma_format_idc"),bitDepthLumaMinus8:m.getSpsValue("bitDepthLumaMinus8"),bitDepthChromaMinus8:m.getSpsValue("bitDepthChromaMinus8"),rate_layers_nested_length:11|(1&W)<<2,vps:[I],sps:[M],pps:[A],timescale:1e3,fps:this.getFramerate()},null==R&&(R=new o.default(n.commonOption.VIDEOENCODETYPE.H265)),g.initSegmentData=R.initSegment(c),g.codecInfo=m.getCodecInfo()}var Y=e.length-4;e[0]=(4278190080&Y)>>>24,e[1]=(16711680&Y)>>>16,e[2]=(65280&Y)>>>8,e[3]=255&Y;var X=this.getFramerate(),q={duration:Math.round(1/X*1e3),size:e.length,frame_time_stamp:null,frameDuration:null};if(q.frame_time_stamp=1e3*v.timestamp+v.timestamp_usec-T,!1===x)q.frame_time_stamp=0,T=1e3*v.timestamp+v.timestamp_usec,q.frameDuration=0,O=q,x=!0;else{var K=O.frame_time_stamp,J=q.frame_time_stamp;q.frameDuration=Math.abs(J-K),q.frameDuration>3e3&&(q.frameDuration=0),O=q}g.frameData=new Uint8Array(e),g.mediaSample=q,v=null===v.timestamp?this.getTimeStamp():v,g.timeStamp=v;var Z=y*b;if(!0===p){var Q=(rtpDuration/frameDuration*100).toFixed(0)<60;Z>videoTagLimitSize?frameDuration<5e3?(changeMode("video"),_.decodeMode="video"):!0===Q?(changeMode("video"),_.decodeMode="video"):(changeMode("canvas"),_.decodeMode="canvas"):(changeMode("canvas"),_.decodeMode="canvas")}if(g.playback=p,_.decodedData=g,!0===L)return 2===errorIFrameNum&&(errorIFrameNum=0,L=!1),void n.debug.info("H264Session::stop");this.rtpReturnCallback(_)},parseRTPData:function(t,r,i,o,l){if(!0!==k){var c,m=null,D={},S=(r[19]<<24)+(r[18]<<16)+(r[17]<<8)+r[16]>>>0;c=S>>>26===0?"2000":"20"+(S>>>26);var T=Date.UTC(c,(S>>>22&15)-1,S>>>17&31,S>>>12&31,S>>>6&63,63&S)/1e3;if(T+=(new Date).getTimezoneOffset()/60*3600,0===this.firstTime)this.firstTime=T,this.lastMSW=0,s=(r[21]<<8)+r[20],v={timestamp:this.firstTime,timestamp_usec:0};else{var I,A=(r[21]<<8)+r[20];I=A>s?A-s:A+65535-s,this.lastMSW+=I,T>this.firstTime&&(this.lastMSW-=1e3),this.firstTime=T,v={timestamp:T,timestamp_usec:this.lastMSW},s=A}0!==this.getFramerate()&&"undefined"!==typeof this.getFramerate()||"undefined"===typeof this.getTimeStamp()||this.setFramerate(Math.round(1e3/((v.timestamp-this.getTimeStamp().timestamp===0?0:1e3)+(v.timestamp_usec-this.getTimeStamp().timestamp_usec)))),this.setTimeStamp(v);var M=r[22];e=r.subarray(24+M,r.length-8),a=(r[21]<<8)+r[20];for(var x=[],P=0;P<=e.length;)if(0==e[P])if(0==e[P+1])if(1==e[P+2]){if(x.push(P),5==(31&e[P+=3])||1==(31&e[P]))break}else 0==e[P+2]?P++:P+=3;else P+=2;else P+=1;var O="P";for(P=0;P<x.length;P++)switch(m=e.subarray(x[P]+3,x[P+1]),e[x[P]+3]>>1&63){default:break;case 33:O="I",h.parse2(m);var L=l;_=h.getSizeInfo().decodeSize,y=L.width,b=L.height,w.width==L.width&&w.height==L.height||(0!=w.width?(w.width=L.width,w.height=L.height,D.resolution=w,D.resolution.decodeMode="canvas",D.resolution.encodeMode="h265"):(w.width=L.width,w.height=L.height,D.decodeStart=w,D.decodeStart.decodeMode="canvas",D.decodeStart.encodeMode="h265"));break;case 39:B(m)}var R=1e3*v.timestamp+v.timestamp_usec;0==this.firstDiffTime?(E=0,this.firstDiffTime=Date.now()-R):(R-C<0&&(this.firstDiffTime=E+(Date.now()-R).toFixed(0)),(E=Date.now()-R-this.firstDiffTime)<0&&(this.firstDiffTime=0,E=0),E>8e3&&(D.error={errorCode:n.PLAYER_STATE_CODE.TIMEOUT},this.rtpReturnCallback(D))),C=R,g.frameData=null,d!==_&&(this.decoder.free(),d=_,this.decoder.setOutputSize(d)),!0===i&&!0===p||(g.frameData=this.decoder.decode(r),g.frameData.frameType=O,g.frameData.frameIndex=l.frameIndex),g.timeStamp=null,v=null===v.timestamp?this.getTimeStamp():v,g.timeStamp=v,i&&(D.backupData={stream:e,frameType:O,width:y,height:b,codecType:"h265"},null!==v.timestamp&&"undefined"!==typeof v.timestamp?D.backupData.timestamp_usec=v.timestamp_usec:D.backupData.timestamp=(a/90).toFixed(0)),g&&g.frameData&&g.frameData.option&&1===F&&(g.frameData.option.colour_description_present=u,g.frameData.option.signal_type_present=f),D.decodedData=g,this.rtpReturnCallback(D)}else this.parseRTPDataH265Acceleration(t,r,i,o,l)},parseRTPDataIFrame:function(t,r){var a=null,n={},i=t[22];e=t.subarray(24+i,t.length-8);for(var o=[],s=0;s<=e.length;)if(0==e[s])if(0==e[s+1])if(1==e[s+2]){if(o.push(s),5==(31&e[s+=3])||1==(31&e[s]))break}else 0==e[s+2]?s++:s+=3;else s+=2;else s+=1;for(s=0;s<o.length;s++)switch(a=e.subarray(o[s]+3,o[s+1]),e[o[s]+3]>>1&63){default:break;case 33:h.parse2(a),_=h.getSizeInfo().decodeSize}g.frameData=null,d!==_&&(this.decoder.free(),d=_,this.decoder.setOutputSize(d)),g.frameData=this.decoder.decode(t,"I",{use:"I"}),g.frameData&&g.frameData.option&&(g.frameData.option.channelId=r.channel),n.decodedData=g,n.decodeStart={},n.decodeStart.decodeMode="canvas",this.rtpReturnCallback(n)},findIFrame:function(){if(null!==this.videoBufferList){var e=this.videoBufferList.findIFrame();if(null===e||"undefined"===typeof e)return!1;var t={};return this.setTimeStamp(e.timeStamp),t.frameData=this.decoder.decode(e.buffer),t.timeStamp=e.timeStamp,t}},getFramerate:function(){return S},setFramerate:function(e){0<e&&"undefined"!==typeof e&&(S=e,null!==this.videoBufferList&&(this.videoBufferList.setMaxLength(6*S),this.videoBufferList.setBUFFERING(4*S)))},getTimeStamp:function(){return this.timeData},setTimeStamp:function(e){this.timeData=e}},new U};t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;r(0);var a=function(){var e,t,r,a,n,i,o,s,u,f,l,c,p,d,_,m=!1,h=0;function g(){g.prototype.setIsFirstFrame(!1)}return g.prototype={init:function(){},setOutputSize:function(e){if(n!==2*e){n=2*e;var t=Module._malloc(1),r=new Uint8Array(Module.HEAPU8.buffer,t,1);Module._DECODE_GetFreePort(r.byteOffset),h=r[0],r=null,Module._free(t),Module._DECODE_Init(h),i=Module._malloc(5242880),o=new Uint8Array(Module.HEAPU8.buffer,i,5242880);var a=2*e;s=Module._malloc(a),u=new Uint8Array(Module.HEAPU8.buffer,s,a),f=Module._malloc(4),l=new Uint8Array(Module.HEAPU8.buffer,f,4),c=Module._malloc(40),p=new Uint8Array(Module.HEAPU8.buffer,c,40)}},decode:function(n,i,s){var f=n[4],c=n[5],m=s&&s.use&&"I"===s.use;e=Date.now(),o.set(n),Module._DECODE_InputOneFrame(h,o.byteOffset,n.length,u.byteOffset,l.byteOffset,p.byteOffset),a=p[16]+(p[17]<<8),r=p[18]+(p[19]<<8);var v=a*r*3/2;return _=null,d=null,_=new ArrayBuffer(v),(d=new Uint8Array(_)).set(Module.HEAPU8.subarray(u.byteOffset,u.byteOffset+v)),t=Date.now()-e,!0===m||g.prototype.isFirstFrame()?a>0&&r>0?(e=Date.now(),{data:d,option:{ylen:a,height:r,mediaType:f,subMediaType:c,beforeDecoding:e},width:a,height:r,codecType:"h265",decodingTime:t,frameType:i}):void 0:(g.prototype.setIsFirstFrame(!0),{firstFrame:!0})},setIsFirstFrame:function(e){m=e},isFirstFrame:function(){return m},free:function(){Module._DECODE_Stop(h),o=null,Module._free(i),u=null,Module._free(s),l=null,Module._free(f),p=null,Module._free(c),_=null,d=null}},new g};t.default=a},function(e,t,r){"use strict";var a=r(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(0),i=a(r(14)),o=function(){var e=0,t=0,r={frameData:null,timeStamp:null},a={timestamp:null,timezone:null};var o=0,s=0,u=0,f=0,l=null,c=null,p=null,d=0,_=0,m=0,h={width:0,height:0};function g(){this.decoder=new i.default,this.firstTime=0,this.lastMSW=0}return g.prototype={init:function(){this.decoder.setIsFirstFrame(!1),this.videoBufferList=new n.VideoBufferList,this.timeData=null},parseRTPData:function(i,p,d,g,v){var y,b=new Uint8Array(1048576);e=v.width,t=v.height,l={};var D=p[22],S=p.subarray(24+D,p.length-8);c=S.length;var T=(p[19]<<24)+(p[18]<<16)+(p[17]<<8)+p[16]>>>0;y=T>>>26===0?"2000":"20"+(T>>>26);var w=Date.UTC(y,(T>>>22&15)-1,T>>>17&31,T>>>12&31,T>>>6&63,63&T)/1e3;if(w-=28800,0===this.firstTime)this.firstTime=w,this.lastMSW=0,f=(p[21]<<8)+p[20],a={timestamp:this.firstTime,timestamp_usec:0};else{var E,C=(p[21]<<8)+p[20];E=C>f?C-f:C+65535-f,this.lastMSW+=E,w>this.firstTime&&(this.lastMSW-=1e3),this.firstTime=w,a={timestamp:w,timestamp_usec:this.lastMSW},f=C}0!==this.getFramerate()&&"undefined"!==typeof this.getFramerate()||"undefined"===typeof this.getTimeStamp()||this.setFramerate(Math.round(1e3/((a.timestamp-this.getTimeStamp().timestamp===0?0:1e3)+(a.timestamp_usec-this.getTimeStamp().timestamp_usec)))),this.setTimeStamp(a),u=(p[21]<<8)+p[20],s=c,(b=this.appendBuffer(b,S,o))[(o+=c)+s-2]=255,b[o+s-1]=217,h.width==e&&h.height==t||(0!=h.width?(h.width=e,h.height=t,l.resolution=h,l.resolution.decodeMode="canvas",l.resolution.encodeMode="mjpeg"):(h.width=e,h.height=t,l.decodeStart=h,l.decodeStart.decodeMode="canvas",l.decodeStart.encodeMode="mjpeg"));var I=1e3*a.timestamp+a.timestamp_usec;0==this.firstDiffTime?(_=0,this.firstDiffTime=Date.now()-I):(I-m<0&&(this.firstDiffTime=_+(Date.now()-I).toFixed(0)),(_=Date.now()-I-this.firstDiffTime)<0&&(this.firstDiffTime=0,_=0),_>8e3&&(l.error={errorCode:n.PLAYER_STATE_CODE.TIMEOUT},this.rtpReturnCallback(l))),m=I,r.frameData=null,this.decoder.setResolution(e,t),r.frameData=this.decoder.decode(b.subarray(0,o)),r.timeStamp=null,a=null===a.timestamp?this.getTimeStamp():a,r.timeStamp=a,!0===d&&(l.backupData={stream:b.subarray(0,o),width:e,height:t,codecType:"mjpeg"},null!==a.timestamp&&"undefined"!==typeof a.timestamp?l.backupData.timestamp_usec=a.timestamp_usec:l.backupData.timestamp=(u/90).toFixed(0)),o=0,r.playback=!1,l.decodedData=r,this.rtpReturnCallback(l)},parseRTPDataIFrame:function(e,t){var a=new Uint8Array(1048576),n={},i=e[22],u=e.subarray(24+i,e.length-8);c=u.length,s=c,(a=this.appendBuffer(a,u,o))[(o+=c)+s-2]=255,a[o+s-1]=217,n.decodeStart={},n.decodeStart.decodeMode="canvas",r.frameData=null,this.decoder.setResolution(t.width,t.height),r.frameData=this.decoder.decode(a.subarray(0,o),{use:"I"}),r.frameData.option={},r.frameData.option.channelId=t.channel,o=0,n.decodedData=r,this.rtpReturnCallback(n)},getVideoBuffer:function(e){if(null!==this.videoBufferList)return this.videoBufferList.searchNodeAt(e)},clearBuffer:function(){null!==this.videoBufferList&&this.videoBufferList.clear()},findCurrent:function(){null!==this.videoBufferList&&this.videoBufferList.searchTimestamp(this.getTimeStamp())},findIFrame:function(){null!==this.videoBufferList&&this.videoBufferList.findIFrame()},SetRtpInterlevedID:function(e){this.interleavedID=e},setTimeStamp:function(e){this.timeData=e},getTimeStamp:function(){return this.timeData},getRTPPacket:function(e,t){},calculatePacketTime:function(e){},ntohl:function(e){return(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3]>>>0},appendBuffer:function(e,t,r){if(r+t.length>=e.length){var a=new Uint8Array(e.length+1048576);a.set(e,0),e=a}return e.set(t,r),e},setFramerate:function(e){0<e&&"undefined"!==typeof e&&(d=e,null!==this.videoBufferList&&(this.videoBufferList.setMaxLength(6*d),this.videoBufferList.setBUFFERING(4*d)))},getFramerate:function(){return d},setReturnCallback:function(e){this.rtpReturnCallback=e},setBufferfullCallback:function(e){null!==this.videoBufferList&&this.videoBufferList.setBufferFullCallback(e)},setGovLength:function(e){p=e},getGovLength:function(){return p},setDecodingTime:function(e){this.decodingTime=e},getDropPercent:function(){return 0},getDropCount:function(){return 0},initStartTime:function(){this.firstDiffTime=0,this.calcGov=0},setCheckDelay:function(e){this.checkDelay=e}},new g};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;r(0);var a=function(){var e,t,r=!1;function a(){}return a.prototype={setIsFirstFrame:function(e){r=e},isFirstFrame:function(){return r},setResolution:function(r,a){e=r,t=a},decode:function(r,n){return!0===(n&&n.use&&"I"===n.use)||a.prototype.isFirstFrame()?{data:r,width:e,height:t,codecType:"mjpeg"}:(a.prototype.setIsFirstFrame(!0),{firstFrame:!0})}},new a};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;r(0);var a=function(){var e,t=null,r={1:"VideoSynopsis",2:"TrafficGate",3:"ElectronicPolice",4:"SinglePtzParking",5:"PtzParking",6:"Traffic",7:"Normal",8:"none",9:"ATM",10:"MetroIVS",11:"FaceDetection",12:"FaceRecognition",13:"NumberStat",14:"HeatMap",15:"VideoDiagnosis",16:"VideoEnhance",17:"SmokeFire",18:"VehicleAnalyse",19:"PersonFeature",20:"SDFaceDetect",21:"HeatMapPlan",22:"ATMFD",23:"SCR",24:"NumberStatPlan",25:"CourseRecord",26:"Highway",27:"City",28:"LeTrack",29:"ObjectStruct",30:"Stereo",31:"StereoPc",32:"HumanDetect",33:"SDPedestrain",34:"FaceAnalysis",35:"FaceAttribute",36:"FacePicAnalyse",37:"SDEP",38:"XRayDetect",39:"ObjectDetect",40:"CrowdDistriMap",41:"StereoBehavior",57:"BoatDetection",67:"OperateMonitor",108:"ObjectMonitor",135:"ShopTruckDetect"};function a(){this.firstTime=0,this.lastMSW=0}function n(e){return new TextDecoder("utf-8").decode(e)}function i(e){var t=(255&e[3])<<24|(255&e[2])<<16|(255&e[1])<<8|255&e[0],r=(t>>23&255)-127;return((2147483648&t?-1:1)*(1+(8388607&t)/8388607)*Math.pow(2,r)).toFixed(3)}function o(e){var t={result:!0,type:0};return t.params=JSON.parse(n(e)),t}function s(e){var t={result:!1},a=0,n=(e[a+1]<<8)+e[a];if(1!==n&&2!==n)return t;t.result=!0,t.type=5,t.params=null;var i=e[a+=2];if(0===i)return t;var o=e[a+=1];a+=1,t.params={},t.params.coordinate=128&o?8192:1024,t.params.isTrack=!!(127&o),t.params.object=[];for(var s=0;s<i;s++){var u={};u.objectId=(e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a],a+=4,u.operateType=e[a];var f=e[a+=1];a+=1,u.objectType=e[a];var l=e[a+=1];a+=1,a+=1,a+=1,u.classID=r[e[a]],a+=1,u.subType=e[a],a+=1,l>0&&(u.fatherId=[]);for(var c=0;c<l;c++)u.fatherId.push((e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a]),a+=4;f>0&&(u.track=[]);for(var p=0;p<f;p++){var d=(e[a+1]<<8)+e[a],_=(e[(a+=2)+1]<<8)+e[a],m=(e[(a+=2)+1]<<8)+e[a],h=(e[(a+=2)+1]<<8)+e[a];a+=2,u.track.push([d-m,_-h,d+m,_+h])}t.params.object.push(u)}return t}function u(e){var t={result:!1},r=0,a=(e[r+1]<<8)+e[r],n=(e[(r+=4)+3]<<24)+(e[r+2]<<16)+(e[r+1]<<8)+e[r];if(t.type=21,81===a){t.result=!0,t.params={},t.params.classType="VehiclesDistri",t.params.data=[];for(var i=(e[(r+=4)+1]<<8)+e[r];r<n&&i;)(u={}).PtzPresetId=e[r+=2],r+=1,u.ruleId=e[r],r+=1,u.ruleType=(e[r+1]<<8)+e[r],r+=2,u.maxNum=(e[r+1]<<8)+e[r],r+=2,u.carNum=(e[r+1]<<8)+e[r],t.params.data.push(u),i=(e[(r+=8)+1]<<8)+e[r]}else if(13===a){var o={16:"NumberStat",291:"QueueDetection",526:"ManNumDetection"},s=["enter","leave","in","cross","enterAgain","leaveAgain"];for(t.result=!0,t.params={},t.params.classType="NumberStat",t.params.data=[],r+=4;r<n;){var u,f=r;(u={data:{}}).ruleType=o[(e[(r+=2)+1]<<8)+e[r]];var l=f+(i=(e[(r+=4)+1]<<8)+e[r])-1;for(r+=2;r<l;){var c=e[r];u.data[c]||(u.data[c]={});var p=s[e[r+=1]-1],d=(e[(r+=3)+3]<<24)+(e[r+2]<<16)+(e[r+1]<<8)+e[r];u.data[c][p]=d,r+=4}r=l+1,t.params.data.push(u)}}return t}function f(e){var t={result:!1},r=e.length;if(!e||r<8)return t;var a=0;if(2!==e[a])return t;var n=e[++a];if(n<0||n>16)return t;if(a++,a+=6,64!==(r-8)/n)return t;t.result=!0,t.type=23,t.params={waterLevel:[]};for(var o=function(){var t={point:[{nx:0,ny:0},{nx:0,ny:0}],fRealRuler:[0,0],textPos:{nx:0,ny:0}};return t.point[0].nx=(e[a+1]<<8)+e[a],a+=2,t.point[0].ny=(e[a+1]<<8)+e[a],a+=2,t.point[1].nx=(e[a+1]<<8)+e[a],a+=2,t.point[1].ny=(e[a+1]<<8)+e[a],a+=2,t.nUpdateInterval=(e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a],a+=4,t.fLevel=i(e.slice(a,a+4)),a+=4,t.cStatus=e[a],a++,t.cColor=e[a],a++,a+=2,t.fRealRuler[0]=i(e.slice(a,a+4)),a+=4,t.fRealRuler[1]=i(e.slice(a,a+4)),a+=4,t.fDegree=i(e.slice(a,a+4)),a+=4,t.textPos.nx=(e[a+1]<<8)+e[a],a+=2,t.textPos.ny=(e[a+1]<<8)+e[a],a+=2,a+=28,t},s=0;s<n;s++)t.params.waterLevel.push(o());return t}function l(e){var t={type:25,params:[]};if(0===e[1])return t;for(var r=e.slice(8),a=r.length,n=0,i=function(){var e={};e.objectId=(r[n+3]<<24)+(r[n+2]<<16)+(r[n+1]<<8)+(r[n+0]<<0);var t=(r[(n+=4)+1]<<8)+(r[n+0]<<0),a=(r[(n+=2)+1]<<8)+(r[n+0]<<0),i=(r[(n+=2)+1]<<8)+(r[n+0]<<0),o=(r[(n+=2)+1]<<8)+(r[n+0]<<0);return n+=2,e.pos=[t,a,i,o],e.objectType=r[n],n+=1,n+=7,e};n<a;)t.params.push(i());return t}function c(e){for(var t={result:!1,type:20,params:[]},r=(e[0],e.length),a=0,i=e.slice(4),o=function(){var e={};e.objectId=(i[a+3]<<24)+(i[a+2]<<16)+(i[a+1]<<8)+(i[a+0]<<0),a+=4,e.result=!0,e.params={},e.custom=(i[a+1]<<8)+i[a],a+=2,e.objectStatus=i[a];var t=i[a+=1];a+=1,e.params.object=[];for(var r=null,o=0;o<t;o++){switch(i[a]){case 1:r=_(i.slice(a));break;case 2:r=d(i.slice(a));break;case 3:r=p(i.slice(a));break;case 4:r=m(i.slice(a))}e.params.object.push(r.info),a+=r.offset}1!=e.objectStatus&&3!=e.objectStatus||(e.params=null),0==t&&(e.params=null);var s=(i[a+1]<<8)+i[a];a+=2;var u=n(i.slice(a,a+s));return e.appendInfo=String.fromCharCode.apply(null,i.slice(a,a+s)),a+=s,e.appendInfo=u,e};a<r-4;)t.params.push(o());return t}function p(e){var t=0,r={type:e[0]};t+=1,r.pointCount=e[t],t+=1,r.lineWidth=e[t],t+=1,r.strokeStyle=e[t],t+=1,r.borderColor=[e[t+1],e[t+2],e[t+3],e[t]],r.borderColorType="RGBA",t+=4,r.fillColor=[e[t+1],e[t+2],e[t+3],e[t]],r.fillColorType="RGBA",t+=4,r.coordinate=[];for(var a=0;a<r.pointCount;a++){var n=(e[t+1]<<8)+e[t],i=(e[(t+=2)+1]<<8)+e[t];t+=2,r.coordinate.push([n,i])}return{info:r,offset:t}}function d(e){var t=0,r={type:e[0]};t+=1,r.pointCount=e[t],t+=1,r.lineWidth=e[t],t+=1,r.strokeStyle=e[t],t+=1,r.lineColor=[e[t+1],e[t+2],e[t+3],e[t]],r.lineColorType="RGBA",t+=4,r.coordinate=[];for(var a=0;a<r.pointCount;a++){var n=(e[t+1]<<8)+e[t],i=(e[(t+=2)+1]<<8)+e[t];t+=2,r.coordinate.push([n,i])}return{info:r,offset:t}}function _(e){var t=0,r={type:e[0]};t+=1,r.lineWidth=e[t],t+=1,r.strokeStyle=e[t],t+=1,t+=1,r.radius=(e[t+1]<<8)+e[t],t+=2;var a=(e[(t+=2)+1]<<8)+e[t],n=(e[(t+=2)+1]<<8)+e[t];return t+=2,r.coordinate=[a,n],r.borderColor=[e[t+1],e[t+2],e[t+3],e[t]],r.borderColorType="RGBA",t+=4,r.fillColor=[e[t+1],e[t+2],e[t+3],e[t]],r.fillColorType="RGBA",{info:r,offset:t+=4}}function m(e){var t=0,r={type:e[0]};t+=1,r.encodeType=e[t],t+=1;var a=(e[(t+=2)+1]<<8)+e[t],i=(e[(t+=2)+1]<<8)+e[t];t+=2,r.coordinate=[a,i],r.fontColor=[e[t+1],e[t+2],e[t+3],e[t]],t+=4,r.colorType="RGBA",r.fontSize=e[t],t+=1,r.textAlign=e[t],t+=1,r.textBaseline="top",r.textLength=(e[t+1]<<8)+e[t],t+=2;for(var o=e.slice(t,t+r.textLength),s=0;s<r.textLength;s++)if(0===o[s]){o=o.slice(0,s);break}try{r.content=n(o)}catch(e){r.content=""}return{info:r,offset:t+=r.textLength}}function h(e,t){t.hasOwnProperty("attribute80")||(t.attribute80=[]);var r=1,a=e[r];r+=1;var n={color:{}};n.color.valid=e[r],r+=1,n.carModel=e[r],r+=1,n.color.red=e[r],r+=1,n.color.green=e[r],r+=1,n.color.blue=e[r],r+=1,n.color.alpha=e[r],r+=1,n.brand=(e[r+1]<<8)+e[r],r+=2,n.subBrand=(e[r+1]<<8)+e[r],r+=2,n.year=(e[r+1]<<8)+e[r],r+=2,n.reliability=e[r],r+=1;var i=(e[(r+=1)+1]<<8)+e[r],o=(e[(r+=2)+1]<<8)+e[r],s=(e[(r+=2)+1]<<8)+e[r],u=(e[(r+=2)+1]<<8)+e[r];return r+=2,n.windowPosition=[i-s,o-u,i+s,o+u],t.attribute80.push(n),a}function g(e,t){t.hasOwnProperty("attribute81")||(t.attribute81=[]);var r={},a=1,n=e[a],i=(e[(a+=1)+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],s=(e[(a+=2)+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a];return a+=2,r.mainPosition=[i-s,o-u,i+s,o+u],i=(e[a+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],s=(e[(a+=2)+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a],a+=2,r.coPosition=[i-s,o-u,i+s,o+u],r.mainSafetyBelt=e[a]>>2&3,r.coSafetyBelt=3&e[a],a+=1,r.mainSunvisor=e[a]>>2&3,r.coSunvisor=3&e[a],a+=1,t.attribute81.push(r),n}function v(e,t){t.hasOwnProperty("attribute82")||(t.attribute82=[]);var r={},a=1,n=e[a];return a+=1,r.plateEncode=e[a],a+=1,r.plateInfoLen=e[a],a+=1,r.plateInfo=e.subarray(a,a+r.plateInfoLen),t.attribute82.push(r),n}function y(e,t){t.hasOwnProperty("attribute83")||(t.attribute83=[]);var r={},a=1,n=e[a];return a+=1,r.color={},r.color.valid=e[a],a+=1,r.color.red=e[a],a+=1,r.color.green=e[a],a+=1,r.color.blue=e[a],a+=1,r.color.alpha=e[a],a+=1,r.country=String.fromCharCode.apply(null,e.subarray(a,a+4)),a+=4,r.plateType=(e[a+1]<<8)+e[a],a+=2,a+=1,r.plateWidth=(e[a+1]<<8)+e[a],t.attribute83.push(r),n}function b(e,t){t.hasOwnProperty("attribute84")||(t.attribute84=[]);var r={},a=1,n=e[a];a+=1,r.fatherCount=e[a],a+=1,r.trackCount=e[a],a+=1,r.trackType=e[a],a+=1,a+=3,r.fatherCount>0&&(r.fatherID=[]);for(var i=0;i<r.fatherCount;i++)r.fatherID.push((e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a]),a+=4;r.trackCount>0&&(r.track=[]);for(var o=0;o<r.trackCount;o++){var s=(e[a+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a],f=(e[(a+=2)+1]<<8)+e[a],l=(e[(a+=2)+1]<<8)+e[a];a+=2,r.track.push([s-f,u-l,s+f,u+l])}return t.attribute84.push(r),n}function D(e,t){t.hasOwnProperty("attribute85")||(t.attribute85=[]);var r={},a=1,n=e[a];a+=1,r.colorSpace=e[a],a+=1,r.mainColorCount=e[a],a+=1,r.mainColorCount>0&&(r.mainColorInfo=[]);for(var i=0;i<r.mainColorCount;i++){var o={},s=(e[a+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a],f=(e[(a+=2)+1]<<8)+e[a],l=(e[(a+=2)+1]<<8)+e[a];a+=2,o.rect=[s-f,u-l,s+f,u+l],o.color=(e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a],a+=4,r.mainColorInfo.push(o)}return t.attribute85.push(r),n}function S(e,t){t.hasOwnProperty("attribute86")||(t.attribute86=[]);var r={},a=1,n=e[a];return a+=1,a+=1,r.speedType=e[a],a+=1,r.speed=e[a+1]<<8+e[a],a+=2,r.speedX=e[a+1]<<8+e[a],a+=2,r.speedY=(e[a+1]<<8)+e[a],t.attribute86.push(r),n}function T(e,t){t.hasOwnProperty("attribute87")||(t.attribute87=[]);var r={},a=1,n=e[a];a+=1;var i=(e[(a+=2)+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],s=(e[(a+=2)+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a];return r.track=[[i-s,o-u,i+s,o+u]],t.attribute87.push(r),n}function w(e,t){t.hasOwnProperty("attribute88")||(t.attribute88=[]);var r={},a=1,n=e[a];return a+=1,r.age=e[a],a+=1,r.sex=e[a],a+=1,r.face=e[a],a+=1,r.glass=e[a],a+=1,r.hat=e[a],a+=1,r.call=e[a],a+=1,r.backpack=e[a],a+=1,r.umbrella=e[a],a+=1,r.height=e[a],a+=1,r.mask=e[a]>>2&3,r.beard=3&e[a],t.attribute88.push(r),n}function E(e,t){t.hasOwnProperty("attribute89")||(t.attribute89=[]);var r={},a=1,n=e[a];a+=1,r.yawAngle=parseInt((e[a+1]<<8)+e[a]),a+=2,r.rollAngle=parseInt((e[a+1]<<8)+e[a]),a+=2,r.pitchAngle=parseInt((e[a+1]<<8)+e[a]);var i=(e[(a+=2)+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a];a+=2,r.lEyePos=[i,o],i=(e[a+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],a+=2,r.rEyePos=[i,o],i=(e[a+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],a+=2,r.nosePos=[i,o],i=(e[a+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],a+=2,r.lMouthPos=[i,o],i=(e[a+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],a+=2,r.rMouthPos=[i,o];var s=e[a];a+=3,s>0&&(r.featurePos=[]);for(var u=0;u<s;u++)i=(e[a+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],a+=2,r.featurePos.push([i,o]);return t.attribute89.push(r),n}function C(e,t){t.hasOwnProperty("attribute8C")||(t.attribute8C=[]);var r={},a=1,n=e[a];a+=1,r.hangingCount=e[a],a+=1,r.tissueCount=e[a],a+=1,r.sunVisorCount=e[a],a+=1,r.annualInspectionCount=e[a],a+=1,a+=6,r.hangingCount>0&&(r.hangingCount=[]);for(var i=0;i<r.hangingCount;i++){var o=(e[a+1]<<8)+e[a],s=(e[(a+=2)+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a],f=(e[(a+=2)+1]<<8)+e[a];a+=2,r.hangingPos.push([o-u,s-f,o+u,s+f])}for(r.tissueCount>0&&(r.tissueCount=[]),i=0;i<r.tissueCount;i++)o=(e[a+1]<<8)+e[a],s=(e[(a+=2)+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a],f=(e[(a+=2)+1]<<8)+e[a],a+=2,r.tissueCount.push([o-u,s-f,o+u,s+f]);for(r.sunVisorCount>0&&(r.sunVisorCount=[]),i=0;i<r.tissueCount;i++)o=(e[a+1]<<8)+e[a],s=(e[(a+=2)+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a],f=(e[(a+=2)+1]<<8)+e[a],a+=2,r.sunVisorCount.push([o-u,s-f,o+u,s+f]);for(r.annualInspectionCount>0&&(r.annualInspectionCount=[]),i=0;i<r.tissueCount;i++)o=(e[a+1]<<8)+e[a],s=(e[(a+=2)+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a],f=(e[(a+=2)+1]<<8)+e[a],a+=2,r.annualInspectionCount.push([o-u,s-f,o+u,s+f]);return t.attribute8C.push(r),n}function I(e,t){t.hasOwnProperty("attribute8E")||(t.attribute8E=[]);var r={},a=1,n=e[a];a+=1,r.nameCodecFormat=e[a];var i=e[a+=1];return a+=1,r.name=String.fromCharCode.apply(null,e.subarray(a,i)),t.attribute8E.push(r),n}function A(e,t){var r=0,a=function(e){r+=e=e||1};e[r],a(),e[r],a();var n=(e[r+1]<<8)+e[r];a(2);var i=e[r],o=e.subarray(r,e.length),s=0,u={149:x,150:M}[i];return u?(s=u(o,t,n),r+s):e.length}function M(e,t,r){t.hasOwnProperty("attribute96")||(t.attribute96=[]);var a=0,n={},i=function(e){a+=e=e||1};e[a],i();var o=r||e[a];i();var s=e[a];i(),e[a],i();var u=function(t){for(var r=0,n=[];r++<t;){var o=(e[a+1]<<8)+e[a];i(2);var s=(e[a+1]<<8)+e[a];i(2),n.push([o,s])}return n},f=function(){var t={};t.lanNumber=e[a],i();var r=e[a];i(),t.lanType=0===r?"dashed":"solid";var n=e[a];i(),e[a],i(),t.leftLanPosArr=u(n);var o=e[a];i(),e[a],i(),t.rightLanPosArr=u(o);var s=e.subarray(a,a+16);i(16);var f=-1===s.indexOf(0)?16:s.indexOf(0);t.lanName=String.fromCharCode.apply(String,s.subarray(0,f));var l=e[a];i(),t.virtualLineCircleArr=[],e[a],i();var c=function(){var t={};t.id=e[a],i(),t.color=["blue","red"][e[a]],i(),t.lineCircleCrossLeftLan=u(2),t.lineCircleCrossRightLan=u(2);var r=e[a];t.leftLanTurnPosArr=[],i();var n=e[a];return t.rightLanTurnPosArr=[],i(),t.leftLanTurnPosArr=u(r),t.rightLanTurnPosArr=u(n),t};return t.virtualLineCircleArr=function(e){for(var t=[],r=0;r<e;r++){var a=c();t.push(a)}return t}(l),t};n.lanArr=function(e){for(var t=[],r=0;r<e;r++){var a=f();t.push(a)}return t}(s);var l=e[a];return i(),e[a],i(),n.scalePointArr=function(t){for(var r=[],n=0;n<t;n++){var o={};o.pos=u(1)[0],o.value=(e[a+1]<<8)+e[a],i(2),r.push(o)}return r}(l),t.attribute96.push(n),o}function x(e,t,r){t.hasOwnProperty("attribute95")||(t.attribute95=[]);var a=0,n={},i=function(e){a+=e=e||1},o=function(t){for(var r=0,n=[];r++<t;){var o=(e[a+1]<<8)+e[a];i(2);var s=(e[a+1]<<8)+e[a];i(2),n.push([o,s])}return n};e[a],i();var s=r||e[a];i();var u=e[a];i(),e[a],i();var f=function(){var t={};t.lanNum=e[a],i();var r=e[a];i(),t.leftLanPosArr=o(r);var n=e[a];i(),e[a],i(),t.rightLanPosArr=o(n);var s=e[a];i(),e[a],i();var u=function(){var t={};t.id=e[a],i(),t.color=["yellow","red"][e[a]],i(),t.lineCircleCrossLeftLan=o(2),t.lineCircleCrossRightLan=o(2);var r=e[a];i();var n=e[a];return i(),t.leftLanTurnPosArr=o(r),t.rightLanTurnPosArr=o(n),t};return t.corssLineCircleArr=function(e){for(var t=[],r=0;r<e;r++){var a=u();t.push(a)}return t}(s),t};return n.lanArr=function(e){for(var t=[],r=0;r<e;r++){var a=f();t.push(a)}return t}(u),t.attribute95.push(n),s}function P(e,t,r){t.hasOwnProperty("attribute94")||(t.attribute94=[]);var a=0,n={},i=function(e){a+=e=e||1};e[a],i();var o=r||e[a];i(),n.distance=((e[a]<<0)+(e[a+1]<<8))/100,i(2),n.angle=((e[a]<<0)+(e[a+1]<<8))/100,i(2),n.speed=((e[a]<<0)+(e[a+1]<<8))/100,i(2),n.targetType=["unknow","human","vehicle"][e[a]],i(),n.lanNumber=function(e){var t="unknow";return e>0&&(t="lan"+e),t}(e[a]),i(),n.id=(e[a]<<0)+(e[a+1]<<8),i(2);var s=(e[a]<<0)+(e[a+1]<<8)+(e[a+2]<<16)+(e[a+3]<<24);i(4);var u=(e[a]<<0)+(e[a+1]<<8)+(e[a+2]<<16)+(e[a+3]<<24);return i(4),n.pos=[s/100,u/100],t.attribute94.push(n),o}function k(e,t,r){t.hasOwnProperty("attribute97")||(t.attribute97=[]);var a=0,n={},i=function(e){a+=e=e||1};e[a],i();var o=r||e[a];return i(),n.isValid=1===e[a],i(),i(),n.id=(e[a]<<0)+(e[a+1]<<8)+(e[a+2]<<16)+(e[a+3]<<24),t.attribute97.push(n),o}function O(e,t,r){t.hasOwnProperty("attribute98")||(t.attribute98=[]);var a=0,n={},i=function(e){a+=e=e||1};e[a],i();var o=r||e[a];return i(),i(6),n.longitude=void 0,i(8),n.latitude=void 0,i(8),t.attribute98.push(n),o}function L(e,t){for(var r={128:h,129:g,130:v,131:y,132:b,133:D,134:S,135:T,136:w,137:E,140:C,142:I,254:A,148:P,149:x,150:M,151:k,152:O},a=0;a<e.length;){var n=e[a],i=e.subarray(a,e.length);if(void 0===r[n])break;a+=r[n].call(null,i,t)}}function R(e,t){t.hasOwnProperty("vehicleObject")||(t.vehicleObject=[]);var r={},a=0;r.type=e[a],a+=1;var n=(e[(a+=1)+1]<<8)+e[a];a+=2,r.objectId=(e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a];var i=(e[(a+=4)+1]<<8)+e[a],o=(e[(a+=2)+1]<<8)+e[a],s=(e[(a+=2)+1]<<8)+e[a],u=(e[(a+=2)+1]<<8)+e[a];return a+=2,r.track=[[i-s,o-u,i+s,o+u]],r.valid=e[a],r.xSize=s,r.ySize=u,r.centerX=i,r.centerY=o,a+=1,r.operateType=e[a],a+=1,a+=2,L(e.subarray(a,n),r),t.vehicleObject.push(r),n}function F(e,t){t.hasOwnProperty("faceObject")||(t.faceObject=[]);var r={},a=0;r.type=e[a],a+=1;var n=(e[(a+=1)+1]<<8)+e[a];return n<12?0:(a+=2,r.objectId=(e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a],a+=4,r.version=e[a],a+=1,a+=3,r.faceData=e.subarray(a,n),t.faceObject.push(r),n)}function U(e,t){t.hasOwnProperty("commonObject")||(t.commonObject=[]);var r={},a=0;r.type=e[a],a+=1;var n=(e[(a+=1)+1]<<8)+e[a];return a+=2,r.objectId=(e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a],a+=4,r.operateType=e[a],a+=1,r.beliefVal=e[a],a+=3,L(e.subarray(a,n),r),t.commonObject.push(r),n}function B(e,t,r){var a=0,n=(e[a+3]<<24)+(e[a+2]<<16)+(e[a+1]<<8)+e[a],i=e[a+=4];if(a+=1,a+=3,0==i)return a;t.groupId=n,t.object={};for(var o=0;o<i;o++){var s=e[a],u=e.subarray(a,e.length),f=0;switch(s){case 2:case 5:f=R(u,t.object);break;case 15:f=F(u,t.object);break;default:f=U(u,t.object)}if(0==f)return 0;a+=f}return r(t),a}function N(e,t,r){var a={coordinate:8192};if(t.length<32)return!1;var n=4;a.classID=e;var i=t[n];if(0==i)return!0;a.groupCount=i,n+=1,n+=7,a.cameral=[];for(var o=0;o<20;o++)a.cameral.push(t[n+o]);n+=20;for(var s=0;s<a.groupCount;s++){var u=B(t.subarray(n,t.length),JSON.parse(JSON.stringify(a)),r);if(u<=0)break;n+=u}return!0}return a.prototype={init:function(){},parseRTPData:function(a,n,i,p,d,_){var m,h=(n[19]<<24)+(n[18]<<16)+(n[17]<<8)+n[16]>>>0;m=h>>26===0?"2000":"20"+(h>>26);var g=Date.UTC(m,(h>>22&15)-1,h>>17&31,h>>12&31,h>>6&63,63&h)/1e3;if(g-=28800,0===this.firstTime)this.firstTime=g,this.lastMSW=0,t=(n[21]<<8)+n[20],e={timestamp:this.firstTime,timestamp_usec:0};else{var v,y=(n[21]<<8)+n[20];v=y>=t?y-t:y+65535-t,this.lastMSW+=v,g>this.firstTime&&(this.lastMSW-=1e3),this.firstTime=g,e={timestamp:g,timestamp_usec:this.lastMSW},t=y}!function(t,a,n,i){var p=a[22],d=a.subarray(24+p,a.length-8);switch(t){case 0:n({ivsDraw:o(d),timeStamp:e,channel:i});break;case 5:n({ivsDraw:s(d),timeStamp:e,channel:i});break;case 6:break;case 14:var _=[];if(function(e,t){for(var a=e.length,n=0;n+4<a;){var i=e[n],o=(e[n+1],(e[n+3]<<8)+e[n+2]),s=e.subarray(n,n+o);if(n+=o,161!==i&&!N(r[i-64],s,t))break}}(d,function(e){_.push(e)}),_.length){var m={result:!1,type:14,params:_};n({ivsDraw:m,timeStamp:e,channel:i})}break;case 20:n({ivsDraw:c(d),timeStamp:e,channel:i});break;case 21:n({ivsDraw:u(d),timeStamp:e,channel:i});break;case 23:n({ivsDraw:f(d),timeStamp:e,channel:i});break;case 25:n({ivsDraw:l(d),timeStamp:e,channel:i})}}(n[5],n,this.rtpReturnCallback,_)},setBufferfullCallback:function(){},setReturnCallback:function(e){this.rtpReturnCallback=e}},new a};t.default=a}]);
|