Files
discord-decomp/sources/modules/media_engine/BandwidthEstimationExperiment.tsx
T
2026-07-27 16:20:00 +03:00

196 lines
7.9 KiB
TypeScript

/* Metro module 12409; source: modules/media_engine/BandwidthEstimationExperiment.tsx; dependencies: [4620, 2] */
function _fun94676(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#94676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12595:6, offset: 0x021234db, size: 431 bytes, params: 8, frame: 22
var object2;
const _arrayLikeToArray_94679 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = (require(4620) /* metro dependency 4620: experiments */).createExperiment({'kind': 'user',
'id': '2024-06_rtc_pacer__simulcast', 'label': 'RTC Pacer & Golive Simulcast', defaultConfig: {'enabled': true,
'fullname': 'bandwidth_estimation/trendline-window-duration-3750,robust-estimator/', 'simulcastEnabled': false},
treatments: [{'id': 1, 'label': 'Golive Simulcast without prober 720p@500k', config: {'enabled': true,
'fullname': 'bandwidth_estimation/trendline-window-duration-3750,robust-estimator/', 'simulcastEnabled': true}},
{'id': 2, 'label': 'Golive Simulcast 720p@500k', config: {'enabled': true,
'fullname': 'bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer,worker-pacer-probe',
'simulcastEnabled': true}}, {'id': 3, 'label': 'Golive with pacing', config: {'enabled': true,
'fullname': 'bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer',
'simulcastEnabled': false}}, {'id': 4, 'label': 'Golive with pacing and probing', config: {'enabled': true,
'fullname': 'bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer,worker-pacer-probe',
'simulcastEnabled': false}}, {'id': 5, 'label': 'Golive Simulcast 720p@750k', config: {'enabled': true,
'fullname': 'bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer-probe,worker-lq-floor-750k',
'simulcastEnabled': true}}, {'id': 6, 'label': 'Golive Simulcast 720p@1000k', config: {'enabled': true,
'fullname': 'bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer-probe,worker-lq-floor-1000k',
'simulcastEnabled': true}}]});
object2 = {getConfig: getConfig_94680, supportsBandwidthEstimationExperimentFullname: function(a0, a1) {
var value4;
var value5;
var value = this.getMediaEngineExperiments(a0);
if (value !== null) {
value = _createForOfIteratorHelperLoose_94677(value);
var value3 = value();
if (value3.done) {
return true;
}
var r1 = value3;
loopExit2: while (true) {
value4 = r1.value;
if (a1.includes(value4)) {
value5 = value();
if (value5.done) {
return true;
}
r1 = value5;
continue;
}
break loopExit2;
}
}
return false;
}, getMediaEngineExperiments: function(a0) {
var r0;
var value = a0.split('/');
var value2 = null;
if (value.length !== 3) {
r0 = value2;
} else if (value[0] !== 'bandwidth_estimation') {
r0 = value2;
} else {
value = value[1].split(',');
value = value.filter(_fun94683);
r0 = value;
}
return r0;
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_engine/BandwidthEstimationExperiment.tsx');
exports.default = object2;
}
function _createForOfIteratorHelperLoose_94677(a0, a1) { // fn#94677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12595:46, offset: 0x0212368a, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun94678;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_94679(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_94679(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_94679(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun94678;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function getConfig_94680(a0, a1) { // fn#94680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12595:2411, offset: 0x021237fe, size: 78 bytes, params: 3, frame: 15
const currentConfig = env0_0.getCurrentConfig({location: 'e1c55b_1'}, {autoTrackExposure: a0});
if (!this.supportsBandwidthEstimationExperimentFullname(currentConfig.fullname, a1)) {
currentConfig.enabled = false;
}
return currentConfig;
}
function getMediaEngineExperiments(a0) { // fn#94682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12595:2813, offset: 0x021238ad, size: 91 bytes, params: 2, frame: 13
var r0;
let value = a0.split('/');
const length = value.length;
const value2 = null;
if (length !== 3) {
r0 = value2;
} else if (value[0] !== 'bandwidth_estimation') {
r0 = value2;
} else {
value = value[1].split(',');
value = value.filter(function(a0) {
return a0.length !== 0;
});
r0 = value;
}
return r0;
}