pup-recorder 0.4.0 → 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 -10
- package/dist/_tsup-dts-rollup.d.ts +195 -74
- package/dist/app.cjs +5 -5
- package/dist/chunk-YJ7QEMFY.js +4 -0
- package/dist/cli.js +2 -2
- package/dist/iframe_preload.cjs +2 -2
- package/dist/index.d.ts +10 -31
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-GDKW7ZIE.js +0 -4
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,15 +36,11 @@ await build({
|
|
|
33
36
|
|
|
34
37
|
await build({
|
|
35
38
|
...common,
|
|
36
|
-
entry: [
|
|
39
|
+
entry: [
|
|
40
|
+
"src/app.ts", //
|
|
41
|
+
"src/audio_preload.ts",
|
|
42
|
+
"src/iframe_preload.ts",
|
|
43
|
+
],
|
|
37
44
|
format: "cjs",
|
|
38
45
|
outDir: "dist",
|
|
39
46
|
});
|
|
40
|
-
|
|
41
|
-
await build({
|
|
42
|
-
...common,
|
|
43
|
-
entry: ["src/audio_preload.ts", "src/iframe_preload.ts"],
|
|
44
|
-
format: "cjs",
|
|
45
|
-
outDir: "dist",
|
|
46
|
-
});
|
|
47
|
-
|
|
@@ -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";
|
|
@@ -158,7 +170,7 @@ declare class CodecState_2 implements Disposable {
|
|
|
158
170
|
}
|
|
159
171
|
export { CodecState_2 as CodecState }
|
|
160
172
|
|
|
161
|
-
declare class ConcurrencyLimiter {
|
|
173
|
+
export declare class ConcurrencyLimiter {
|
|
162
174
|
readonly maxConcurrency: number;
|
|
163
175
|
private _active;
|
|
164
176
|
private _queue;
|
|
@@ -173,12 +185,8 @@ declare class ConcurrencyLimiter {
|
|
|
173
185
|
private flush;
|
|
174
186
|
private next;
|
|
175
187
|
}
|
|
176
|
-
export { ConcurrencyLimiter }
|
|
177
|
-
export { ConcurrencyLimiter as ConcurrencyLimiter_alias_1 }
|
|
178
188
|
|
|
179
|
-
declare type ConsoleCallback = (level: string, message: string) => void;
|
|
180
|
-
export { ConsoleCallback }
|
|
181
|
-
export { ConsoleCallback as ConsoleCallback_alias_1 }
|
|
189
|
+
export declare type ConsoleCallback = (level: string, message: string) => void;
|
|
182
190
|
|
|
183
191
|
export declare interface ConsoleMsg {
|
|
184
192
|
type: IpcMsgType.CONSOLE;
|
|
@@ -195,18 +203,27 @@ export declare function debounce<T extends (...args: unknown[]) => void>(fn: T,
|
|
|
195
203
|
export declare class DecodeSession {
|
|
196
204
|
readonly meta: VideoMeta;
|
|
197
205
|
private readonly src;
|
|
198
|
-
private
|
|
199
|
-
private proc;
|
|
206
|
+
private buf;
|
|
200
207
|
private ready;
|
|
208
|
+
private want;
|
|
201
209
|
private done;
|
|
210
|
+
private closed;
|
|
211
|
+
private gen;
|
|
212
|
+
private ctrl;
|
|
202
213
|
private waiters;
|
|
203
|
-
private
|
|
204
|
-
|
|
214
|
+
private resume;
|
|
215
|
+
private restart;
|
|
216
|
+
constructor(meta: VideoMeta, src: string);
|
|
205
217
|
getFrame(idx: number): Promise<Buffer>;
|
|
206
218
|
close(): void;
|
|
207
219
|
private wait;
|
|
208
|
-
private
|
|
209
|
-
private
|
|
220
|
+
private wake;
|
|
221
|
+
private requestRestart;
|
|
222
|
+
private pump;
|
|
223
|
+
private decodePass;
|
|
224
|
+
private pause;
|
|
225
|
+
private untilRestart;
|
|
226
|
+
private evict;
|
|
210
227
|
private drainWaiters;
|
|
211
228
|
}
|
|
212
229
|
|
|
@@ -224,17 +241,13 @@ declare const DEFAULT_HEIGHT = 1080;
|
|
|
224
241
|
export { DEFAULT_HEIGHT }
|
|
225
242
|
export { DEFAULT_HEIGHT as DEFAULT_HEIGHT_alias_1 }
|
|
226
243
|
|
|
227
|
-
declare const DEFAULT_OUT_FILE = "out/html.mp4,out/html.webm";
|
|
228
|
-
export { DEFAULT_OUT_FILE }
|
|
229
|
-
export { DEFAULT_OUT_FILE as DEFAULT_OUT_FILE_alias_1 }
|
|
244
|
+
export declare const DEFAULT_OUT_FILE = "out/html.mp4,out/html.webm";
|
|
230
245
|
|
|
231
246
|
declare const DEFAULT_WIDTH = 1920;
|
|
232
247
|
export { DEFAULT_WIDTH }
|
|
233
248
|
export { DEFAULT_WIDTH as DEFAULT_WIDTH_alias_1 }
|
|
234
249
|
|
|
235
|
-
declare const defaultRenderOptions: RenderOptions;
|
|
236
|
-
export { defaultRenderOptions }
|
|
237
|
-
export { defaultRenderOptions as defaultRenderOptions_alias_1 }
|
|
250
|
+
export declare const defaultRenderOptions: RenderOptions;
|
|
238
251
|
|
|
239
252
|
export declare function disposeWindow(win: BrowserWindow): Promise<void>;
|
|
240
253
|
|
|
@@ -270,7 +283,7 @@ export declare function electronOpts(disableGpu: boolean): Promise<string[]>;
|
|
|
270
283
|
|
|
271
284
|
export declare function encodeNalHeader(type: number, layerId: number, temporalId: number): [number, number];
|
|
272
285
|
|
|
273
|
-
declare class EncoderPipeline {
|
|
286
|
+
export declare class EncoderPipeline {
|
|
274
287
|
private _s;
|
|
275
288
|
private _disposed;
|
|
276
289
|
private constructor();
|
|
@@ -284,10 +297,8 @@ declare class EncoderPipeline {
|
|
|
284
297
|
private free;
|
|
285
298
|
private bgraFrame;
|
|
286
299
|
}
|
|
287
|
-
export { EncoderPipeline }
|
|
288
|
-
export { EncoderPipeline as EncoderPipeline_alias_1 }
|
|
289
300
|
|
|
290
|
-
declare interface EncoderPipelineOptions {
|
|
301
|
+
export declare interface EncoderPipelineOptions {
|
|
291
302
|
width: number;
|
|
292
303
|
height: number;
|
|
293
304
|
fps: number;
|
|
@@ -295,12 +306,8 @@ declare interface EncoderPipelineOptions {
|
|
|
295
306
|
withAudio?: boolean;
|
|
296
307
|
disableHwCodec?: boolean;
|
|
297
308
|
}
|
|
298
|
-
export { EncoderPipelineOptions }
|
|
299
|
-
export { EncoderPipelineOptions as EncoderPipelineOptions_alias_1 }
|
|
300
309
|
|
|
301
|
-
declare type EnvParser<T> = (value: unknown) => T;
|
|
302
|
-
export { EnvParser }
|
|
303
|
-
export { EnvParser as EnvParser_alias_1 }
|
|
310
|
+
export declare type EnvParser<T> = (value: unknown) => T;
|
|
304
311
|
|
|
305
312
|
export declare interface ErrorMsg {
|
|
306
313
|
type: IpcMsgType.ERROR;
|
|
@@ -309,13 +316,15 @@ export declare interface ErrorMsg {
|
|
|
309
316
|
|
|
310
317
|
export declare function evalIn(cdp: Debugger, expression: string): Promise<unknown>;
|
|
311
318
|
|
|
312
|
-
declare function exec(cmd: string, options?: SpawnOptions): ProcessHandle;
|
|
313
|
-
export { exec }
|
|
314
|
-
export { exec as exec_alias_1 }
|
|
319
|
+
export declare function exec(cmd: string, options?: SpawnOptions): ProcessHandle;
|
|
315
320
|
|
|
316
321
|
export declare function extractAlphaToYuv420pBuffer(bgraFrame: Frame, buf: Buffer): void;
|
|
317
322
|
|
|
318
|
-
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 {
|
|
319
328
|
private readonly _ctx;
|
|
320
329
|
private _opened;
|
|
321
330
|
constructor(outPath: string, formatName?: string);
|
|
@@ -324,13 +333,22 @@ declare class FormatMuxer {
|
|
|
324
333
|
writePacket(pkt: Packet): Promise<void>;
|
|
325
334
|
[Symbol.asyncDispose](): Promise<void>;
|
|
326
335
|
}
|
|
327
|
-
export { FormatMuxer }
|
|
328
|
-
export { FormatMuxer as FormatMuxer_alias_1 }
|
|
329
336
|
|
|
330
337
|
export declare const FRAME_SYNC_MARKER_HEIGHT = 1;
|
|
331
338
|
|
|
332
339
|
export declare const FRAME_SYNC_MARKER_WIDTH = 32;
|
|
333
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
|
+
|
|
334
352
|
/**
|
|
335
353
|
* Frame drop quality score (0 = perfect, 1 = worst).
|
|
336
354
|
*
|
|
@@ -365,14 +383,24 @@ export declare class FrameDropStats {
|
|
|
365
383
|
|
|
366
384
|
export declare class FrameServer {
|
|
367
385
|
private sessions;
|
|
386
|
+
private srcs;
|
|
387
|
+
private inFlightOpens;
|
|
388
|
+
private closed;
|
|
368
389
|
open(opts: OpenOptions): Promise<VideoMeta>;
|
|
390
|
+
private openInner;
|
|
369
391
|
getFrame(id: string, idx: number): Promise<Buffer>;
|
|
370
392
|
close(id: string): void;
|
|
371
|
-
closeAll(): void
|
|
393
|
+
closeAll(): Promise<void>;
|
|
372
394
|
}
|
|
373
395
|
|
|
374
396
|
export declare const frameServer: FrameServer;
|
|
375
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
|
+
|
|
376
404
|
export declare type HwEncoder = VideoToolboxEncoder | NvencDualLayerEncoder;
|
|
377
405
|
|
|
378
406
|
export declare interface HwVideoEncoderOptions {
|
|
@@ -393,6 +421,8 @@ export declare interface HwVideoFactoryOptions {
|
|
|
393
421
|
sharedHw?: HardwareContext;
|
|
394
422
|
}
|
|
395
423
|
|
|
424
|
+
export declare function installMediaShim(hook: VideoHook): void;
|
|
425
|
+
|
|
396
426
|
export declare function installTickHook(): void;
|
|
397
427
|
|
|
398
428
|
export declare function installVideoHook(): void;
|
|
@@ -427,14 +457,12 @@ export declare class IpcReader extends EventEmitter<IpcEvents> {
|
|
|
427
457
|
constructor(child: ChildProcess);
|
|
428
458
|
}
|
|
429
459
|
|
|
430
|
-
declare interface IPCRenderOptions extends RenderOptions {
|
|
460
|
+
export declare interface IPCRenderOptions extends RenderOptions {
|
|
431
461
|
source: string;
|
|
432
462
|
signal: AbortSignal;
|
|
433
463
|
onProgress: ProgressCallback;
|
|
434
464
|
onConsole: ConsoleCallback;
|
|
435
465
|
}
|
|
436
|
-
export { IPCRenderOptions }
|
|
437
|
-
export { IPCRenderOptions as IPCRenderOptions_alias_1 }
|
|
438
466
|
|
|
439
467
|
export declare class IpcWriter {
|
|
440
468
|
writeConsole(level: string, message: string): void;
|
|
@@ -459,8 +487,6 @@ export { Lazy as Lazy_alias_1 }
|
|
|
459
487
|
|
|
460
488
|
export declare function loadWindow({ source, renderer, onCreated, signal }: WindowOptions): Promise<BrowserWindow>;
|
|
461
489
|
|
|
462
|
-
export declare function localize(src: string): Promise<string>;
|
|
463
|
-
|
|
464
490
|
declare class Logger implements LoggerLike {
|
|
465
491
|
private _level;
|
|
466
492
|
private _impl?;
|
|
@@ -501,6 +527,15 @@ export declare function makePacket(): Packet;
|
|
|
501
527
|
|
|
502
528
|
export declare const MAX_RENDER_ATTEMPTS = 3;
|
|
503
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
|
+
|
|
504
539
|
export declare const NAL_BLA_W_LP = 16;
|
|
505
540
|
|
|
506
541
|
export declare const NAL_HEADER_SIZE = 2;
|
|
@@ -527,12 +562,23 @@ export declare interface NalUnit {
|
|
|
527
562
|
data: Buffer;
|
|
528
563
|
}
|
|
529
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
|
+
|
|
530
573
|
export declare interface NetworkOptions {
|
|
531
574
|
source: string;
|
|
532
575
|
window: BrowserWindow;
|
|
533
576
|
useInnerProxy?: boolean;
|
|
577
|
+
cancelMedia?: boolean;
|
|
534
578
|
}
|
|
535
579
|
|
|
580
|
+
export declare function newVideoState(video: HTMLVideoElement, cv: HTMLCanvasElement): VideoState;
|
|
581
|
+
|
|
536
582
|
declare function noerr<Fn extends (...args: any[]) => any, D>(fn: Fn, defaultValue: D): (...args: Parameters<Fn>) => ReturnType<Fn> | D;
|
|
537
583
|
export { noerr }
|
|
538
584
|
export { noerr as noerr_alias_1 }
|
|
@@ -563,8 +609,15 @@ export declare interface NvencHevcConfig {
|
|
|
563
609
|
export declare interface OpenOptions {
|
|
564
610
|
src: string;
|
|
565
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;
|
|
566
617
|
}
|
|
567
618
|
|
|
619
|
+
export declare function openSession(hook: VideoHook, args: AttachArgs): Promise<VideoState | null>;
|
|
620
|
+
|
|
568
621
|
export declare function openVideoCtx(opts: VideoCtxOptions, label: string): Promise<CodecContext>;
|
|
569
622
|
|
|
570
623
|
export declare class OutputSink implements AsyncDisposable {
|
|
@@ -587,9 +640,7 @@ export declare class OutputSink implements AsyncDisposable {
|
|
|
587
640
|
|
|
588
641
|
export declare function packBits(bits: number[]): Buffer;
|
|
589
642
|
|
|
590
|
-
declare function pargs(): string[];
|
|
591
|
-
export { pargs }
|
|
592
|
-
export { pargs as pargs_alias_1 }
|
|
643
|
+
export declare function pargs(): string[];
|
|
593
644
|
|
|
594
645
|
declare function parseNumber(x: unknown): number;
|
|
595
646
|
export { parseNumber }
|
|
@@ -597,9 +648,7 @@ export { parseNumber as parseNumber_alias_1 }
|
|
|
597
648
|
|
|
598
649
|
export declare function parseNvencHevcConfig(extradata: Buffer): NvencHevcConfig;
|
|
599
650
|
|
|
600
|
-
declare function parseString(x: unknown): string;
|
|
601
|
-
export { parseString }
|
|
602
|
-
export { parseString as parseString_alias_1 }
|
|
651
|
+
export declare function parseString(x: unknown): string;
|
|
603
652
|
|
|
604
653
|
/** Patch every VPS/SPS NAL in an Annex B bitstream so PTL matches Apple/x265. */
|
|
605
654
|
export declare function patchHevcAlphaPtl(bitstream: Buffer): Buffer;
|
|
@@ -624,14 +673,12 @@ export declare interface ProbeResult {
|
|
|
624
673
|
duration: number;
|
|
625
674
|
}
|
|
626
675
|
|
|
627
|
-
declare interface ProcessHandle {
|
|
676
|
+
export declare interface ProcessHandle {
|
|
628
677
|
process: ChildProcess;
|
|
629
678
|
wait: Promise<void>;
|
|
630
679
|
get killed(): boolean;
|
|
631
680
|
kill(): void;
|
|
632
681
|
}
|
|
633
|
-
export { ProcessHandle }
|
|
634
|
-
export { ProcessHandle as ProcessHandle_alias_1 }
|
|
635
682
|
|
|
636
683
|
declare class ProgressBar {
|
|
637
684
|
private _written;
|
|
@@ -668,25 +715,15 @@ declare function pup(source: string, options: Partial<PupOptions>): Promise<PupR
|
|
|
668
715
|
export { pup }
|
|
669
716
|
export { pup as pup_alias_1 }
|
|
670
717
|
|
|
671
|
-
declare const PUP_ARGS_KEY = "--pup-priv-args";
|
|
672
|
-
export { PUP_ARGS_KEY }
|
|
673
|
-
export { PUP_ARGS_KEY as PUP_ARGS_KEY_alias_1 }
|
|
718
|
+
export declare const PUP_ARGS_KEY = "--pup-priv-args";
|
|
674
719
|
|
|
675
|
-
declare const pupApp: string;
|
|
676
|
-
export { pupApp }
|
|
677
|
-
export { pupApp as pupApp_alias_1 }
|
|
720
|
+
export declare const pupApp: string;
|
|
678
721
|
|
|
679
|
-
declare const pupAudioPreload: string;
|
|
680
|
-
export { pupAudioPreload }
|
|
681
|
-
export { pupAudioPreload as pupAudioPreload_alias_1 }
|
|
722
|
+
export declare const pupAudioPreload: string;
|
|
682
723
|
|
|
683
|
-
declare const pupIframePreload: string;
|
|
684
|
-
export { pupIframePreload }
|
|
685
|
-
export { pupIframePreload as pupIframePreload_alias_1 }
|
|
724
|
+
export declare const pupIframePreload: string;
|
|
686
725
|
|
|
687
|
-
declare const pupLogLevel: number;
|
|
688
|
-
export { pupLogLevel }
|
|
689
|
-
export { pupLogLevel as pupLogLevel_alias_1 }
|
|
726
|
+
export declare const pupLogLevel: number;
|
|
690
727
|
|
|
691
728
|
declare interface PupOptions extends Partial<RenderOptions> {
|
|
692
729
|
signal?: AbortSignal;
|
|
@@ -696,9 +733,7 @@ declare interface PupOptions extends Partial<RenderOptions> {
|
|
|
696
733
|
export { PupOptions }
|
|
697
734
|
export { PupOptions as PupOptions_alias_1 }
|
|
698
735
|
|
|
699
|
-
declare const pupPkgRoot: string;
|
|
700
|
-
export { pupPkgRoot }
|
|
701
|
-
export { pupPkgRoot as pupPkgRoot_alias_1 }
|
|
736
|
+
export declare const pupPkgRoot: string;
|
|
702
737
|
|
|
703
738
|
declare interface PupResult extends RenderResult {
|
|
704
739
|
}
|
|
@@ -723,7 +758,7 @@ declare interface RenderResult {
|
|
|
723
758
|
export { RenderResult }
|
|
724
759
|
export { RenderResult as RenderResult_alias_1 }
|
|
725
760
|
|
|
726
|
-
declare const RenderSchema: z.ZodObject<{
|
|
761
|
+
export declare const RenderSchema: z.ZodObject<{
|
|
727
762
|
duration: z.ZodNumber;
|
|
728
763
|
width: z.ZodNumber;
|
|
729
764
|
height: z.ZodNumber;
|
|
@@ -736,8 +771,6 @@ declare const RenderSchema: z.ZodObject<{
|
|
|
736
771
|
disableHwCodec: z.ZodBoolean;
|
|
737
772
|
windowTolerant: z.ZodBoolean;
|
|
738
773
|
}, z.core.$strip>;
|
|
739
|
-
export { RenderSchema }
|
|
740
|
-
export { RenderSchema as RenderSchema_alias_1 }
|
|
741
774
|
|
|
742
775
|
export declare function resizeDrawable(cdp: Debugger, size: Size): Promise<void>;
|
|
743
776
|
|
|
@@ -775,9 +808,13 @@ export declare interface RunElectronAppOptions {
|
|
|
775
808
|
args: unknown[];
|
|
776
809
|
}
|
|
777
810
|
|
|
811
|
+
export declare const SCHEME = "pup-frame://";
|
|
812
|
+
|
|
778
813
|
export declare function send(cdp: Debugger, method: string, params?: object): Promise<unknown>;
|
|
779
814
|
|
|
780
|
-
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;
|
|
781
818
|
|
|
782
819
|
export declare function setupFrameProtocol(): void;
|
|
783
820
|
|
|
@@ -807,6 +844,15 @@ export { sleep as sleep_alias_1 }
|
|
|
807
844
|
/** Split Annex B bitstream into NAL units. */
|
|
808
845
|
export declare function splitNalUnits(bitstream: Buffer): NalUnit[];
|
|
809
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
|
+
|
|
810
856
|
export declare function startElectronCrashReporter(): void;
|
|
811
857
|
|
|
812
858
|
export declare function startStego(cdp: Debugger): Promise<unknown>;
|
|
@@ -817,10 +863,22 @@ export declare function stopStego(cdp: Debugger): Promise<unknown>;
|
|
|
817
863
|
|
|
818
864
|
export declare function swapBuffer(wc: WebContents, expected: number, interval: number): Promise<void>;
|
|
819
865
|
|
|
866
|
+
export declare function syncOverlay(video: HTMLVideoElement, cv: HTMLCanvasElement): void;
|
|
867
|
+
|
|
868
|
+
export declare const TAG = "[VideoHook]";
|
|
869
|
+
|
|
820
870
|
export declare function tick(frame: WebFrameMain | undefined, timestampMs: number): Promise<void>;
|
|
821
871
|
|
|
822
872
|
export declare const TICK_SYMBOL = "__pup_tick__";
|
|
823
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
|
+
|
|
824
882
|
export declare interface UnifiedExtradataOptions {
|
|
825
883
|
baseExtradata: Buffer;
|
|
826
884
|
alphaExtradata: Buffer;
|
|
@@ -834,7 +892,13 @@ declare function useRetry<Args extends any[], Ret>({ fn, maxAttempts, timeout, s
|
|
|
834
892
|
export { useRetry }
|
|
835
893
|
export { useRetry as useRetry_alias_1 }
|
|
836
894
|
|
|
837
|
-
|
|
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
|
+
}
|
|
838
902
|
|
|
839
903
|
export declare interface VideoCtxOptions {
|
|
840
904
|
codec: Codec;
|
|
@@ -875,14 +939,53 @@ export declare interface VideoEncoderOptions {
|
|
|
875
939
|
muxer: FormatMuxer;
|
|
876
940
|
}
|
|
877
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
|
+
|
|
878
967
|
export declare interface VideoMeta {
|
|
879
968
|
id: string;
|
|
969
|
+
/** Intrinsic source dimensions (reported as videoWidth/videoHeight). */
|
|
880
970
|
width: number;
|
|
881
971
|
height: number;
|
|
972
|
+
/** Decoded+scaled frame dimensions actually served (≤ source; capped to the display box). */
|
|
973
|
+
frameWidth: number;
|
|
974
|
+
frameHeight: number;
|
|
882
975
|
fps: number;
|
|
883
976
|
duration: number;
|
|
884
977
|
}
|
|
885
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
|
+
|
|
886
989
|
export declare interface VideoSetup {
|
|
887
990
|
video?: VideoEncoder_2;
|
|
888
991
|
hwVideo?: HwEncoder;
|
|
@@ -891,6 +994,26 @@ export declare interface VideoSetup {
|
|
|
891
994
|
ownsHw: boolean;
|
|
892
995
|
}
|
|
893
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
|
+
|
|
894
1017
|
export declare class VideoToolboxEncoder implements Disposable {
|
|
895
1018
|
private _ctx;
|
|
896
1019
|
private _pkt;
|
|
@@ -929,8 +1052,6 @@ export declare interface WindowOptions {
|
|
|
929
1052
|
|
|
930
1053
|
export declare function withRerender<T>(signal: AbortSignal, action: () => Promise<T>): Promise<T>;
|
|
931
1054
|
|
|
932
|
-
declare function withTimeout<T>(p: Promise<T>, ms: number, label: string): Promise<T>;
|
|
933
|
-
export { withTimeout }
|
|
934
|
-
export { withTimeout as withTimeout_alias_1 }
|
|
1055
|
+
export declare function withTimeout<T>(p: Promise<T>, ms: number, label: string): Promise<T>;
|
|
935
1056
|
|
|
936
1057
|
export { }
|