Files
2026-07-28 01:06:53 +03:00

195 lines
9.7 KiB
TypeScript

/* Metro module 12391; source: modules/go_live/GoLiveQualityManager.tsx; dependencies: [6, 7, 15, 17, 18, 3, 4041, 4479, 2] */
import Logger from '../debug/Logger.tsx'; /* Metro dependency 3 */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import TypedEventEmitter from '../../external/discord_common/js/shared/utils/TypedEventEmitter.tsx'; /* Metro dependency 4479 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as TimersModule from '../../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */
function _fun94411(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#94411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:6, offset: 0x02117121, size: 246 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = TypedEventEmitter;
value = _fun94415(value);
(FileImportTrackerModule).fileFinishedImporting('modules/go_live/GoLiveQualityManager.tsx');
exports.default = value;
exports.GoLiveQualityManagerEvent = {RequestedSSRCsUpdate: 'requested-ssrcs-update',
RequestedStreamsUpdate: 'requested-streams-update'};
function _isNativeReflectConstruct_94412() { // fn#94412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:148, offset: 0x02117217, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_94412_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun94415(a0) { // fn#94415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:475, offset: 0x02117279, size: 307 bytes, params: 2, frame: 16
const GoLiveQualityManager2 = GoLiveQualityManager;
Inherits(GoLiveQualityManager2, a0);
return CreateClass(GoLiveQualityManager2, [{key: 'setUserID', value: function(a0) {
this.userId = a0;
}}, {key: 'getUserID', value: function() {
return this.userId;
}}, {key: 'updateAudioAndVideoStreamInfo', value: function(a0, a1) {
this.audioSSRC = a0;
this.videoStream = a1.find(_fun94422);
this.update();
}}, {key: 'onIncomingVideoEnabled', value: function(a0) {
if (this.incomingVideoEnabled !== a0) {
this.logger.info('onIncomingVideoEnabled', a0);
this.incomingVideoEnabled = a0;
this.update();
}
}}, {key: 'update', value: function() {
if (this.userId != null && this.videoStream != null) {
if (this.incomingVideoEnabled) {
this.requestStream();
} else {
this.stopStream();
}
}
}}, {key: 'requestStream', value: function() {
if (this.videoStream != null) {
this.request({[this.videoStream.ssrc]: 100}, [this.videoStream.ssrc]);
}
}}, {key: 'stopStream', value: function() {
if (this.videoStream != null) {
this.request({[this.videoStream.ssrc]: 0}, []);
}
}}, {key: 'request', value: value_94427}, {key: 'setVideoSize', value: function(a0, a1, a2) {
if (this.streamId === a0) {
if (a1 != null) {
this.resolutionWidth = a1.width;
this.resolutionHeight = a1.height;
}
if (a2 != null) {
this.zoom = a2;
}
this.delayedUpdate();
}
}}, {key: 'setStreamId', value: function(a0) {
if (this.streamId !== a0) {
this.streamId = a0;
this.resolutionWidth = 0;
this.resolutionHeight = 0;
this.zoom = 1;
this.delayedUpdate();
}
}}]);
function GoLiveQualityManager() { // fn#94416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:487, offset: 0x021173ac, size: 302 bytes, params: 1, frame: 21
var environment;
const value = environment.__proto__;
env1_3(this, GoLiveQualityManager);
const value3 = env1_6(GoLiveQualityManager);
const value6 = env1_5(this, _isNativeReflectConstruct_94412() ? global.Reflect.construct(value3, [],
env1_6(this).constructor) : value3.apply(this, undefined));
value6.streamId = null;
value6.resolutionWidth = 0;
value6.resolutionHeight = 0;
value6.zoom = 1;
value6.audioSSRC = 0;
value6.incomingVideoEnabled = true;
value6.delayedUpdate = delayedUpdate_94417;
const defaultImport = Logger;
const value7 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
const defaultImport2 = new defaultImport('GoLiveQualityManager');
value6.logger = defaultImport2 instanceof Object ? defaultImport2 : value7;
value6.logger.enableNativeLogger(true);
const DelayedCall = (TimersModule).DelayedCall;
value6.delayedCall = new DelayedCall(500, _fun94418);
return value6;
function GoLiveQualityManagerDelayedUpdate() { // fn#94417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:844, owner: GoLiveQualityManager.delayedUpdate, offset: 0x02115cbe, size: 27 bytes, params: 1, frame: 9
env0_0.delayedCall.delay();
}
function _fun94418() { // fn#94418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:994, offset: 0x02115fc6, size: 21 bytes, params: 1, frame: 9
env0_0.update();
}
}
function value_94421(a0, a1) { // fn#94421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:1221, offset: 0x021174f4, size: 55 bytes, params: 3, frame: 12
this.audioSSRC = a0;
this.videoStream = a1.find(function(a0) {
return a0.active;
});
this.update();
}
function value_94427(a0, a1) { // fn#94427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:1887, offset: 0x0211762b, size: 107 bytes, params: 3, frame: 20
var environment;
var emit;
var value;
var binding;
const userId = this.userId;
if (userId !== undefined) {
var env0_1 = a0;
a1.forEach(_fun94428);
emit = this.emit;
value = environment.__proto__;
binding = env1_8;
Reflect.apply(emit, this, [binding.RequestedSSRCsUpdate, this.userId, this.audioSSRC, a1]);
this.emit(binding.RequestedStreamsUpdate, a0);
}
function _fun94428(a0) { // fn#94428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:1945, offset: 0x02117696, size: 125 bytes, params: 2, frame: 15
var binding;
var Math;
var floor;
var zoom;
var value;
let pixelCounts = env0_1.pixelCounts;
if (pixelCounts == null) {
env0_1.pixelCounts = {};
}
if (env0_1[a0] > 0) {
pixelCounts = env0_1.pixelCounts;
Math = global.Math;
floor = Math.floor;
binding = env0_0;
value = binding.resolutionWidth * binding.resolutionHeight;
zoom = binding.zoom;
value *= zoom;
zoom = binding.zoom;
pixelCounts[a0] = Reflect.apply(floor, Math, [value * zoom]);
}
}
}
}
}
function _fun94422(a0) { // fn#94422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12577:1266, offset: 0x0108d973, size: 11 bytes, params: 2, frame: 1
return a0.active;
}
global.__d(_fun94411, 12391, [6, 7, 15, 17, 18, 3, 4041, 4479,
2]) /* metro module 12391, dependencies: [6, 7, 15, 17, 18, 3, 4041, 4479, 2] */;