decord/alpha/source/modules/conjure/preview/conjurePreviewCall.tsx

58 lines
1.8 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 11375
// Function ID: 11376
2026-10-05 08:00:40 +00:00
// Name: conjurePreviewCall
// Dependencies: [2]
// Exports: controlAnswerTimeoutMs, isResultEnvelope, previewCallTypes
2026-10-09 10:00:15 +00:00
// Module 11375 (conjurePreviewCall)
import size from "module_2" /* 2 */;
2026-10-03 08:58:59 +00:00
class PreviewFrameCallTimeout extends Error {
constructor(c0, timeoutMs) {
const tmp2 = new tmp("preview frame did not answer " + c0 + " within " + timeoutMs + "ms", " within ");
tmp2.name = "PreviewFrameCallTimeout";
return tmp2;
}
}
2026-10-05 08:00:40 +00:00
const result = size.fileFinishedImporting("modules/conjure/preview/conjurePreviewCall.tsx");
export const previewCallTypes = function previewCallTypes(arg0) {
const combined = "vibegrations-" + arg0;
2026-10-03 08:58:59 +00:00
const obj = { request: combined, result: "" + combined + "-result", ack: "" + combined + "-ack" };
return obj;
};
export const isResultEnvelope = function isResultEnvelope(parsed, ack, id) {
if (typeof parsed === "object") {
if (null != parsed) {
2026-10-03 08:58:59 +00:00
return parsed.type === ack && parsed.id === id;
}
}
return false;
};
2026-10-03 08:58:59 +00:00
export { PreviewFrameCallTimeout };
export const controlAnswerTimeoutMs = function controlAnswerTimeoutMs(timeoutMs) {
timeoutMs = timeoutMs.timeoutMs;
2026-10-06 11:16:32 +00:00
let num = 20000;
if (typeof timeoutMs === "number") {
2026-10-06 11:16:32 +00:00
const _isFinite = isFinite;
num = 20000;
if (isFinite(timeoutMs)) {
2026-10-06 11:16:32 +00:00
num = 20000;
if (timeoutMs > 0) {
2026-10-03 08:58:59 +00:00
const _Math = Math;
2026-10-06 11:16:32 +00:00
const _Math2 = Math;
num = Math.min(Math.floor(timeoutMs), 20000);
}
}
2026-10-06 11:16:32 +00:00
}
return num + 4000;
};
export const PREVIEW_FRAME_WAIT_MS = 6000;
export const CONTROL_RETRY_MS = 400;
export const CONTROL_END_TIMEOUT_MS = 2000;
export const CAPTURE_NOW_ACCEPT_TIMEOUT_MS = 8000;
2026-10-06 11:16:32 +00:00
export const NATIVE_CAPTURE_WAIT_MS = 3000;
export const CAPTURE_NOW_RETRY_MS = 400;
export const INSPECT_TIMEOUT_MS = 1500;
export const INSPECT_ANSWER_TIMEOUT_MS = 5500;