This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,13 +1,15 @@
/* Metro module 4683; source: modules/media_uploads/native/VideoUploadUtils.tsx; dependencies: [6, 7, 1312, 3, 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 * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as UnsyncedUserSettingsStoreModule from '../../user_settings/UnsyncedUserSettingsStore.tsx'; /* Metro dependency 1312 */
function _fun40537(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:6, offset: 0x01103edc, size: 542 bytes, params: 8, frame: 21
var object2;
const closure = calculateTargetDimensions;
const calculateTargetDimensions2 = calculateTargetDimensions;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_1 = importDefault(6) /* metro dependency 6 */;
const env0_2 = importDefault(7) /* metro dependency 7 */;
const env0_3 = (require(1312) /* metro dependency 1312: UnsyncedUserSettingsStore */).VideoCompressionQuality;
let value = importDefault(3) /* metro dependency 3: Logger */;
let value = Logger;
value = new value('VideoUploadUtils.tsx');
value = _fun40539();
const value3 = Object.create(value.prototype, {constructor: {value: value}});
@@ -26,18 +28,18 @@ function _fun40537(global, require, importDefault, importAll, module, exports, d
const value16 = new value('very_high', 1080, 7000000);
value.VERY_HIGH = value16 instanceof Object ? value16 : value15;
value.fromCompressionQuality = fromCompressionQuality;
object2 = {'bitrateFloor': 300000, 'createHDR': false, 'frameRate': 30, 'keyFrameIntervalSeconds': 2,
object = {'bitrateFloor': 300000, 'createHDR': false, 'frameRate': 30, 'keyFrameIntervalSeconds': 2,
'rotationDegrees': 0, 'skipVideoTranscode': false, 'targetBitrate': null, 'targetHeight': 480,
'targetWidth': 640, 'useHEVC': false, 'videoQuality': null, 'hevcIsSupported': false,
'useTranscodedVideoForMovSources': true, 'transmuxLivePhotos': true, 'progressUpdateGranularity': 10};
let MEDIUM = value.MEDIUM;
object2.targetBitrate = MEDIUM.targetBitrate;
object.targetBitrate = MEDIUM.targetBitrate;
MEDIUM = value.MEDIUM;
object2.videoQuality = MEDIUM;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_uploads/native/VideoUploadUtils.tsx');
object.videoQuality = MEDIUM;
(FileImportTrackerModule).fileFinishedImporting('modules/media_uploads/native/VideoUploadUtils.tsx');
exports.VideoQualityTarget = value;
exports.DEFAULT_VIDEO_ENCODING_CONFIG = object2;
exports.calculateTargetDimensions = closure;
exports.DEFAULT_VIDEO_ENCODING_CONFIG = object;
exports.calculateTargetDimensions = calculateTargetDimensions2;
exports.canSkipVideoTranscode = canSkipVideoTranscode;
exports.logSourceMetadata = logSourceMetadata;
exports.logEncoderSettings = logEncoderSettings;
@@ -61,6 +63,163 @@ function _fun40537(global, require, importDefault, importAll, module, exports, d
}
return r0;
};
function _fun40539() { // fn#40539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:197, offset: 0x011041b4, size: 55 bytes, params: 1, frame: 14
return CreateClass(VideoQualityTarget, [{key: 'toString', value: function() {
return this.value;
}}]);
function VideoQualityTarget(a0, a1, a2) { // fn#40540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:218, offset: 0x011041eb, size: 54 bytes, params: 4, frame: 13
env1_1(this, VideoQualityTarget);
this.value = a0;
this.targetResolution = a1;
this.targetBitrate = a2;
}
}
function fromCompressionQuality(a0) { // fn#40542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:598, offset: 0x01104221, size: 194 bytes, params: 2, frame: 13
const VERY_LOW = VideoCompressionQuality.VERY_LOW;
if (VERY_LOW === a0) {
return env0_0.VERY_LOW;
}
const LOW = VideoCompressionQuality.LOW;
if (LOW === a0) {
return env0_0.LOW;
}
const MEDIUM = VideoCompressionQuality.MEDIUM;
if (MEDIUM === a0) {
return env0_0.MEDIUM;
}
const HIGH = VideoCompressionQuality.HIGH;
if (HIGH === a0) {
return env0_0.HIGH;
}
const VERY_HIGH = VideoCompressionQuality.VERY_HIGH;
if (VERY_HIGH === a0) {
return env0_0.VERY_HIGH;
}
const Error = global.Error;
const value = 'Unknown compression quality: ' + a0;
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value2;
}
function canSkipVideoTranscode(a0, a1, a2, a3) { // fn#40543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:1616, offset: 0x011042e3, size: 198 bytes, params: 5, frame: 17
var r4;
var r0;
var value;
var Math;
var round;
var width;
var value2;
var value3;
var value4;
if (a2 == null) {
value = calculateTargetDimensions(a1, a0.targetResolution);
Math = global.Math;
round = Math.round;
width = a1.width;
value2 = Reflect.apply(round, Math, [width]);
Math = global.Math;
value3 = Math.round(a1.height);
width = value.width;
value4 = value2 <= width;
} else {
if (a3 == null) {
value = calculateTargetDimensions(a1, a0.targetResolution);
Math = global.Math;
round = Math.round;
width = a1.width;
value2 = Reflect.apply(round, Math, [width]);
Math = global.Math;
value3 = Math.round(a1.height);
width = value.width;
r4 = value2 <= width && value3 <= value.height;
value = a1.bitRate <= a0.targetBitrate;
r0 = r4 ? !value : !r4;
r0 = !r0 ? a1.format == null : r0;
r0 = !r0 ? a1.format.match(RegExp('(avc1|hvc1|video\\/(avc|hevc))', 'i')) === null : r0;
return !r0;
}
if (a2 > a3) {
return false;
}
value = calculateTargetDimensions(a1, a0.targetResolution);
Math = global.Math;
value2 = Math.round(a1.width);
Math = global.Math;
value3 = Math.round(a1.height);
value4 = value2 <= value.width;
}
r4 = value4 && value3 <= value.height;
r0 = r4 ? !(a1.bitRate <= a0.targetBitrate) : !r4;
r0 = !r0 ? a1.format == null : r0;
r0 = !r0 ? a1.format.match(RegExp('(avc1|hvc1|video\\/(avc|hevc))', 'i')) === null : r0;
return !r0;
}
function logSourceMetadata(a0) { // fn#40544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:1954, offset: 0x011043a9, size: 469 bytes, params: 2, frame: 20
const r7 = a0.format != null ? ({'hvc1': 'hvc1 (HEVC)', 'avc1': 'avc1 (H.264)'})[a0.format] ?? a0.format : 'unknown';
let binding = env0_4;
binding.info('Video Source Metadata:');
binding.info('- Codec: ' + r7);
binding.info('- Dimensions: ' + a0.width + 'x' + a0.height);
binding.info('- Bitrate: ' + a0.bitRate + ' bps');
binding.info('- Frame Rate: ' + a0.frameRate + ' fps');
binding.info('- HDR: ' + (a0.isHDRContent ? 'Yes' : 'No'));
binding = env0_4;
binding.info('- Rotation Degrees: ' + a0.rotationDegrees);
binding.info('- Profile: ' + a0.sourceProfile);
binding.info('- Level: ' + a0.sourceLevel);
binding.info('- Duration: ' + a0.durationMs + ' ms');
}
function logEncoderSettings(a0) { // fn#40545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:2510, offset: 0x0110457e, size: 666 bytes, params: 2, frame: 24
var createHDR;
var value6;
let binding = env0_4;
let info = binding.info;
Reflect.apply(info, binding, ['Encoder Video Quality Settings:']);
info = binding.info;
let videoQuality = a0.videoQuality;
const value2 = undefined;
Reflect.apply(info, binding,
['- Compression Quality: ' + (videoQuality == null ? value2 : videoQuality.toString())]);
binding = env0_4;
info = binding.info;
videoQuality = a0.videoQuality;
Reflect.apply(info, binding,
['- Compression Quality Target Resolution: ' + (videoQuality == null ? value2 : videoQuality.targetResolution) + 'p']);
binding = env0_4;
info = binding.info;
videoQuality = a0.videoQuality;
Reflect.apply(info, binding,
['- Compression Quality Max Bitrate: ' + (videoQuality == null ? value2 : videoQuality.targetBitrate) + ' bps']);
env0_4.info('Encoder Video Transcoding Settings:');
const skipVideoTranscode = a0.skipVideoTranscode;
info = env0_4.info;
if (skipVideoTranscode) {
Reflect.apply(info, binding, ['- Skip Video Transcode: Yes']);
} else {
Reflect.apply(info, binding, ['- Codec: ' + (a0.useHEVC ? 'hvc1 (HEVC)' : 'avc1 (H.264)')]);
binding = env0_4;
binding.info('- Dimensions: ' + a0.targetWidth + 'x' + a0.targetHeight);
binding.info('- Bitrate: ' + a0.targetBitrate + ' bps');
binding.info('- Frame Rate: ' + a0.frameRate + ' fps');
binding.info('- Key Frame Interval: ' + a0.keyFrameIntervalSeconds + ' seconds');
info = binding.info;
createHDR = a0.createHDR;
value6 = 'No';
Reflect.apply(info, binding, ['- Create HDR: ' + (createHDR ? 'Yes' : value6)]);
binding = env0_4;
binding.info('- Rotation Degrees: ' + a0.rotationDegrees);
binding.info('- HEVC Supported: ' + (a0.hevcIsSupported ? 'Yes' : value6));
binding = env0_4;
binding.info('- Progress Update Granularity: ' + a0.progressUpdateGranularity);
}
return value2;
}
}
function calculateTargetDimensions(a0, a1) { // fn#40538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:1177, offset: 0x011040fa, size: 186 bytes, params: 3, frame: 17
@@ -88,160 +247,4 @@ function calculateTargetDimensions(a0, a1) { // fn#40538, source: /ci/build/disc
return {width: r6 % 2 === 0 ? r6 : r6 + 1, height: r3 % 2 === 0 ? r3 : r3 + 1};
}
function _fun40539() { // fn#40539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:197, offset: 0x011041b4, size: 55 bytes, params: 1, frame: 14
return env0_2(VideoQualityTarget, [{key: 'toString', value: function() {
return this.value;
}}]);
}
function fromCompressionQuality(a0) { // fn#40542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:598, offset: 0x01104221, size: 194 bytes, params: 2, frame: 13
const VERY_LOW = VideoCompressionQuality.VERY_LOW;
if (VERY_LOW === a0) {
return env0_0.VERY_LOW;
}
const LOW = VideoCompressionQuality.LOW;
if (LOW === a0) {
return env0_0.LOW;
}
const MEDIUM = VideoCompressionQuality.MEDIUM;
if (MEDIUM === a0) {
return env0_0.MEDIUM;
}
const HIGH = VideoCompressionQuality.HIGH;
if (HIGH === a0) {
return env0_0.HIGH;
}
const VERY_HIGH = VideoCompressionQuality.VERY_HIGH;
if (VERY_HIGH === a0) {
return env0_0.VERY_HIGH;
}
const Error = global.Error;
const value = 'Unknown compression quality: ' + a0;
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value2;
}
function canSkipVideoTranscode(a0, a1, a2, a3) { // fn#40543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:1616, offset: 0x011042e3, size: 198 bytes, params: 5, frame: 17
var r4;
var r0;
var value;
var Math;
var round;
var width;
var value2;
var value3;
var value4;
if (a2 == null) {
value = calculateTargetDimensions(a1, a0.targetResolution);
Math = global.Math;
round = Math.round;
width = a1.width;
value2 = Reflect.apply(round, Math, [width]);
Math = global.Math;
value3 = Math.round(a1.height);
width = value.width;
value4 = value2 <= width;
} else {
if (a3 == null) {
value = calculateTargetDimensions(a1, a0.targetResolution);
Math = global.Math;
round = Math.round;
width = a1.width;
value2 = Reflect.apply(round, Math, [width]);
Math = global.Math;
value3 = Math.round(a1.height);
width = value.width;
r4 = value2 <= width && value3 <= value.height;
value = a1.bitRate <= a0.targetBitrate;
r0 = r4 ? !value : !r4;
r0 = !r0 ? a1.format == null : r0;
r0 = !r0 ? a1.format.match(RegExp('(avc1|hvc1|video\\/(avc|hevc))', 'i')) === null : r0;
return !r0;
}
if (a2 > a3) {
return false;
}
value = calculateTargetDimensions(a1, a0.targetResolution);
Math = global.Math;
value2 = Math.round(a1.width);
Math = global.Math;
value3 = Math.round(a1.height);
value4 = value2 <= value.width;
}
r4 = value4 && value3 <= value.height;
r0 = r4 ? !(a1.bitRate <= a0.targetBitrate) : !r4;
r0 = !r0 ? a1.format == null : r0;
r0 = !r0 ? a1.format.match(RegExp('(avc1|hvc1|video\\/(avc|hevc))', 'i')) === null : r0;
return !r0;
}
function logSourceMetadata(a0) { // fn#40544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:1954, offset: 0x011043a9, size: 469 bytes, params: 2, frame: 20
const r7 = a0.format != null ? ({'hvc1': 'hvc1 (HEVC)', 'avc1': 'avc1 (H.264)'})[a0.format] ?? a0.format : 'unknown';
let binding = env0_4;
binding.info('Video Source Metadata:');
binding.info('- Codec: ' + r7);
binding.info('- Dimensions: ' + a0.width + 'x' + a0.height);
binding.info('- Bitrate: ' + a0.bitRate + ' bps');
binding.info('- Frame Rate: ' + a0.frameRate + ' fps');
binding.info('- HDR: ' + (a0.isHDRContent ? 'Yes' : 'No'));
binding = env0_4;
binding.info('- Rotation Degrees: ' + a0.rotationDegrees);
binding.info('- Profile: ' + a0.sourceProfile);
binding.info('- Level: ' + a0.sourceLevel);
binding.info('- Duration: ' + a0.durationMs + ' ms');
}
function logEncoderSettings(a0) { // fn#40545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:2510, offset: 0x0110457e, size: 666 bytes, params: 2, frame: 24
var createHDR;
var value6;
let binding = env0_4;
let info = binding.info;
Reflect.apply(info, binding, ['Encoder Video Quality Settings:']);
info = binding.info;
let videoQuality = a0.videoQuality;
const value2 = undefined;
Reflect.apply(info, binding,
['- Compression Quality: ' + (videoQuality == null ? value2 : videoQuality.toString())]);
binding = env0_4;
info = binding.info;
videoQuality = a0.videoQuality;
Reflect.apply(info, binding,
['- Compression Quality Target Resolution: ' + (videoQuality == null ? value2 : videoQuality.targetResolution) + 'p']);
binding = env0_4;
info = binding.info;
videoQuality = a0.videoQuality;
Reflect.apply(info, binding,
['- Compression Quality Max Bitrate: ' + (videoQuality == null ? value2 : videoQuality.targetBitrate) + ' bps']);
env0_4.info('Encoder Video Transcoding Settings:');
const skipVideoTranscode = a0.skipVideoTranscode;
info = env0_4.info;
if (skipVideoTranscode) {
Reflect.apply(info, binding, ['- Skip Video Transcode: Yes']);
} else {
Reflect.apply(info, binding, ['- Codec: ' + (a0.useHEVC ? 'hvc1 (HEVC)' : 'avc1 (H.264)')]);
binding = env0_4;
binding.info('- Dimensions: ' + a0.targetWidth + 'x' + a0.targetHeight);
binding.info('- Bitrate: ' + a0.targetBitrate + ' bps');
binding.info('- Frame Rate: ' + a0.frameRate + ' fps');
binding.info('- Key Frame Interval: ' + a0.keyFrameIntervalSeconds + ' seconds');
info = binding.info;
createHDR = a0.createHDR;
value6 = 'No';
Reflect.apply(info, binding, ['- Create HDR: ' + (createHDR ? 'Yes' : value6)]);
binding = env0_4;
binding.info('- Rotation Degrees: ' + a0.rotationDegrees);
binding.info('- HEVC Supported: ' + (a0.hevcIsSupported ? 'Yes' : value6));
binding = env0_4;
binding.info('- Progress Update Granularity: ' + a0.progressUpdateGranularity);
}
return value2;
}
function VideoQualityTarget(a0, a1, a2) { // fn#40540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4861:218, offset: 0x011041eb, size: 54 bytes, params: 4, frame: 13
env1_1(this, VideoQualityTarget);
this.value = a0;
this.targetResolution = a1;
this.targetBitrate = a2;
}
global.__d(_fun40537, 4683, [6, 7, 1312, 3, 2]) /* metro module 4683, dependencies: [6, 7, 1312, 3, 2] */;