pup-recorder 0.3.10 → 0.4.2
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/build.ts +9 -9
- package/dist/_tsup-dts-rollup.d.ts +231 -73
- package/dist/app.cjs +11 -430
- package/dist/chunk-YJ7QEMFY.js +4 -0
- package/dist/cli.js +2 -2
- package/dist/iframe_preload.cjs +3 -0
- package/dist/index.d.ts +12 -30
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-7LUJTKTE.js +0 -2
package/build.ts
CHANGED
|
@@ -25,7 +25,10 @@ const common: Options = {
|
|
|
25
25
|
|
|
26
26
|
await build({
|
|
27
27
|
...common,
|
|
28
|
-
entry: [
|
|
28
|
+
entry: [
|
|
29
|
+
"src/index.ts", //
|
|
30
|
+
"src/cli.ts",
|
|
31
|
+
],
|
|
29
32
|
format: "esm",
|
|
30
33
|
outDir: "dist",
|
|
31
34
|
experimentalDts: true,
|
|
@@ -33,14 +36,11 @@ await build({
|
|
|
33
36
|
|
|
34
37
|
await build({
|
|
35
38
|
...common,
|
|
36
|
-
entry: [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
await build({
|
|
42
|
-
...common,
|
|
43
|
-
entry: ["src/audio_preload.ts"],
|
|
39
|
+
entry: [
|
|
40
|
+
"src/app.ts", //
|
|
41
|
+
"src/audio_preload.ts",
|
|
42
|
+
"src/iframe_preload.ts",
|
|
43
|
+
],
|
|
44
44
|
format: "cjs",
|
|
45
45
|
outDir: "dist",
|
|
46
46
|
});
|
|
@@ -27,12 +27,24 @@ import z from 'zod';
|
|
|
27
27
|
/** Insert emulation prevention bytes (00 00 03) for Annex B compliance. */
|
|
28
28
|
export declare function addEmulationPrevention(nal: Buffer): Buffer;
|
|
29
29
|
|
|
30
|
+
export declare function advance(hook: VideoHook, timestampMs: number): Promise<unknown>;
|
|
31
|
+
|
|
30
32
|
export declare function advanceVideos(frame: WebFrameMain | undefined, timestampMs: number): Promise<void>;
|
|
31
33
|
|
|
32
34
|
export declare function advanceVirtualTime(cdp: Debugger, budget: number): Promise<void>;
|
|
33
35
|
|
|
36
|
+
export declare const AHEAD = 10;
|
|
37
|
+
|
|
34
38
|
export declare const ANNEX_B_START_CODE: Buffer<ArrayBuffer>;
|
|
35
39
|
|
|
40
|
+
export declare interface AttachArgs {
|
|
41
|
+
video: HTMLVideoElement;
|
|
42
|
+
state: VideoState;
|
|
43
|
+
src: string;
|
|
44
|
+
birthMs: number;
|
|
45
|
+
native: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
36
48
|
export declare function attachAudioListeners({ wc, encoder, getVideoTimeMs, onError }: AudioListenerOptions): AudioDisposal;
|
|
37
49
|
|
|
38
50
|
export declare const AUDIO_CHUNK_CHANNEL = "audio-chunk";
|
|
@@ -81,6 +93,16 @@ export declare interface AudioListenerOptions {
|
|
|
81
93
|
onError: (error: Error) => void;
|
|
82
94
|
}
|
|
83
95
|
|
|
96
|
+
declare function barLogger(bar: ProgressBar): LoggerLike;
|
|
97
|
+
export { barLogger }
|
|
98
|
+
export { barLogger as barLogger_alias_1 }
|
|
99
|
+
|
|
100
|
+
declare interface BarOptions {
|
|
101
|
+
total: number;
|
|
102
|
+
out: NodeJS.WriteStream;
|
|
103
|
+
showCount?: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
84
106
|
export declare class BitReader {
|
|
85
107
|
private _bits;
|
|
86
108
|
pos: number;
|
|
@@ -148,7 +170,7 @@ declare class CodecState_2 implements Disposable {
|
|
|
148
170
|
}
|
|
149
171
|
export { CodecState_2 as CodecState }
|
|
150
172
|
|
|
151
|
-
declare class ConcurrencyLimiter {
|
|
173
|
+
export declare class ConcurrencyLimiter {
|
|
152
174
|
readonly maxConcurrency: number;
|
|
153
175
|
private _active;
|
|
154
176
|
private _queue;
|
|
@@ -163,12 +185,8 @@ declare class ConcurrencyLimiter {
|
|
|
163
185
|
private flush;
|
|
164
186
|
private next;
|
|
165
187
|
}
|
|
166
|
-
export { ConcurrencyLimiter }
|
|
167
|
-
export { ConcurrencyLimiter as ConcurrencyLimiter_alias_1 }
|
|
168
188
|
|
|
169
|
-
declare type ConsoleCallback = (level: string, message: string) => void;
|
|
170
|
-
export { ConsoleCallback }
|
|
171
|
-
export { ConsoleCallback as ConsoleCallback_alias_1 }
|
|
189
|
+
export declare type ConsoleCallback = (level: string, message: string) => void;
|
|
172
190
|
|
|
173
191
|
export declare interface ConsoleMsg {
|
|
174
192
|
type: IpcMsgType.CONSOLE;
|
|
@@ -185,18 +203,27 @@ export declare function debounce<T extends (...args: unknown[]) => void>(fn: T,
|
|
|
185
203
|
export declare class DecodeSession {
|
|
186
204
|
readonly meta: VideoMeta;
|
|
187
205
|
private readonly src;
|
|
188
|
-
private
|
|
189
|
-
private proc;
|
|
206
|
+
private buf;
|
|
190
207
|
private ready;
|
|
208
|
+
private want;
|
|
191
209
|
private done;
|
|
210
|
+
private closed;
|
|
211
|
+
private gen;
|
|
212
|
+
private ctrl;
|
|
192
213
|
private waiters;
|
|
193
|
-
private
|
|
194
|
-
|
|
214
|
+
private resume;
|
|
215
|
+
private restart;
|
|
216
|
+
constructor(meta: VideoMeta, src: string);
|
|
195
217
|
getFrame(idx: number): Promise<Buffer>;
|
|
196
218
|
close(): void;
|
|
197
219
|
private wait;
|
|
198
|
-
private
|
|
199
|
-
private
|
|
220
|
+
private wake;
|
|
221
|
+
private requestRestart;
|
|
222
|
+
private pump;
|
|
223
|
+
private decodePass;
|
|
224
|
+
private pause;
|
|
225
|
+
private untilRestart;
|
|
226
|
+
private evict;
|
|
200
227
|
private drainWaiters;
|
|
201
228
|
}
|
|
202
229
|
|
|
@@ -214,17 +241,13 @@ declare const DEFAULT_HEIGHT = 1080;
|
|
|
214
241
|
export { DEFAULT_HEIGHT }
|
|
215
242
|
export { DEFAULT_HEIGHT as DEFAULT_HEIGHT_alias_1 }
|
|
216
243
|
|
|
217
|
-
declare const DEFAULT_OUT_FILE = "out/html.mp4,out/html.webm";
|
|
218
|
-
export { DEFAULT_OUT_FILE }
|
|
219
|
-
export { DEFAULT_OUT_FILE as DEFAULT_OUT_FILE_alias_1 }
|
|
244
|
+
export declare const DEFAULT_OUT_FILE = "out/html.mp4,out/html.webm";
|
|
220
245
|
|
|
221
246
|
declare const DEFAULT_WIDTH = 1920;
|
|
222
247
|
export { DEFAULT_WIDTH }
|
|
223
248
|
export { DEFAULT_WIDTH as DEFAULT_WIDTH_alias_1 }
|
|
224
249
|
|
|
225
|
-
declare const defaultRenderOptions: RenderOptions;
|
|
226
|
-
export { defaultRenderOptions }
|
|
227
|
-
export { defaultRenderOptions as defaultRenderOptions_alias_1 }
|
|
250
|
+
export declare const defaultRenderOptions: RenderOptions;
|
|
228
251
|
|
|
229
252
|
export declare function disposeWindow(win: BrowserWindow): Promise<void>;
|
|
230
253
|
|
|
@@ -260,7 +283,7 @@ export declare function electronOpts(disableGpu: boolean): Promise<string[]>;
|
|
|
260
283
|
|
|
261
284
|
export declare function encodeNalHeader(type: number, layerId: number, temporalId: number): [number, number];
|
|
262
285
|
|
|
263
|
-
declare class EncoderPipeline {
|
|
286
|
+
export declare class EncoderPipeline {
|
|
264
287
|
private _s;
|
|
265
288
|
private _disposed;
|
|
266
289
|
private constructor();
|
|
@@ -274,10 +297,8 @@ declare class EncoderPipeline {
|
|
|
274
297
|
private free;
|
|
275
298
|
private bgraFrame;
|
|
276
299
|
}
|
|
277
|
-
export { EncoderPipeline }
|
|
278
|
-
export { EncoderPipeline as EncoderPipeline_alias_1 }
|
|
279
300
|
|
|
280
|
-
declare interface EncoderPipelineOptions {
|
|
301
|
+
export declare interface EncoderPipelineOptions {
|
|
281
302
|
width: number;
|
|
282
303
|
height: number;
|
|
283
304
|
fps: number;
|
|
@@ -285,12 +306,8 @@ declare interface EncoderPipelineOptions {
|
|
|
285
306
|
withAudio?: boolean;
|
|
286
307
|
disableHwCodec?: boolean;
|
|
287
308
|
}
|
|
288
|
-
export { EncoderPipelineOptions }
|
|
289
|
-
export { EncoderPipelineOptions as EncoderPipelineOptions_alias_1 }
|
|
290
309
|
|
|
291
|
-
declare type EnvParser<T> = (value: unknown) => T;
|
|
292
|
-
export { EnvParser }
|
|
293
|
-
export { EnvParser as EnvParser_alias_1 }
|
|
310
|
+
export declare type EnvParser<T> = (value: unknown) => T;
|
|
294
311
|
|
|
295
312
|
export declare interface ErrorMsg {
|
|
296
313
|
type: IpcMsgType.ERROR;
|
|
@@ -299,13 +316,15 @@ export declare interface ErrorMsg {
|
|
|
299
316
|
|
|
300
317
|
export declare function evalIn(cdp: Debugger, expression: string): Promise<unknown>;
|
|
301
318
|
|
|
302
|
-
declare function exec(cmd: string, options?: SpawnOptions): ProcessHandle;
|
|
303
|
-
export { exec }
|
|
304
|
-
export { exec as exec_alias_1 }
|
|
319
|
+
export declare function exec(cmd: string, options?: SpawnOptions): ProcessHandle;
|
|
305
320
|
|
|
306
321
|
export declare function extractAlphaToYuv420pBuffer(bgraFrame: Frame, buf: Buffer): void;
|
|
307
322
|
|
|
308
|
-
declare
|
|
323
|
+
export declare function fire(el: EventTarget, type: string): void;
|
|
324
|
+
|
|
325
|
+
export declare function fitRect(srcW: number, srcH: number, dstW: number, dstH: number, fit: string): Vec4;
|
|
326
|
+
|
|
327
|
+
export declare class FormatMuxer {
|
|
309
328
|
private readonly _ctx;
|
|
310
329
|
private _opened;
|
|
311
330
|
constructor(outPath: string, formatName?: string);
|
|
@@ -314,13 +333,22 @@ declare class FormatMuxer {
|
|
|
314
333
|
writePacket(pkt: Packet): Promise<void>;
|
|
315
334
|
[Symbol.asyncDispose](): Promise<void>;
|
|
316
335
|
}
|
|
317
|
-
export { FormatMuxer }
|
|
318
|
-
export { FormatMuxer as FormatMuxer_alias_1 }
|
|
319
336
|
|
|
320
337
|
export declare const FRAME_SYNC_MARKER_HEIGHT = 1;
|
|
321
338
|
|
|
322
339
|
export declare const FRAME_SYNC_MARKER_WIDTH = 32;
|
|
323
340
|
|
|
341
|
+
export declare class FrameCache {
|
|
342
|
+
private caches;
|
|
343
|
+
cacheOf(id: string): VideoCache;
|
|
344
|
+
fetch(state: VideoState, idx: number): Promise<ImageBitmap | null>;
|
|
345
|
+
prefetch(state: VideoState, fromIdx: number, count: number): void;
|
|
346
|
+
evict(c: VideoCache): void;
|
|
347
|
+
release(id: string, state: VideoState): void;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export declare type FrameCb = (now: number, meta: VideoFrameMeta) => void;
|
|
351
|
+
|
|
324
352
|
/**
|
|
325
353
|
* Frame drop quality score (0 = perfect, 1 = worst).
|
|
326
354
|
*
|
|
@@ -355,14 +383,24 @@ export declare class FrameDropStats {
|
|
|
355
383
|
|
|
356
384
|
export declare class FrameServer {
|
|
357
385
|
private sessions;
|
|
386
|
+
private srcs;
|
|
387
|
+
private inFlightOpens;
|
|
388
|
+
private closed;
|
|
358
389
|
open(opts: OpenOptions): Promise<VideoMeta>;
|
|
390
|
+
private openInner;
|
|
359
391
|
getFrame(id: string, idx: number): Promise<Buffer>;
|
|
360
392
|
close(id: string): void;
|
|
361
|
-
closeAll(): void
|
|
393
|
+
closeAll(): Promise<void>;
|
|
362
394
|
}
|
|
363
395
|
|
|
364
396
|
export declare const frameServer: FrameServer;
|
|
365
397
|
|
|
398
|
+
export declare const HAVE_ENOUGH_DATA = 4;
|
|
399
|
+
|
|
400
|
+
export declare const HAVE_METADATA = 1;
|
|
401
|
+
|
|
402
|
+
export declare const HAVE_NOTHING = 0;
|
|
403
|
+
|
|
366
404
|
export declare type HwEncoder = VideoToolboxEncoder | NvencDualLayerEncoder;
|
|
367
405
|
|
|
368
406
|
export declare interface HwVideoEncoderOptions {
|
|
@@ -383,6 +421,12 @@ export declare interface HwVideoFactoryOptions {
|
|
|
383
421
|
sharedHw?: HardwareContext;
|
|
384
422
|
}
|
|
385
423
|
|
|
424
|
+
export declare function installMediaShim(hook: VideoHook): void;
|
|
425
|
+
|
|
426
|
+
export declare function installTickHook(): void;
|
|
427
|
+
|
|
428
|
+
export declare function installVideoHook(): void;
|
|
429
|
+
|
|
386
430
|
export declare function interleaveAccessUnits(baseNals: NalUnit[], alphaNals: NalUnit[], cfg: NvencHevcConfig): Buffer;
|
|
387
431
|
|
|
388
432
|
export declare interface IpcDonePayload {
|
|
@@ -413,14 +457,12 @@ export declare class IpcReader extends EventEmitter<IpcEvents> {
|
|
|
413
457
|
constructor(child: ChildProcess);
|
|
414
458
|
}
|
|
415
459
|
|
|
416
|
-
declare interface IPCRenderOptions extends RenderOptions {
|
|
460
|
+
export declare interface IPCRenderOptions extends RenderOptions {
|
|
417
461
|
source: string;
|
|
418
462
|
signal: AbortSignal;
|
|
419
463
|
onProgress: ProgressCallback;
|
|
420
464
|
onConsole: ConsoleCallback;
|
|
421
465
|
}
|
|
422
|
-
export { IPCRenderOptions }
|
|
423
|
-
export { IPCRenderOptions as IPCRenderOptions_alias_1 }
|
|
424
466
|
|
|
425
467
|
export declare class IpcWriter {
|
|
426
468
|
writeConsole(level: string, message: string): void;
|
|
@@ -443,9 +485,7 @@ declare class Lazy<T> {
|
|
|
443
485
|
export { Lazy }
|
|
444
486
|
export { Lazy as Lazy_alias_1 }
|
|
445
487
|
|
|
446
|
-
export declare function loadWindow({ source, renderer,
|
|
447
|
-
|
|
448
|
-
export declare function localize(src: string): Promise<string>;
|
|
488
|
+
export declare function loadWindow({ source, renderer, onCreated, signal }: WindowOptions): Promise<BrowserWindow>;
|
|
449
489
|
|
|
450
490
|
declare class Logger implements LoggerLike {
|
|
451
491
|
private _level;
|
|
@@ -487,6 +527,15 @@ export declare function makePacket(): Packet;
|
|
|
487
527
|
|
|
488
528
|
export declare const MAX_RENDER_ATTEMPTS = 3;
|
|
489
529
|
|
|
530
|
+
export declare const MEDIA_ERR_DECODE = 3;
|
|
531
|
+
|
|
532
|
+
export declare const MEDIA_ERR_NETWORK = 2;
|
|
533
|
+
|
|
534
|
+
export declare interface MediaErrorLike {
|
|
535
|
+
code: number;
|
|
536
|
+
message: string;
|
|
537
|
+
}
|
|
538
|
+
|
|
490
539
|
export declare const NAL_BLA_W_LP = 16;
|
|
491
540
|
|
|
492
541
|
export declare const NAL_HEADER_SIZE = 2;
|
|
@@ -513,12 +562,23 @@ export declare interface NalUnit {
|
|
|
513
562
|
data: Buffer;
|
|
514
563
|
}
|
|
515
564
|
|
|
565
|
+
export declare const NETWORK_EMPTY = 0;
|
|
566
|
+
|
|
567
|
+
export declare const NETWORK_IDLE = 1;
|
|
568
|
+
|
|
569
|
+
export declare const NETWORK_LOADING = 2;
|
|
570
|
+
|
|
571
|
+
export declare const NETWORK_NO_SOURCE = 3;
|
|
572
|
+
|
|
516
573
|
export declare interface NetworkOptions {
|
|
517
574
|
source: string;
|
|
518
575
|
window: BrowserWindow;
|
|
519
576
|
useInnerProxy?: boolean;
|
|
577
|
+
cancelMedia?: boolean;
|
|
520
578
|
}
|
|
521
579
|
|
|
580
|
+
export declare function newVideoState(video: HTMLVideoElement, cv: HTMLCanvasElement): VideoState;
|
|
581
|
+
|
|
522
582
|
declare function noerr<Fn extends (...args: any[]) => any, D>(fn: Fn, defaultValue: D): (...args: Parameters<Fn>) => ReturnType<Fn> | D;
|
|
523
583
|
export { noerr }
|
|
524
584
|
export { noerr as noerr_alias_1 }
|
|
@@ -549,8 +609,15 @@ export declare interface NvencHevcConfig {
|
|
|
549
609
|
export declare interface OpenOptions {
|
|
550
610
|
src: string;
|
|
551
611
|
fps: number;
|
|
612
|
+
/** Display-box pixels (canvas backing store); decode is downscaled to cover this, never upscaled. */
|
|
613
|
+
dstW?: number;
|
|
614
|
+
dstH?: number;
|
|
615
|
+
/** objectFit; "none" needs 1:1 native pixels so it skips downscale. */
|
|
616
|
+
fit?: string;
|
|
552
617
|
}
|
|
553
618
|
|
|
619
|
+
export declare function openSession(hook: VideoHook, args: AttachArgs): Promise<VideoState | null>;
|
|
620
|
+
|
|
554
621
|
export declare function openVideoCtx(opts: VideoCtxOptions, label: string): Promise<CodecContext>;
|
|
555
622
|
|
|
556
623
|
export declare class OutputSink implements AsyncDisposable {
|
|
@@ -573,9 +640,7 @@ export declare class OutputSink implements AsyncDisposable {
|
|
|
573
640
|
|
|
574
641
|
export declare function packBits(bits: number[]): Buffer;
|
|
575
642
|
|
|
576
|
-
declare function pargs(): string[];
|
|
577
|
-
export { pargs }
|
|
578
|
-
export { pargs as pargs_alias_1 }
|
|
643
|
+
export declare function pargs(): string[];
|
|
579
644
|
|
|
580
645
|
declare function parseNumber(x: unknown): number;
|
|
581
646
|
export { parseNumber }
|
|
@@ -583,9 +648,7 @@ export { parseNumber as parseNumber_alias_1 }
|
|
|
583
648
|
|
|
584
649
|
export declare function parseNvencHevcConfig(extradata: Buffer): NvencHevcConfig;
|
|
585
650
|
|
|
586
|
-
declare function parseString(x: unknown): string;
|
|
587
|
-
export { parseString }
|
|
588
|
-
export { parseString as parseString_alias_1 }
|
|
651
|
+
export declare function parseString(x: unknown): string;
|
|
589
652
|
|
|
590
653
|
/** Patch every VPS/SPS NAL in an Annex B bitstream so PTL matches Apple/x265. */
|
|
591
654
|
export declare function patchHevcAlphaPtl(bitstream: Buffer): Buffer;
|
|
@@ -610,14 +673,32 @@ export declare interface ProbeResult {
|
|
|
610
673
|
duration: number;
|
|
611
674
|
}
|
|
612
675
|
|
|
613
|
-
declare interface ProcessHandle {
|
|
676
|
+
export declare interface ProcessHandle {
|
|
614
677
|
process: ChildProcess;
|
|
615
678
|
wait: Promise<void>;
|
|
616
679
|
get killed(): boolean;
|
|
617
680
|
kill(): void;
|
|
618
681
|
}
|
|
619
|
-
|
|
620
|
-
|
|
682
|
+
|
|
683
|
+
declare class ProgressBar {
|
|
684
|
+
private _written;
|
|
685
|
+
private _shown;
|
|
686
|
+
private readonly _total;
|
|
687
|
+
private readonly _out;
|
|
688
|
+
private readonly _tty;
|
|
689
|
+
private readonly _showCount;
|
|
690
|
+
constructor(opts: BarOptions);
|
|
691
|
+
get total(): number;
|
|
692
|
+
update(written: number): void;
|
|
693
|
+
updatePercent(pct: number): void;
|
|
694
|
+
clear(): void;
|
|
695
|
+
redraw(): void;
|
|
696
|
+
log(line: string): void;
|
|
697
|
+
finish(line: string): void;
|
|
698
|
+
private render;
|
|
699
|
+
}
|
|
700
|
+
export { ProgressBar }
|
|
701
|
+
export { ProgressBar as ProgressBar_alias_1 }
|
|
621
702
|
|
|
622
703
|
declare type ProgressCallback = (progress: number) => void;
|
|
623
704
|
export { ProgressCallback }
|
|
@@ -634,21 +715,15 @@ declare function pup(source: string, options: Partial<PupOptions>): Promise<PupR
|
|
|
634
715
|
export { pup }
|
|
635
716
|
export { pup as pup_alias_1 }
|
|
636
717
|
|
|
637
|
-
declare const PUP_ARGS_KEY = "--pup-priv-args";
|
|
638
|
-
|
|
639
|
-
export
|
|
718
|
+
export declare const PUP_ARGS_KEY = "--pup-priv-args";
|
|
719
|
+
|
|
720
|
+
export declare const pupApp: string;
|
|
640
721
|
|
|
641
|
-
declare const
|
|
642
|
-
export { pupApp }
|
|
643
|
-
export { pupApp as pupApp_alias_1 }
|
|
722
|
+
export declare const pupAudioPreload: string;
|
|
644
723
|
|
|
645
|
-
declare const
|
|
646
|
-
export { pupAudioPreload }
|
|
647
|
-
export { pupAudioPreload as pupAudioPreload_alias_1 }
|
|
724
|
+
export declare const pupIframePreload: string;
|
|
648
725
|
|
|
649
|
-
declare const pupLogLevel: number;
|
|
650
|
-
export { pupLogLevel }
|
|
651
|
-
export { pupLogLevel as pupLogLevel_alias_1 }
|
|
726
|
+
export declare const pupLogLevel: number;
|
|
652
727
|
|
|
653
728
|
declare interface PupOptions extends Partial<RenderOptions> {
|
|
654
729
|
signal?: AbortSignal;
|
|
@@ -658,9 +733,7 @@ declare interface PupOptions extends Partial<RenderOptions> {
|
|
|
658
733
|
export { PupOptions }
|
|
659
734
|
export { PupOptions as PupOptions_alias_1 }
|
|
660
735
|
|
|
661
|
-
declare const pupPkgRoot: string;
|
|
662
|
-
export { pupPkgRoot }
|
|
663
|
-
export { pupPkgRoot as pupPkgRoot_alias_1 }
|
|
736
|
+
export declare const pupPkgRoot: string;
|
|
664
737
|
|
|
665
738
|
declare interface PupResult extends RenderResult {
|
|
666
739
|
}
|
|
@@ -685,7 +758,7 @@ declare interface RenderResult {
|
|
|
685
758
|
export { RenderResult }
|
|
686
759
|
export { RenderResult as RenderResult_alias_1 }
|
|
687
760
|
|
|
688
|
-
declare const RenderSchema: z.ZodObject<{
|
|
761
|
+
export declare const RenderSchema: z.ZodObject<{
|
|
689
762
|
duration: z.ZodNumber;
|
|
690
763
|
width: z.ZodNumber;
|
|
691
764
|
height: z.ZodNumber;
|
|
@@ -698,8 +771,6 @@ declare const RenderSchema: z.ZodObject<{
|
|
|
698
771
|
disableHwCodec: z.ZodBoolean;
|
|
699
772
|
windowTolerant: z.ZodBoolean;
|
|
700
773
|
}, z.core.$strip>;
|
|
701
|
-
export { RenderSchema }
|
|
702
|
-
export { RenderSchema as RenderSchema_alias_1 }
|
|
703
774
|
|
|
704
775
|
export declare function resizeDrawable(cdp: Debugger, size: Size): Promise<void>;
|
|
705
776
|
|
|
@@ -737,9 +808,13 @@ export declare interface RunElectronAppOptions {
|
|
|
737
808
|
args: unknown[];
|
|
738
809
|
}
|
|
739
810
|
|
|
811
|
+
export declare const SCHEME = "pup-frame://";
|
|
812
|
+
|
|
740
813
|
export declare function send(cdp: Debugger, method: string, params?: object): Promise<unknown>;
|
|
741
814
|
|
|
742
|
-
export declare function setInterceptor({ source, window, useInnerProxy }: NetworkOptions): void;
|
|
815
|
+
export declare function setInterceptor({ source, window, useInnerProxy, cancelMedia }: NetworkOptions): void;
|
|
816
|
+
|
|
817
|
+
export declare function setupCanvas(video: HTMLVideoElement, snap: OffscreenCanvas | undefined): HTMLCanvasElement;
|
|
743
818
|
|
|
744
819
|
export declare function setupFrameProtocol(): void;
|
|
745
820
|
|
|
@@ -769,6 +844,15 @@ export { sleep as sleep_alias_1 }
|
|
|
769
844
|
/** Split Annex B bitstream into NAL units. */
|
|
770
845
|
export declare function splitNalUnits(bitstream: Buffer): NalUnit[];
|
|
771
846
|
|
|
847
|
+
export declare class SrcCache {
|
|
848
|
+
private inFlight;
|
|
849
|
+
private ctrl;
|
|
850
|
+
localize(src: string): Promise<string>;
|
|
851
|
+
abort(): void;
|
|
852
|
+
clear(): Promise<void>;
|
|
853
|
+
private download;
|
|
854
|
+
}
|
|
855
|
+
|
|
772
856
|
export declare function startElectronCrashReporter(): void;
|
|
773
857
|
|
|
774
858
|
export declare function startStego(cdp: Debugger): Promise<unknown>;
|
|
@@ -779,10 +863,22 @@ export declare function stopStego(cdp: Debugger): Promise<unknown>;
|
|
|
779
863
|
|
|
780
864
|
export declare function swapBuffer(wc: WebContents, expected: number, interval: number): Promise<void>;
|
|
781
865
|
|
|
866
|
+
export declare function syncOverlay(video: HTMLVideoElement, cv: HTMLCanvasElement): void;
|
|
867
|
+
|
|
868
|
+
export declare const TAG = "[VideoHook]";
|
|
869
|
+
|
|
782
870
|
export declare function tick(frame: WebFrameMain | undefined, timestampMs: number): Promise<void>;
|
|
783
871
|
|
|
784
872
|
export declare const TICK_SYMBOL = "__pup_tick__";
|
|
785
873
|
|
|
874
|
+
export declare function timeRanges(end: number): TimeRangesLike;
|
|
875
|
+
|
|
876
|
+
export declare interface TimeRangesLike {
|
|
877
|
+
length: number;
|
|
878
|
+
start(i: number): number;
|
|
879
|
+
end(i: number): number;
|
|
880
|
+
}
|
|
881
|
+
|
|
786
882
|
export declare interface UnifiedExtradataOptions {
|
|
787
883
|
baseExtradata: Buffer;
|
|
788
884
|
alphaExtradata: Buffer;
|
|
@@ -796,7 +892,13 @@ declare function useRetry<Args extends any[], Ret>({ fn, maxAttempts, timeout, s
|
|
|
796
892
|
export { useRetry }
|
|
797
893
|
export { useRetry as useRetry_alias_1 }
|
|
798
894
|
|
|
799
|
-
|
|
895
|
+
declare type Vec4 = [number, number, number, number];
|
|
896
|
+
|
|
897
|
+
export declare interface VideoCache {
|
|
898
|
+
bitmaps: Map<number, ImageBitmap>;
|
|
899
|
+
inFlight: Map<number, Promise<ImageBitmap | null>>;
|
|
900
|
+
readers: Map<VideoState, number>;
|
|
901
|
+
}
|
|
800
902
|
|
|
801
903
|
export declare interface VideoCtxOptions {
|
|
802
904
|
codec: Codec;
|
|
@@ -837,14 +939,53 @@ export declare interface VideoEncoderOptions {
|
|
|
837
939
|
muxer: FormatMuxer;
|
|
838
940
|
}
|
|
839
941
|
|
|
942
|
+
export declare interface VideoFrameMeta {
|
|
943
|
+
presentationTime: number;
|
|
944
|
+
expectedDisplayTime: number;
|
|
945
|
+
width: number;
|
|
946
|
+
height: number;
|
|
947
|
+
mediaTime: number;
|
|
948
|
+
presentedFrames: number;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
export declare class VideoHook {
|
|
952
|
+
readonly sessions: WeakMap<HTMLVideoElement, VideoState>;
|
|
953
|
+
readonly attaching: WeakMap<HTMLVideoElement, Promise<VideoState | null>>;
|
|
954
|
+
readonly cache: FrameCache;
|
|
955
|
+
rvfcSeq: number;
|
|
956
|
+
currMs: number;
|
|
957
|
+
private lastSnapshot;
|
|
958
|
+
install(): void;
|
|
959
|
+
attach(video: HTMLVideoElement, native?: boolean): Promise<VideoState | null>;
|
|
960
|
+
resume(video: HTMLVideoElement, state: VideoState): void;
|
|
961
|
+
detach(video: HTMLVideoElement): void;
|
|
962
|
+
onSrcChange(video: HTMLVideoElement): void;
|
|
963
|
+
reattach(video: HTMLVideoElement, state: VideoState): void;
|
|
964
|
+
private scan;
|
|
965
|
+
}
|
|
966
|
+
|
|
840
967
|
export declare interface VideoMeta {
|
|
841
968
|
id: string;
|
|
969
|
+
/** Intrinsic source dimensions (reported as videoWidth/videoHeight). */
|
|
842
970
|
width: number;
|
|
843
971
|
height: number;
|
|
972
|
+
/** Decoded+scaled frame dimensions actually served (≤ source; capped to the display box). */
|
|
973
|
+
frameWidth: number;
|
|
974
|
+
frameHeight: number;
|
|
844
975
|
fps: number;
|
|
845
976
|
duration: number;
|
|
846
977
|
}
|
|
847
978
|
|
|
979
|
+
export declare interface VideoMeta_alias_1 {
|
|
980
|
+
id: string;
|
|
981
|
+
width: number;
|
|
982
|
+
height: number;
|
|
983
|
+
frameWidth: number;
|
|
984
|
+
frameHeight: number;
|
|
985
|
+
duration: number;
|
|
986
|
+
fps: number;
|
|
987
|
+
}
|
|
988
|
+
|
|
848
989
|
export declare interface VideoSetup {
|
|
849
990
|
video?: VideoEncoder_2;
|
|
850
991
|
hwVideo?: HwEncoder;
|
|
@@ -853,6 +994,26 @@ export declare interface VideoSetup {
|
|
|
853
994
|
ownsHw: boolean;
|
|
854
995
|
}
|
|
855
996
|
|
|
997
|
+
export declare interface VideoState {
|
|
998
|
+
meta: VideoMeta_alias_1 | null;
|
|
999
|
+
cv: HTMLCanvasElement;
|
|
1000
|
+
ctx: CanvasRenderingContext2D;
|
|
1001
|
+
paused: boolean;
|
|
1002
|
+
currentTime: number;
|
|
1003
|
+
ended: boolean;
|
|
1004
|
+
lastDrawnIdx: number;
|
|
1005
|
+
dead: boolean;
|
|
1006
|
+
objectFit: string;
|
|
1007
|
+
readyState: number;
|
|
1008
|
+
networkState: number;
|
|
1009
|
+
seeking: boolean;
|
|
1010
|
+
waiting: boolean;
|
|
1011
|
+
error: MediaErrorLike | undefined;
|
|
1012
|
+
presentedFrames: number;
|
|
1013
|
+
maxReached: number;
|
|
1014
|
+
rvfc: Map<number, FrameCb>;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
856
1017
|
export declare class VideoToolboxEncoder implements Disposable {
|
|
857
1018
|
private _ctx;
|
|
858
1019
|
private _pkt;
|
|
@@ -885,15 +1046,12 @@ export declare interface WindowOptions {
|
|
|
885
1046
|
source: string;
|
|
886
1047
|
renderer: IPCRenderOptions;
|
|
887
1048
|
tolerant?: boolean;
|
|
888
|
-
preload?: string;
|
|
889
1049
|
onCreated?: WindowCreatedCallback;
|
|
890
1050
|
signal?: AbortSignal;
|
|
891
1051
|
}
|
|
892
1052
|
|
|
893
1053
|
export declare function withRerender<T>(signal: AbortSignal, action: () => Promise<T>): Promise<T>;
|
|
894
1054
|
|
|
895
|
-
declare function withTimeout<T>(p: Promise<T>, ms: number, label: string): Promise<T>;
|
|
896
|
-
export { withTimeout }
|
|
897
|
-
export { withTimeout as withTimeout_alias_1 }
|
|
1055
|
+
export declare function withTimeout<T>(p: Promise<T>, ms: number, label: string): Promise<T>;
|
|
898
1056
|
|
|
899
1057
|
export { }
|