Skip to content

Commit e842960

Browse files
committed
style(engine): format the frame gate
1 parent de46167 commit e842960

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

‎packages/engine/src/services/frameCapture.ts‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,7 +2525,8 @@ function recordCaptureWarnings(session: CaptureSession, warnings: readonly Captu
25252525
function recordReadiness(session: CaptureSession, warnings: readonly CaptureWarning[]): void {
25262526
recordCaptureWarnings(session, warnings);
25272527
for (const warning of warnings) {
2528-
if (warning.code !== "media_readiness_timeout" || warning.details?.mediaType !== "image") continue;
2528+
if (warning.code !== "media_readiness_timeout" || warning.details?.mediaType !== "image")
2529+
continue;
25292530
session.lateImages ??= new Set();
25302531
for (const source of warning.details.sources ?? []) session.lateImages.add(source);
25312532
}
@@ -2560,7 +2561,9 @@ export async function waitForShownLateImages(
25602561
for (;;) {
25612562
const { arrived, waiting, broken } = await session.page.evaluate(async (urls: string[]) => {
25622563
const listed = new Set(urls);
2563-
const found = Array.from(document.querySelectorAll("img")).filter((img) => listed.has(img.src));
2564+
const found = Array.from(document.querySelectorAll("img")).filter((img) =>
2565+
listed.has(img.src),
2566+
);
25642567
const loaded = found.filter((img) => img.complete && img.naturalWidth > 0);
25652568
await Promise.allSettled(loaded.map((img) => img.decode()));
25662569
const box = (img: HTMLImageElement) => img.getBoundingClientRect();
@@ -3179,7 +3182,10 @@ export async function initializeSession(session: CaptureSession): Promise<void>
31793182
`Continuing render. Affected videos will appear as blank/black frames.`,
31803183
);
31813184
}
3182-
recordReadiness(session, await collectMediaReadinessWarnings(page, skipVideoIds, pageReadyTimeout));
3185+
recordReadiness(
3186+
session,
3187+
await collectMediaReadinessWarnings(page, skipVideoIds, pageReadyTimeout),
3188+
);
31833189
await recordLiveMapWarning(session, page);
31843190

31853191
await recordSessionInitTelemetry(session, initStart);
@@ -3318,7 +3324,10 @@ export async function initializeSession(session: CaptureSession): Promise<void>
33183324
`Continuing render. Affected videos will appear as blank/black frames.`,
33193325
);
33203326
}
3321-
recordReadiness(session, await collectMediaReadinessWarnings(page, bfSkipVideoIds, pageReadyTimeout));
3327+
recordReadiness(
3328+
session,
3329+
await collectMediaReadinessWarnings(page, bfSkipVideoIds, pageReadyTimeout),
3330+
);
33223331
await recordLiveMapWarning(session, page);
33233332

33243333
await recordSessionInitTelemetry(session, initStart);
@@ -5353,7 +5362,11 @@ export async function captureFramesBatchPipelined(
53535362
if (session.lateImages?.size) {
53545363
const oneByOne: Array<{ frameIndex: number; encodeResult: Promise<Buffer> }> = [];
53555364
for (const [i, frameIndex] of frameIndices.entries()) {
5356-
const { encodeResult } = await captureFrameToBufferPipelined(session, frameIndex, times[i] ?? 0);
5365+
const { encodeResult } = await captureFrameToBufferPipelined(
5366+
session,
5367+
frameIndex,
5368+
times[i] ?? 0,
5369+
);
53575370
oneByOne.push({ frameIndex, encodeResult });
53585371
}
53595372
return oneByOne;

0 commit comments

Comments
 (0)