@hyperframes/engine 0.8.152 → 0.8.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export { SDR_RGB_TO_BT709_FILTER, SDR_RGB_TO_TAGGED_BT709_FILTER, } from "./util
|
|
|
35
35
|
export { DEFAULT_VP9_CPU_USED, MAX_VP9_CPU_USED, MIN_VP9_CPU_USED, normalizeVp9CpuUsed, } from "./services/vp9Options.js";
|
|
36
36
|
export { getCgroupMemoryLimitMb, getSystemTotalMb, isLowMemorySystem, LOW_MEMORY_TOTAL_MB_THRESHOLD, } from "./services/systemMemory.js";
|
|
37
37
|
export { chromeMajorCeiling } from "./services/chromeHostCeiling.js";
|
|
38
|
-
export { acquireBrowser, setHostHandlesSigint, releaseBrowser, drainBrowserPool, closeBrowserPool, resolveHeadlessShellPath, resolveBrowserGpuMode, buildChromeArgs, compositionRequiresWebGpu, assertWebGpuAdapterAvailable, usesSoftwareWebGpu, WebGpuUnavailableError, ENABLE_BROWSER_POOL, BrowserLeasePool, type BuildChromeArgsOptions, type BrowserLaunchFingerprint, type BrowserLease, type BrowserPoolState, type CaptureMode, type AcquiredBrowser, } from "./services/browserManager.js";
|
|
38
|
+
export { acquireBrowser, setHostHandlesSigint, releaseBrowser, drainBrowserPool, closeBrowserPool, resolveHeadlessShellPath, resolveBrowserGpuMode, buildChromeArgs, compositionRequiresWebGpu, assertWebGpuAdapterAvailable, usesSoftwareWebGpu, WebGpuUnavailableError, ENABLE_BROWSER_POOL, BrowserLeasePool, type GpuProbeLifecycle, type BuildChromeArgsOptions, type BrowserLaunchFingerprint, type BrowserLease, type BrowserPoolState, type CaptureMode, type AcquiredBrowser, } from "./services/browserManager.js";
|
|
39
39
|
export { augmentProtocolTimeoutError, isProtocolTimeoutError, } from "./services/protocolTimeoutErrorHint.js";
|
|
40
40
|
export { augmentPageNavigationTimeoutError, isPageNavigationTimeoutError, type NavigationTimeoutHintContext, } from "./services/pageNavigationTimeoutErrorHint.js";
|
|
41
41
|
export { createCaptureSession, initializeSession, closeCaptureSession, captureFrame, captureFrameToBuffer, captureFrameToBufferPipelined, captureFramesBatchPipelined, DrawElementVerificationError, isDrawElementVerificationError, getDrawElementVerificationDetails, type DrawElementVerificationDetails, recaptureDrawElementFrameForVerify, completeDeferredDrawElementInit, writeCapturedFrame, discardWarmupCapture, getCompositionDuration, getCapturePerfSummary, percentileOf, prepareCaptureSessionForReuse, deriveBeginFrameProbeTimeTicks, type CaptureSession, isTransientBrowserError, isMemoryExhaustionError, type BeforeCaptureHook, type DiscardWarmupInnerCapture, type StaticVerificationOutcome, VfxFailureError, } from "./services/frameCapture.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Manages Puppeteer browser lifecycle: Chrome executable resolution,
|
|
5
5
|
* launch args, pooled browser acquisition/release.
|
|
6
6
|
*/
|
|
7
|
-
import type { Browser, Page, PuppeteerNode } from "puppeteer-core";
|
|
7
|
+
import type { Browser, LaunchOptions, Page, PuppeteerNode } from "puppeteer-core";
|
|
8
8
|
import { type EngineConfig } from "../config.js";
|
|
9
9
|
import { type BrowserLaunchFingerprint, type BrowserLease, type CaptureMode } from "./browserLeasePool.js";
|
|
10
10
|
export { BrowserLeasePool } from "./browserLeasePool.js";
|
|
@@ -14,6 +14,16 @@ export declare function setHostHandlesSigint(owned: boolean): void;
|
|
|
14
14
|
export declare const sigintLaunchOptions: () => {
|
|
15
15
|
handleSIGINT: boolean;
|
|
16
16
|
};
|
|
17
|
+
export interface GpuProbeLifecycle {
|
|
18
|
+
launch(puppeteer: PuppeteerNode, options: LaunchOptions): Promise<Browser>;
|
|
19
|
+
close(browser: Browser): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
interface GpuProbeOptions {
|
|
22
|
+
chromePath?: string;
|
|
23
|
+
browserTimeout?: number;
|
|
24
|
+
platform?: NodeJS.Platform;
|
|
25
|
+
probeLifecycle?: GpuProbeLifecycle;
|
|
26
|
+
}
|
|
17
27
|
export type AcquiredBrowser = BrowserLease;
|
|
18
28
|
/**
|
|
19
29
|
* Resolve chrome-headless-shell binary for deterministic BeginFrame rendering.
|
|
@@ -69,11 +79,7 @@ export declare function _resetAutoBrowserGpuModeCacheForTests(): void;
|
|
|
69
79
|
* safe failure mode; misclassifying toward hardware would error on the real
|
|
70
80
|
* render.
|
|
71
81
|
*/
|
|
72
|
-
export declare function resolveBrowserGpuMode(mode: EngineConfig["browserGpuMode"], options?:
|
|
73
|
-
chromePath?: string;
|
|
74
|
-
browserTimeout?: number;
|
|
75
|
-
platform?: NodeJS.Platform;
|
|
76
|
-
}): Promise<"software" | "hardware">;
|
|
82
|
+
export declare function resolveBrowserGpuMode(mode: EngineConfig["browserGpuMode"], options?: GpuProbeOptions): Promise<"software" | "hardware">;
|
|
77
83
|
declare function createBrowserLaunchFingerprint(chromeArgs: string[], config?: Partial<Pick<EngineConfig, "browserTimeout" | "protocolTimeout" | "chromePath" | "forceScreenshot">>): BrowserLaunchFingerprint;
|
|
78
84
|
/** Test-only export for launch-argument/capture-mode agreement. */
|
|
79
85
|
export declare const _createBrowserLaunchFingerprintForTests: typeof createBrowserLaunchFingerprint;
|
|
@@ -51,7 +51,7 @@ const GPU_PROBE_TIMEOUT_MS = 15_000;
|
|
|
51
51
|
async function probeHardwareWebGlInfo(ppt, options) {
|
|
52
52
|
let probeBrowser;
|
|
53
53
|
try {
|
|
54
|
-
|
|
54
|
+
const launchOptions = {
|
|
55
55
|
...sigintLaunchOptions(),
|
|
56
56
|
headless: true,
|
|
57
57
|
args: options.args,
|
|
@@ -59,12 +59,19 @@ async function probeHardwareWebGlInfo(ppt, options) {
|
|
|
59
59
|
executablePath: options.executablePath,
|
|
60
60
|
timeout: options.browserTimeout,
|
|
61
61
|
waitForInitialPage: false,
|
|
62
|
-
}
|
|
62
|
+
};
|
|
63
|
+
probeBrowser = options.probeLifecycle
|
|
64
|
+
? await options.probeLifecycle.launch(ppt, launchOptions)
|
|
65
|
+
: await ppt.launch(launchOptions);
|
|
63
66
|
return await rejectAfter(readWebGlInfo(probeBrowser), GPU_PROBE_TIMEOUT_MS, `GPU probe page did not answer within ${GPU_PROBE_TIMEOUT_MS}ms`);
|
|
64
67
|
}
|
|
65
68
|
finally {
|
|
66
|
-
if (probeBrowser)
|
|
67
|
-
|
|
69
|
+
if (probeBrowser) {
|
|
70
|
+
if (options.probeLifecycle)
|
|
71
|
+
await options.probeLifecycle.close(probeBrowser);
|
|
72
|
+
else
|
|
73
|
+
await closeBrowserAfterFailedProbe(probeBrowser);
|
|
74
|
+
}
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
77
|
async function readWebGlInfo(browser) {
|
|
@@ -407,6 +414,7 @@ async function probeAutoBrowserGpuMode(options) {
|
|
|
407
414
|
args: getHardwareGpuProbeArgs(platform),
|
|
408
415
|
browserTimeout,
|
|
409
416
|
executablePath,
|
|
417
|
+
probeLifecycle: options.probeLifecycle,
|
|
410
418
|
});
|
|
411
419
|
const resolved = resolveWebGlProbeMode(info);
|
|
412
420
|
logResolvedBrowserGpuMode(resolved, describeWebGlProbe(info));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/engine",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.154",
|
|
4
4
|
"description": "Seekable web page to video rendering engine (Puppeteer + FFmpeg)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"linkedom": "^0.18.12",
|
|
47
47
|
"puppeteer": "^25.8.0",
|
|
48
48
|
"puppeteer-core": "^25.8.0",
|
|
49
|
-
"@hyperframes/core": "^0.8.
|
|
50
|
-
"@hyperframes/parsers": "^0.8.
|
|
49
|
+
"@hyperframes/core": "^0.8.154",
|
|
50
|
+
"@hyperframes/parsers": "^0.8.154"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^25.0.10",
|