1 line
26 KiB
JavaScript
1 line
26 KiB
JavaScript
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},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=3)}([function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var n=r(0);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],n=("ie"==r[1]||"trident"==r[1])&&document.documentMode,i={name:"version"==r[1]?r[3]:"trident"==r[1]?"ie":r[1],version:n||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]}};i[i.name]=!0,i[i.name+parseInt(i.version,10)]=!0,i.Platform[i.Platform.name]=!0,i.Platform.ios&&(i.Platform.ipod=!0);i.Engine={};var o=function(e,t){i.Engine.name=e,i.Engine[e+t]=!0,i.Engine.version=t};if(i.ie)switch(i.Engine.trident=!0,i.version){case 6:o("trident",4);break;case 7:o("trident",5);break;case 8:o("trident",6)}i.firefox&&(i.Engine.gecko=!0,i.version>=3?o("gecko",19):o("gecko",18));if(i.safari||i.chrome)switch(i.Engine.webkit=!0,i.version){case 2:o("webkit",419);break;case 3:o("webkit",420);break;case 4:o("webkit",525)}i.opera&&(i.Engine.presto=!0,i.version>=9.6?o("presto",960):i.version>=9.5?o("presto",950):o("presto",925));if("unknown"==i.name)switch((e.match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":i.Engine.webkit=!0;break;case"gecko":i.Engine.gecko=!0}return i},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 n=0,i=0;for(n=0;n<r&&!(e<t[i]);n++)i++;return n},r=function(r,n){var i=0,o=0,a=0,u=0,s=0;return o=t(i=r>0?r:8191&-r,e,15)-6,a=o+(n>>6&15)-13,u=(0===i?32:o>=0?i>>o:i<<-o)*(n&parseInt("077",8))+48>>4,s=a>=0?u<<a&32767:u>>-a,(r^n)<0?-s:s};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,n=0;for(n=r(e.zp[0]>>2,e.dq[0]),t=1;t<6;t++)n+=r(e.zp[t]>>2,e.dq[t]);return n},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,n=0;return e.ppp>=256?e.yu:(t=e.yl>>6,r=e.yu-t,n=e.ppp>>2,r>0?t+=r*n>>6:r<0&&(t+=r*n+63>>6),t)},this.quantize=function(r,n,i,o){var a=0,u=0,s=0;return a=Math.abs(r),u=t(a>>1,e,15),s=t((u<<7)+(a<<7>>u&127)-(n>>2),i,o),r<0?1+(o<<1)-s:0===s?1+(o<<1):s},this.reconstruct=function(e,t,r){var n=0,i=0;return(n=t+(r>>2))<0?e?-32768:0:(i=128+(127&n)<<7>>14-(n>>7&15),e?i-32768:i)},this.update=function(r,n,i,o,a,u,s,f){var p=0,_=0,l=0,c=0,d=0,m=0,h=0,g=0,v=0,y=0,b=0,E=0,x=0,T=0;if(T=s<0?1:0,_=32767&a,v=f.yl>>15,E=f.yl>>10&31,x=32+E<<v,b=(y=v>9?31744:x)+(y>>1)>>1,g=0===f.td?0:_<=b?0:1,f.yu=n+(i-n>>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,c=0;else for(m=T^f.pk[0],c=f.pp[1]-(f.pp[1]>>7),0!==s&&((h=m?f.pp[0]:-f.pp[0])<-8191?c-=256:c+=h>8191?255:h>>5,T^f.pk[1]?c<=-12160?c=-12288:c>=12416?c=12288:c-=128:c<=-12416?c=-12288:c>=12160?c=12288:c+=128),f.pp[1]=c,f.pp[0]-=f.pp[0]>>8,0!==s&&(0===m?f.pp[0]+=192:f.pp[0]-=192),d=15360-c,f.pp[0]<-d?f.pp[0]=-d:f.pp[0]>d&&(f.pp[0]=d),p=0;p<6;p++)f.zp[p]-=5===r?f.zp[p]>>9:f.zp[p]>>8,32767&a&&((a^f.dq[p])>=0?f.zp[p]+=128:f.zp[p]-=128);for(p=5;p>0;p--)f.dq[p]=f.dq[p-1];return 0===_?f.dq[0]=a>=0?32:64544:(l=t(_,e,15),f.dq[0]=a>=0?(l<<6)+(_<<6>>l):(l<<6)+(_<<6>>l)-1024),f.sr[1]=f.sr[0],0===u?f.sr[0]=32:u>0?(l=t(u,e,15),f.sr[0]=(l<<6)+(u<<6>>l)):u>-32768?(l=t(_=-u,e,15),f.sr[0]=(l<<6)+(_<<6>>l)-1024):f.sr[0]=64544,f.pk[1]=f.pk[0],f.pk[0]=T,f.td=1===g?0:c<-11776?1:0,f.dms+=o-f.dms>>5,f.dml+=(o<<2)-f.dml>>7,1===g?f.ppp=256:n<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 n(){e=360,t=240,r=null,this._length=0,this.head=null,this.tail=null,this.curIdx=0}return n.prototype={push:function(e,n,i,o,a,u){var s=new VideoBufferNode(e,n,i,o,a,u);return this._length>0?(this.tail.next=s,s.previous=this.tail,this.tail=s):(this.head=s,this.tail=s),this._length+=1,null!==r&&this._length>=t&&r(),s},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,n=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,n++;return r<n?t=null:this.curIdx=n,t},findIFrame:function(e){var t=this.head,r=this._length,n=1;if(0===r)throw new Error("Failure: non-existent node in this list.");for(;n<this.curIdx;)t=t.next,n++;if(!0===e)for(;"I"!==t.frameType;)t=t.next,n++;else for(;"I"!==t.frameType;)t=t.previous,n--;return r<n?t=null:this.curIdx=n,t}},new n},t.debug=t.commonOption=void 0,t.formAuthorizationResponse=function(e,t,r,n,i,o){var u=null,s=null;return u=(0,a.default)(e+":"+n+":"+t).toLowerCase(),s=(0,a.default)(o+":"+r).toLowerCase(),(0,a.default)(u+":"+i+":"+s).toLowerCase()},t.pubsub=void 0,t.stringToUint8Array=function(e){for(var t=e.length,r=new Uint8Array(new ArrayBuffer(t)),n=0;n<t;n++)r[n]=e.charCodeAt(n);return r};var i=n(r(4)),o=n(r(5)),a=n(r(8));t.debug={log:function(){},error:function(){},count:function(){},info:function(){}};(t.commonOption={}).VIDEOENCODETYPE={H264:1,H265:2};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};t.Script=function(){function e(){}return e.createFromElementId=function(t){for(var r=document.getElementById(t),n="",i=r.firstChild;i;)3===i.nodeType&&(n+=i.textContent),i=i.nextSibling;var o=new e;return o.type=r.type,o.source=n,o},e.createFromSource=function(t,r){var n=new e;return n.type=t,n.source=r,n},e}(),t.Shader=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.Program=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.Texture=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,n){var i=this.gl;e||(e=[i.TEXTURE0,i.TEXTURE1,i.TEXTURE2]),i.activeTexture(e[t]),i.bindTexture(i.TEXTURE_2D,this.texture),i.uniform1i(i.getUniformLocation(r.program,n),t)}},t}();t.Queue=function(){return(0,o.default)(function e(){(0,i.default)(this,e),this.first=null,this.size=0},[{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}}])}();var u={},s=-1;t.pubsub={publish:function(e,t){if(!u[e])return!1;for(var r=u[e],n=r?r.length:0;n--;)r[n].func(t);return this},subscribe:function(e,t){u[e]||(u[e]=[]);var r=(++s).toString();return u[e].push({token:r,func:t}),r},unsubscribe:function(e){for(var t in u)if(u[t])for(var r=0,n=u[t].length;r<n;r++)if(u[t][r].token===e)return u[t].splice(r,1),e},getTopicFunc:function(e){return u[e]?u[e]:[]}}},function(e,t,r){"use strict";var n=r(0),i=(r(2),n(r(9))),o=n(r(10));importScripts("/module/libDecodeSDK.js"),addEventListener("message",function(e){var t=e.data;switch(u=e.data.channelId,t.type){case"MediaData":null===a&&(a=new f),t.data.rtspInterleave[1],a.parseRTPData(t.data.payload)}},!1),Module.onRuntimeInitialized=function(){Module._DECODE_Init(),s("WorkerReady")};var a=null,u=null;function s(e,t,r){var n={type:e,data:t,channelId:u,option:r};"canvasRender"===e?postMessage(n,[t.buffer]):postMessage(n)}var f=function(){var e=new p,t=0,r=null;function n(){this.decoder=new o.default}return n.prototype={init:function(e){},parseRTPData:function(n){for(var i=null,o={},a=n[22],u=(n[11]<<24)+(n[10]<<16)+(n[9]<<8)+n[8]>>>0,f=n.subarray(24+a,n.length-8),p=n.subarray(n.length-8,n.length),_=(p[7],p[6],p[5],p[4],(n[19]<<24)+(n[18]<<16)+(n[17]<<8)+n[16]>>>0),l=[],c=0;c<=f.length;)if(0==f[c])if(0==f[c+1])if(1==f[c+2]){if(l.push(c),5==(31&f[c+=3])||1==(31&f[c]))break}else 0==f[c+2]?c++:c+=3;else c+=2;else c+=1;for(c=0;c<l.length;c++)switch(i=f.subarray(l[c]+3,l[c+1]),31&f[l[c]+3]){default:break;case 1:"P",l[c]-1;break;case 5:"I",l[c]-1;break;case 28:break;case 7:e.parse(i),r=e.getSizeInfo().decodeSize;break;case 8:case 6:case 9:}t!==r&&(this.decoder.free(),t=r,this.decoder.setOutputSize(t)),o.frameData=null,o.frameData=this.decoder.decode(n),null!=o.frameData&&null!=o.frameData.data&&(o.frameData.option.time=_,o.frameData.option.frameNo=u,s("canvasRender",o.frameData.data,o.frameData.option))}},new n};function p(){var e=7,t=7,r=2,n=3,o=4,a=5,u=8,s=16,f=32,p=255,_=0,l=null;function c(){_=0,l=new i.default}function d(r,i){var o=i,a=_+o>>n;return o=_+i&e,r[a]>>t-(o&t)&1}function m(e,t){var r=_>>n,i=8*(r+1)-_;if(i<8)for(var o=0;o<3;o++){var a=e[r+o];a=0==o?a>>i<<i:2==o?a&255>>8-i|1<<i:0,e.set([a],r+o)}else e.set([0],r),e.set([1],r+1)}function h(e,t){var r=0;if(1===t)r=d(e,0);else for(var n=0;n<t;n++)r=(r<<1)+d(e,n);return _+=t,r}function g(e,t){for(var n=0,i=0,o=t;_+o<8*e.length&&!d(e,o++);)n++;if(0===n)return _+=1,0;i=1<<n;for(var a=n-1;a>=0;a--,o++)i|=d(e,o)<<a;return _+=n*r+1,i-1}function v(e,t){var n=g(e,t);return 1&n?(n+1)/r:-n/r}function y(e){l.put("cpb_cnt_minus1",g(e,0)),l.put("bit_rate_scale",h(e,o)),l.put("cpb_size_scale",h(e,o));for(var t=l.get("cpb_cnt_minus1"),r=new Array(t),n=new Array(t),i=new Array(t),u=0;u<=t;u++)r[u]=g(e,0),n[u]=g(e,0),i[u]=h(e,1);l.put("bit_rate_value_minus1",r),l.put("cpb_size_value_minus1",n),l.put("cbr_flag",i),l.put("initial_cpb_removal_delay_length_minus1",h(e,a)),l.put("cpb_removal_delay_length_minus1",h(e,a)),l.put("dpb_output_delay_length_minus1",h(e,a)),l.put("time_offset_length",h(e,a))}return c.prototype={parse:function(e){_=0,l.clear(),l.put("forbidden_zero_bit",h(e,1)),l.put("nal_ref_idc",h(e,r)),l.put("nal_unit_type",h(e,a)),l.put("profile_idc",h(e,u)),l.put("profile_compatibility",h(e,u)),l.put("level_idc",h(e,u)),l.put("seq_parameter_set_id",g(e,0));var t=l.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)&&(l.put("chroma_format_idc",g(e,0)),l.get("chroma_format_idc")===n&&l.put("separate_colour_plane_flag",h(e,1)),l.put("bit_depth_luma_minus8",g(e,0)),l.put("bit_depth_chroma_minus8",g(e,0)),l.put("qpprime_y_zero_transform_bypass_flag",h(e,1)),l.put("seq_scaling_matrix_present_flag",h(e,1)),l.get("seq_scaling_matrix_present_flag"))){for(var i=l.get("chroma_format_idc")!==n?u:12,o=new Array(i),c=0;c<i;c++)if(o[c]=h(e,1),o[c])for(var d=c<6?s:64,b=8,E=8,x=0;x<d;x++)E&&(E=(b+v(e,0)+256)%256),b=0===E?b:E;l.put("seq_scaling_list_present_flag",o)}if(l.put("log2_max_frame_num_minus4",g(e,0)),l.put("pic_order_cnt_type",g(e,0)),0===l.get("pic_order_cnt_type"))l.put("log2_max_pic_order_cnt_lsb_minus4",g(e,0));else if(1===l.get("pic_order_cnt_type")){l.put("delta_pic_order_always_zero_flag",h(e,1)),l.put("offset_for_non_ref_pic",v(e,0)),l.put("offset_for_top_to_bottom_field",v(e,0)),l.put("num_ref_frames_in_pic_order_cnt_cycle",g(e,0));for(var T=0;T<l.get("num_ref_frames_in_pic_order_cnt_cycle");T++)l.put("num_ref_frames_in_pic_order_cnt_cycle",v(e,0))}return l.put("num_ref_frames",g(e,0)),l.put("gaps_in_frame_num_value_allowed_flag",h(e,1)),l.put("pic_width_in_mbs_minus1",g(e,0)),l.put("pic_height_in_map_units_minus1",g(e,0)),l.put("frame_mbs_only_flag",h(e,1)),0===l.get("frame_mbs_only_flag")&&l.put("mb_adaptive_frame_field_flag",h(e,1)),l.put("direct_8x8_interence_flag",h(e,1)),l.put("frame_cropping_flag",h(e,1)),1===l.get("frame_cropping_flag")&&(l.put("frame_cropping_rect_left_offset",g(e,0)),l.put("frame_cropping_rect_right_offset",g(e,0)),l.put("frame_cropping_rect_top_offset",g(e,0)),l.put("frame_cropping_rect_bottom_offset",g(e,0))),l.put("vui_parameters_present_flag",h(e,1)),l.get("vui_parameters_present_flag")&&function(e){l.put("aspect_ratio_info_present_flag",h(e,1)),l.get("aspect_ratio_info_present_flag")&&(l.put("aspect_ratio_idc",h(e,u)),l.get("aspect_ratio_idc")===p&&(m(e),l.put("sar_width",h(e,s)),m(e),l.put("sar_height",h(e,s)))),l.put("overscan_info_present_flag",h(e,1)),l.get("overscan_info_present_flag")&&l.put("overscan_appropriate_flag",h(e,1)),l.put("video_signal_type_present_flag",h(e,1)),l.get("video_signal_type_present_flag")&&(l.put("video_format",h(e,n)),l.put("video_full_range_flag",h(e,1)),l.put("colour_description_present_flag",h(e,1)),l.get("colour_description_present_flag")&&(l.put("colour_primaries",h(e,u)),l.put("transfer_characteristics",h(e,u)),l.put("matrix_coefficients",h(e,u)))),l.put("chroma_loc_info_present_flag",h(e,1)),l.get("chroma_loc_info_present_flag")&&(l.put("chroma_sample_loc_type_top_field",g(e,0)),l.put("chroma_sample_loc_type_bottom_field",g(e,0))),l.put("timing_info_present_flag",h(e,1)),l.get("timing_info_present_flag")&&(l.put("num_units_in_tick",h(e,f)),l.put("time_scale",h(e,f)),l.put("fixed_frame_rate_flag",h(e,1))),l.put("nal_hrd_parameters_present_flag",h(e,1)),l.get("nal_hrd_parameters_present_flag")&&y(e),l.put("vcl_hrd_parameters_present_flag",h(e,1)),l.get("vcl_hrd_parameters_present_flag")&&y(e),(l.get("nal_hrd_parameters_present_flag")||l.get("vcl_hrd_parameters_present_flag"))&&l.put("low_delay_hrd_flag",h(e,1)),l.put("pic_struct_present_flag",h(e,1)),l.put("bitstream_restriction_flag",h(e,1)),l.get("bitstream_restriction_flag")&&(l.put("motion_vectors_over_pic_boundaries_flag",h(e,1)),l.put("max_bytes_per_pic_denom",g(e,0)),l.put("max_bits_per_mb_denom",g(e,0)))}(e),!0},getSizeInfo:function(){var e=0,t=0;0===l.get("chroma_format_idc")?e=t=0:1===l.get("chroma_format_idc")?e=t=r:l.get("chroma_format_idc")===r?(e=r,t=1):l.get("chroma_format_idc")===n&&(0===l.get("separate_colour_plane_flag")?e=t=1:1===l.get("separate_colour_plane_flag")&&(e=t=0));var i=l.get("pic_width_in_mbs_minus1")+1,o=l.get("pic_height_in_map_units_minus1")+1,a=(r-l.get("frame_mbs_only_flag"))*o,u=0,f=0,p=0,_=0;1===l.get("frame_cropping_flag")&&(u=l.get("frame_cropping_rect_left_offset"),f=l.get("frame_cropping_rect_right_offset"),p=l.get("frame_cropping_rect_top_offset"),_=l.get("frame_cropping_rect_bottom_offset"));var c=i*s*(a*s);return{width:i*s-e*(u+f),height:a*s-t*(r-l.get("frame_mbs_only_flag"))*(p+_),decodeSize:c}},getSpsValue:function(e){return l.get(e)},getCodecInfo:function(){return l.get("profile_idc").toString(s)+(l.get("profile_compatibility")<15?"0"+l.get("profile_compatibility").toString(s):l.get("profile_compatibility").toString(s))+l.get("level_idc").toString(s)}},new 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.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(6);function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}e.exports=function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(1).default,i=r(7);e.exports=function(e){var t=i(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(1).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(1));if("undefined"==typeof o)var o={};o.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 n(e,t,r){return r&e|~r&t}function o(e,t,r){return e^t^r}function a(e,t,r){return t^(e|~r)}function u(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function s(e){for(var t=[],r=0;r<e.length;r++)if(e.charCodeAt(r)<=127)t.push(e.charCodeAt(r));else for(var n=encodeURIComponent(e.charAt(r)).substr(1).split("%"),i=0;i<n.length;i++)t.push(parseInt(n[i],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 p=null,_=null;function l(e,t){return 4294967295&e+t}return"string"==typeof e?p=s(e):e.constructor==Array?0===e.length?p=e:"string"==typeof e[0]?p=function(e){for(var t=[],r=0;r<e.length;r++)t=t.concat(s(e[r]));return t}(e):"number"==typeof e[0]?p=e:_=(0,i.default)(e[0]):"undefined"!=typeof ArrayBuffer?e instanceof ArrayBuffer?p=f(new Uint8Array(e)):e instanceof Uint8Array||e instanceof Int8Array?p=f(e):e instanceof Uint32Array||e instanceof Int32Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Float32Array||e instanceof Float64Array?p=f(new Uint8Array(e.buffer)):_=(0,i.default)(e):_=(0,i.default)(e),_&&alert("MD5 type mismatch, cannot process "+_),function(){function e(e,t,r,n){var i,o,a=y;y=v,v=g,g=l(g,(i=l(h,l(e,l(t,r))))<<(o=n)&4294967295|i>>>32-o),h=a}var i=p.length;p.push(128);var s=p.length%64;if(s>56){for(var f=0;f<64-s;f++)p.push(0);s=p.length%64}for(f=0;f<56-s;f++)p.push(0);p=p.concat(function(e){for(var t=[],r=0;r<8;r++)t.push(255&e),e>>>=8;return t}(8*i));var _=1732584193,c=4023233417,d=2562383102,m=271733878,h=0,g=0,v=0,y=0;for(f=0;f<p.length/64;f++){h=_;var b=64*f;e(r(g=c,v=d,y=m),3614090360,u(p,b),7),e(r(g,v,y),3905402710,u(p,b+4),12),e(r(g,v,y),606105819,u(p,b+8),17),e(r(g,v,y),3250441966,u(p,b+12),22),e(r(g,v,y),4118548399,u(p,b+16),7),e(r(g,v,y),1200080426,u(p,b+20),12),e(r(g,v,y),2821735955,u(p,b+24),17),e(r(g,v,y),4249261313,u(p,b+28),22),e(r(g,v,y),1770035416,u(p,b+32),7),e(r(g,v,y),2336552879,u(p,b+36),12),e(r(g,v,y),4294925233,u(p,b+40),17),e(r(g,v,y),2304563134,u(p,b+44),22),e(r(g,v,y),1804603682,u(p,b+48),7),e(r(g,v,y),4254626195,u(p,b+52),12),e(r(g,v,y),2792965006,u(p,b+56),17),e(r(g,v,y),1236535329,u(p,b+60),22),e(n(g,v,y),4129170786,u(p,b+4),5),e(n(g,v,y),3225465664,u(p,b+24),9),e(n(g,v,y),643717713,u(p,b+44),14),e(n(g,v,y),3921069994,u(p,b),20),e(n(g,v,y),3593408605,u(p,b+20),5),e(n(g,v,y),38016083,u(p,b+40),9),e(n(g,v,y),3634488961,u(p,b+60),14),e(n(g,v,y),3889429448,u(p,b+16),20),e(n(g,v,y),568446438,u(p,b+36),5),e(n(g,v,y),3275163606,u(p,b+56),9),e(n(g,v,y),4107603335,u(p,b+12),14),e(n(g,v,y),1163531501,u(p,b+32),20),e(n(g,v,y),2850285829,u(p,b+52),5),e(n(g,v,y),4243563512,u(p,b+8),9),e(n(g,v,y),1735328473,u(p,b+28),14),e(n(g,v,y),2368359562,u(p,b+48),20),e(o(g,v,y),4294588738,u(p,b+20),4),e(o(g,v,y),2272392833,u(p,b+32),11),e(o(g,v,y),1839030562,u(p,b+44),16),e(o(g,v,y),4259657740,u(p,b+56),23),e(o(g,v,y),2763975236,u(p,b+4),4),e(o(g,v,y),1272893353,u(p,b+16),11),e(o(g,v,y),4139469664,u(p,b+28),16),e(o(g,v,y),3200236656,u(p,b+40),23),e(o(g,v,y),681279174,u(p,b+52),4),e(o(g,v,y),3936430074,u(p,b),11),e(o(g,v,y),3572445317,u(p,b+12),16),e(o(g,v,y),76029189,u(p,b+24),23),e(o(g,v,y),3654602809,u(p,b+36),4),e(o(g,v,y),3873151461,u(p,b+48),11),e(o(g,v,y),530742520,u(p,b+60),16),e(o(g,v,y),3299628645,u(p,b+8),23),e(a(g,v,y),4096336452,u(p,b),6),e(a(g,v,y),1126891415,u(p,b+28),10),e(a(g,v,y),2878612391,u(p,b+56),15),e(a(g,v,y),4237533241,u(p,b+20),21),e(a(g,v,y),1700485571,u(p,b+48),6),e(a(g,v,y),2399980690,u(p,b+12),10),e(a(g,v,y),4293915773,u(p,b+40),15),e(a(g,v,y),2240044497,u(p,b+4),21),e(a(g,v,y),1873313359,u(p,b+32),6),e(a(g,v,y),4264355552,u(p,b+60),10),e(a(g,v,y),2734768916,u(p,b+24),15),e(a(g,v,y),1309151649,u(p,b+52),21),e(a(g,v,y),4149444226,u(p,b+16),6),e(a(g,v,y),3174756917,u(p,b+44),10),e(a(g,v,y),718787259,u(p,b+8),15),e(a(g,v,y),3951481745,u(p,b+36),21),_=l(_,h),c=l(c,g),d=l(d,v),m=l(m,y)}return function(e,r,n,i){for(var o="",a=0,u=0,s=3;s>=0;s--)a=255&(u=arguments[s]),a<<=8,a|=255&(u>>>=8),a<<=8,a|=255&(u>>>=8),a<<=8,o+=t(a|=u>>>=8);return o}(m,d,c,_).toUpperCase()}()};t.default=function(e){return o.MD5(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){this.map={}};n.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}};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(2);t.default=function(){var e,t,r,i,o,a,u,s,f,p,_,l,c,d,m,h=!1,g=0;function v(){v.prototype.setIsFirstFrame(!1)}return v.prototype={init:function(){n.debug.log("H264 Decoder init")},setOutputSize:function(e){if(o!==2*e){o=2*e;var t=Module._malloc(1),r=new Uint8Array(Module.HEAPU8.buffer,t,1);Module._DECODE_GetFreePort(r.byteOffset),g=r[0],r=null,Module._free(t),Module._DECODE_Init(g),a=Module._malloc(5242880),u=new Uint8Array(Module.HEAPU8.buffer,a,5242880);var n=2*e;s=Module._malloc(n),f=new Uint8Array(Module.HEAPU8.buffer,s,n),p=Module._malloc(4),_=new Uint8Array(Module.HEAPU8.buffer,p,4),l=Module._malloc(40),c=new Uint8Array(Module.HEAPU8.buffer,l,40)}},decode:function(n,o){var a=n[4],s=n[5];e=Date.now(),u.set(n),Module._DECODE_InputOneFrame(g,u.byteOffset,n.length,f.byteOffset,_.byteOffset,c.byteOffset),i=c[16]+(c[17]<<8),r=c[18]+(c[19]<<8);var p=i*r*3/2;return m=null,d=null,m=new ArrayBuffer(p),(d=new Uint8Array(m)).set(Module.HEAPU8.subarray(f.byteOffset,f.byteOffset+p)),t=Date.now()-e,v.prototype.isFirstFrame()?i>0&&r>0?(e=Date.now(),{data:d,option:{ylen:i,height:r,mediaType:a,subMediaType:s,beforeDecoding:e},width:i,height:r,codecType:"h264",decodingTime:t,frameType:o}):void 0:(v.prototype.setIsFirstFrame(!0),{firstFrame:!0})},setIsFirstFrame:function(e){h=e},isFirstFrame:function(){return h},free:function(){Module._DECODE_Stop(g),u=null,Module._free(a),f=null,Module._free(s),_=null,Module._free(p),c=null,Module._free(l),m=null,d=null}},new v}}]); |