/* Metro module 4404; source: modules/go_live/VideoStreamStats.tsx; dependencies: [6, 7, 4399, 661, 4041, 4303, 2] */ function _fun37427(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#37427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:6, offset: 0x010a4d15, size: 179 bytes, params: 8, frame: 19 const env0_0 = require; const round = function(a0) { var r0; var value = a1; r0 = value !== undefined ? value : 0; r0 = a0 != null ? global.Math.round(a0) : r0; return r0; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(6) /* metro dependency 6 */; const env0_3 = importDefault(7) /* metro dependency 7 */; const applicationStreamingSettingsStore = importDefault(4399) /* metro dependency 4399: ApplicationStreamingSettingsStore */; const env0_5 = (require(661) /* metro dependency 661: Constants */).StreamLayouts; let value = _fun37429(); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/go_live/VideoStreamStats.tsx'); exports.default = value; } function _fun37429() { // fn#37429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:209, offset: 0x010a4df0, size: 172 bytes, params: 1, frame: 15 return env0_3(VideoStreamStats, [{key: 'start', value: value_37433}, {key: 'stop', value: value_37434}, {key: 'autoQualityChange', value: function() { this._automaticQualityChanges += 1; }}, {key: 'layoutChange', value: value_37436}, {key: 'getLayout', value: function() { return this._lastLayout; }}, {key: 'getStats', value: value_37438}]); } function VideoStreamStats(a0, a1) { // fn#37430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:230, offset: 0x010a4e9c, size: 173 bytes, params: 3, frame: 15 var environment; const value = environment.__proto__; env1_2(this, VideoStreamStats); this._targetResolution = 0; this._targetFPS = 0; this._streamSettingsChanged = false; this._lastLayoutChanged = 0; this._layoutChanges = 0; this._automaticQualityChanges = 0; this._incrementLayout = _incrementLayout; this._sampleStats = _sampleStats; this._isSender = a1; const Interval = (require(4041) /* metro dependency 4041: Timers */).Interval; this._statInterval = new Interval(); this._lastLayout = a0; this._layoutBuckets = {}; } function value_37433() { // fn#37433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:818, offset: 0x010a4fd9, size: 112 bytes, params: 1, frame: 15 let value = environment.__proto__; const {resolution, fps} = ApplicationStreamingSettingsStore.getState(); this._targetResolution = resolution; this._targetFPS = fps; const _statInterval = this._statInterval; _statInterval.start(1000, this._sampleStats); value = require(4303) /* metro dependency 4303: TimeUtils */; this._lastLayoutChanged = value.now(); } function value_37434() { // fn#37434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:1020, offset: 0x010a5049, size: 105 bytes, params: 1, frame: 15 this._statInterval.stop(); let value = environment.__proto__; value = require(4303) /* metro dependency 4303: TimeUtils */; this._streamEnd = value.now(); this._incrementLayout(this._lastLayout, (this._streamEnd - this._lastLayoutChanged) / 1000); } function value_37436(a0) { // fn#37436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:1278, offset: 0x010a50cc, size: 131 bytes, params: 2, frame: 16 var value; var _layoutChanges; if (a0 !== this._lastLayout) { if (this._streamEnd == null) { value = environment.__proto__; value = require(4303) /* metro dependency 4303: TimeUtils */; value = value.now(); this._incrementLayout(this._lastLayout, (value - this._lastLayoutChanged) / 1000); _layoutChanges = this._layoutChanges; this._layoutChanges = typeof _layoutChanges === 'bigint' ? _layoutChanges + 1n : +_layoutChanges + 1; this._lastLayout = a0; this._lastLayoutChanged = value; } } } function value_37438() { // fn#37438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:1582, offset: 0x010a515a, size: 324 bytes, params: 1, frame: 16 var r0; var object3; const object4 = {}; object4.num_layout_changes = this._layoutChanges; const roundBinding = round; let _layoutBuckets = this._layoutBuckets; const FULL_SCREEN = StreamLayouts.FULL_SCREEN; object4.duration_layout_fullscreen = roundBinding(_layoutBuckets[FULL_SCREEN]); _layoutBuckets = this._layoutBuckets; const THEATRE = StreamLayouts.THEATRE; object4.duration_layout_theatre = roundBinding(_layoutBuckets[THEATRE]); _layoutBuckets = this._layoutBuckets; const PIP = StreamLayouts.PIP; object4.duration_layout_pip = roundBinding(_layoutBuckets[PIP]); _layoutBuckets = this._layoutBuckets; const POPOUT = StreamLayouts.POPOUT; object4.duration_layout_popout = roundBinding(_layoutBuckets[POPOUT]); _layoutBuckets = this._layoutBuckets; const PORTRAIT = StreamLayouts.PORTRAIT; object4.duration_layout_portrait = roundBinding(_layoutBuckets[PORTRAIT]); _layoutBuckets = this._layoutBuckets; const LANDSCAPE = StreamLayouts.LANDSCAPE; object4.duration_layout_landscape = roundBinding(_layoutBuckets[LANDSCAPE]); const _layoutBuckets2 = this._layoutBuckets; const MINIMIZED = StreamLayouts.MINIMIZED; object4.duration_layout_minimized = roundBinding(_layoutBuckets2[MINIMIZED]); if (this._isSender) { object3 = {}; copyDataProperties(object3, object4, _layoutBuckets); object3['target_fps'] = this._targetFPS; object3['target_resolution_height'] = this._targetResolution; object3['stream_settings_changed'] = this._streamSettingsChanged; object3['num_auto_quality_changes'] = this._automaticQualityChanges; r0 = object3; } else { r0 = object4; } return r0; } function _incrementLayout(a0, a1) { // fn#37431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:462, owner: VideoStreamStats._incrementLayout, offset: 0x010a4f49, size: 71 bytes, params: 3, frame: 4 if (env0_0._layoutBuckets[a0] == null) { env0_0._layoutBuckets[a0] = 0; } env0_0._layoutBuckets[a0] += a1; } function _sampleStats() { // fn#37432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4576:572, owner: VideoStreamStats._sampleStats, offset: 0x010a4f90, size: 73 bytes, params: 1, frame: 12 let value = environment.__proto__.__proto__; value = ApplicationStreamingSettingsStore.getState(); const resolution = value.resolution; const fps = value.fps; const binding = env0_0; binding._streamSettingsChanged = resolution !== binding._targetResolution || fps !== env0_0._targetFPS; }