Files
webadderall eaf87be95b Recordly 2.0 local review stack 2/6
Dependency-ordered review preparation. Not pushed or remotely reviewed.
2026-11-06 05:24:21 +11:00

35 lines
1015 B
TypeScript

import { type NativeStaticLayoutExportSession, type NativeVideoExportSession } from "./types";
export const nativeVideoExportSessions = new Map<string, NativeVideoExportSession>();
export function cleanupNativeVideoExportSessions() {
for (const [sessionId, session] of nativeVideoExportSessions) {
session.terminating = true;
try {
if (!session.ffmpegProcess.stdin.destroyed) {
session.ffmpegProcess.stdin.destroy();
}
} catch {
/* stream may already be closed */
}
try {
session.ffmpegProcess.kill("SIGKILL");
} catch {
/* process may already be exited */
}
nativeVideoExportSessions.delete(sessionId);
}
for (const [sessionId, session] of nativeStaticLayoutExportSessions) {
session.terminating = true;
try {
session.currentProcess?.kill("SIGKILL");
} catch {
/* process may already be exited */
}
nativeStaticLayoutExportSessions.delete(sessionId);
}
}
export const nativeStaticLayoutExportSessions = new Map<string, NativeStaticLayoutExportSession>();