decord/alpha/source/modules/clips/clipPOVOverlap.tsx

62 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 14227
// Function ID: 14228
// Name: clipPOVOverlap
2026-10-09 10:00:15 +00:00
// Dependencies: [7744, 1085, 1403, 14228, 2]
2026-09-01 10:26:29 +00:00
// Exports: getClipAttachmentPOVWindow, getClipPOVOverlapMilliseconds, getClipPOVWindow
2026-10-09 10:00:15 +00:00
// Module 14227 (clipPOVOverlap)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-09 10:00:15 +00:00
import FlagUtils from "FlagUtils" /* 1403 */;
import ClipsConstants from "ClipsConstants" /* 7744 */;
import getPOVExportTargetDefault from "getPOVExportTarget" /* 14228 */;
import size from "module_2" /* 2 */;
2026-09-01 10:26:29 +00:00
const ClipType = ClipsConstants.ClipType;
const MessageAttachmentFlags = Constants.MessageAttachmentFlags;
const result = size.fileFinishedImporting("modules/clips/clipPOVOverlap.tsx");
2026-09-01 10:26:29 +00:00
export const getClipPOVWindow = function getClipPOVWindow(type) {
if (type.type === ClipType.CLIP) {
if (null != type.applicationId) {
if (null != type.syncTimestamp) {
2026-10-03 08:58:59 +00:00
return { applicationId: type.applicationId, startTimestamp: type.syncTimestamp - type.length, endTimestamp: type.syncTimestamp };
2026-09-01 10:26:29 +00:00
}
}
}
};
export const getClipAttachmentPOVWindow = function getClipAttachmentPOVWindow(nextResult) {
let num = nextResult.flags;
2026-10-03 08:58:59 +00:00
const hasFlag = FlagUtils.hasFlag;
FlagUtils;
2026-09-01 10:26:29 +00:00
if (num == null) {
num = 0;
}
const application = nextResult.application;
let id;
2026-10-03 08:58:59 +00:00
const hasFlagResult = hasFlag(num, MessageAttachmentFlags.IS_CLIP);
2026-09-01 10:26:29 +00:00
if (application != null) {
id = application.id;
}
2026-10-03 08:58:59 +00:00
const tmp5 = getPOVExportTargetDefault(nextResult);
2026-09-01 10:26:29 +00:00
if (null != id) {
2026-10-03 08:58:59 +00:00
if (null != tmp5) {
2026-09-01 10:26:29 +00:00
if (hasFlagResult) {
2026-10-03 08:58:59 +00:00
return { applicationId: id, startTimestamp: tmp5.syncTimestamp - 1000 * tmp5.duration, endTimestamp: tmp5.syncTimestamp };
2026-09-01 10:26:29 +00:00
}
}
}
};
export const getClipPOVOverlapMilliseconds = function getClipPOVOverlapMilliseconds(applicationId, nextResult1) {
if (applicationId.applicationId === nextResult1.applicationId) {
2026-09-01 10:26:29 +00:00
const _Math = Math;
const _Math2 = Math;
const bound = Math.min(applicationId.endTimestamp, nextResult1.endTimestamp);
const diff = bound - Math.max(applicationId.startTimestamp, nextResult1.startTimestamp);
2026-09-01 10:26:29 +00:00
let tmp4;
if (diff > 5000) {
tmp4 = diff;
}
return tmp4;
}
};