pup-recorder 0.4.4 → 0.4.6
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 +4 -4
- package/dist/app.cjs +6 -31
- package/dist/{chunk-UC6U2DFE.js → chunk-LQ5XNASZ.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/index.js +2 -2
- package/dist/runtime/iframe_preload.cjs +2 -2
- package/package.json +3 -3
- package/tsconfig.json +3 -2
- package/dist/_tsup-dts-rollup.d.ts +0 -1077
- package/dist/index.d.ts +0 -24
- /package/dist/{cli.d.ts → build.d.ts} +0 -0
|
@@ -1,1077 +0,0 @@
|
|
|
1
|
-
import { AV_SAMPLE_FMT_FLT } from 'node-av/constants';
|
|
2
|
-
import { AV_SAMPLE_FMT_FLTP } from 'node-av/constants';
|
|
3
|
-
import { AVColorRange } from 'node-av/constants';
|
|
4
|
-
import { AVPixelFormat } from 'node-av/constants';
|
|
5
|
-
import { BrowserWindow } from 'electron';
|
|
6
|
-
import { ChildProcess } from 'node:child_process';
|
|
7
|
-
import { Codec } from 'node-av';
|
|
8
|
-
import { CodecContext } from 'node-av';
|
|
9
|
-
import type { Debugger } from 'electron';
|
|
10
|
-
import { Demuxer } from 'node-av/api';
|
|
11
|
-
import { EventEmitter } from 'node:events';
|
|
12
|
-
import { FFAudioEncoder } from 'node-av/constants';
|
|
13
|
-
import type { FFVideoEncoder } from 'node-av/constants';
|
|
14
|
-
import { Frame } from 'node-av';
|
|
15
|
-
import { HardwareContext } from 'node-av/api';
|
|
16
|
-
import { HardwareFramesContext } from 'node-av';
|
|
17
|
-
import type { NativeImage } from 'electron';
|
|
18
|
-
import { Packet } from 'node-av';
|
|
19
|
-
import type { Size } from 'electron';
|
|
20
|
-
import { SoftwareScaleContext } from 'node-av';
|
|
21
|
-
import { SpawnOptions } from 'node:child_process';
|
|
22
|
-
import { Stream } from 'node-av';
|
|
23
|
-
import type { WebContents } from 'electron';
|
|
24
|
-
import type { WebFrameMain } from 'electron';
|
|
25
|
-
import z from 'zod';
|
|
26
|
-
|
|
27
|
-
export declare function abortable<T>(p: Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
28
|
-
|
|
29
|
-
/** Insert emulation prevention bytes (00 00 03) for Annex B compliance. */
|
|
30
|
-
export declare function addEmulationPrevention(nal: Buffer): Buffer;
|
|
31
|
-
|
|
32
|
-
export declare function advance(hook: VideoHook, timestampMs: number): Promise<unknown>;
|
|
33
|
-
|
|
34
|
-
export declare interface AdvanceOptions {
|
|
35
|
-
frame: WebFrameMain | undefined;
|
|
36
|
-
timestampMs: number;
|
|
37
|
-
signal?: AbortSignal;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export declare function advanceVideos({ frame, timestampMs, signal }: AdvanceOptions): Promise<void>;
|
|
41
|
-
|
|
42
|
-
export declare function advanceVirtualTime(cdp: Debugger, budget: number): Promise<void>;
|
|
43
|
-
|
|
44
|
-
export declare const AHEAD = 10;
|
|
45
|
-
|
|
46
|
-
export declare const ANNEX_B_START_CODE: Buffer<ArrayBuffer>;
|
|
47
|
-
|
|
48
|
-
export declare interface AttachArgs {
|
|
49
|
-
video: HTMLVideoElement;
|
|
50
|
-
state: VideoState;
|
|
51
|
-
src: string;
|
|
52
|
-
birthMs: number;
|
|
53
|
-
native: boolean;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export declare function attachAudioListeners({ wc, encoder, getVideoTimeMs, onError }: AudioListenerOptions): AudioDisposal;
|
|
57
|
-
|
|
58
|
-
export declare const AUDIO_CHUNK_CHANNEL = "audio-chunk";
|
|
59
|
-
|
|
60
|
-
export declare const AUDIO_META_CHANNEL = "audio-meta";
|
|
61
|
-
|
|
62
|
-
export declare type AudioDisposal = () => void;
|
|
63
|
-
|
|
64
|
-
declare class AudioEncoder_2 implements Disposable {
|
|
65
|
-
private _ctx;
|
|
66
|
-
private _stream;
|
|
67
|
-
private _pkt;
|
|
68
|
-
private _outRate;
|
|
69
|
-
private _outFmt;
|
|
70
|
-
private _frameSize;
|
|
71
|
-
private _filterFrame;
|
|
72
|
-
private _graph?;
|
|
73
|
-
private _bufSrc?;
|
|
74
|
-
private _bufSink?;
|
|
75
|
-
private _inRate?;
|
|
76
|
-
private _pts;
|
|
77
|
-
private constructor();
|
|
78
|
-
static create(opts: AudioEncoderOptions): Promise<AudioEncoder_2>;
|
|
79
|
-
setInputRate(inSampleRate: number): void;
|
|
80
|
-
encode(pcm: Buffer, muxer: FormatMuxer): Promise<void>;
|
|
81
|
-
flush(muxer: FormatMuxer): Promise<void>;
|
|
82
|
-
[Symbol.dispose](): void;
|
|
83
|
-
private drain;
|
|
84
|
-
private drainCodec;
|
|
85
|
-
}
|
|
86
|
-
export { AudioEncoder_2 as AudioEncoder }
|
|
87
|
-
|
|
88
|
-
export declare interface AudioEncoderOptions {
|
|
89
|
-
outSampleRate: number;
|
|
90
|
-
outSampleFmt: typeof AV_SAMPLE_FMT_FLT | typeof AV_SAMPLE_FMT_FLTP;
|
|
91
|
-
codecName: FFAudioEncoder;
|
|
92
|
-
globalHeader: boolean;
|
|
93
|
-
bitrate: number;
|
|
94
|
-
muxer: FormatMuxer;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export declare interface AudioListenerOptions {
|
|
98
|
-
wc: WebContents;
|
|
99
|
-
encoder: EncoderPipeline;
|
|
100
|
-
getVideoTimeMs: () => number;
|
|
101
|
-
onError: (error: Error) => void;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
declare function barLogger(bar: ProgressBar): LoggerLike;
|
|
105
|
-
export { barLogger }
|
|
106
|
-
export { barLogger as barLogger_alias_1 }
|
|
107
|
-
|
|
108
|
-
declare interface BarOptions {
|
|
109
|
-
total: number;
|
|
110
|
-
out: NodeJS.WriteStream;
|
|
111
|
-
showCount?: boolean;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export declare class BitReader {
|
|
115
|
-
private _bits;
|
|
116
|
-
pos: number;
|
|
117
|
-
constructor(data: Buffer);
|
|
118
|
-
get bits(): number[];
|
|
119
|
-
read(n: number): number;
|
|
120
|
-
readUe(): number;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export declare class BitWriter {
|
|
124
|
-
bits: number[];
|
|
125
|
-
w(val: number, n: number): void;
|
|
126
|
-
flag(val: boolean | number): void;
|
|
127
|
-
ue(val: number): void;
|
|
128
|
-
align(pad: number): void;
|
|
129
|
-
copy(src: number[], start: number, len: number): void;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export declare function buildAlphaChannelInfoSEI(): Buffer;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Build a complete alpha VPS from scratch, using the original NVENC VPS
|
|
136
|
-
* only as a source for the PTL (profile/tier/level) bytes.
|
|
137
|
-
* Matches x265 4.1 ENABLE_ALPHA VPS structure.
|
|
138
|
-
*/
|
|
139
|
-
export declare function buildAlphaVPS(vpsData: Buffer, width: number, height: number): Buffer;
|
|
140
|
-
|
|
141
|
-
export declare function buildStegoHTML(targetURL: string, size: Size): string;
|
|
142
|
-
|
|
143
|
-
export declare function buildUnifiedExtradata(opts: UnifiedExtradataOptions): Buffer;
|
|
144
|
-
|
|
145
|
-
export declare interface CancelMsg {
|
|
146
|
-
type: IpcMsgType.Cancel;
|
|
147
|
-
reason?: string;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export declare const canIUseGPU: Promise<boolean>;
|
|
151
|
-
|
|
152
|
-
export declare function checkHTML(source: string): void;
|
|
153
|
-
|
|
154
|
-
export declare function chromiumOptions(disableGpu: boolean): Promise<string[]>;
|
|
155
|
-
|
|
156
|
-
export declare interface CLIOptions {
|
|
157
|
-
name: string;
|
|
158
|
-
run: (source: string, options: RenderOptions) => Promise<unknown>;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
declare class CodecState_2 implements Disposable {
|
|
162
|
-
readonly src: Frame;
|
|
163
|
-
readonly dst: Frame;
|
|
164
|
-
readonly pkt: Packet;
|
|
165
|
-
private _sws?;
|
|
166
|
-
private _png?;
|
|
167
|
-
static create(width: number, height: number): Promise<CodecState_2>;
|
|
168
|
-
private constructor();
|
|
169
|
-
/**
|
|
170
|
-
* Create a fresh PNG decoder context.
|
|
171
|
-
* The FFmpeg PNG decoder accumulates APNG blending state
|
|
172
|
-
* across frames, so a shared instance corrupts output when decoding standalone PNGs.
|
|
173
|
-
*/
|
|
174
|
-
png(): Promise<CodecContext>;
|
|
175
|
-
decodePNG(pngData: Buffer): Promise<Frame>;
|
|
176
|
-
get sws(): SoftwareScaleContext;
|
|
177
|
-
[Symbol.dispose](): void;
|
|
178
|
-
}
|
|
179
|
-
export { CodecState_2 as CodecState }
|
|
180
|
-
|
|
181
|
-
export declare class ConcurrencyLimiter {
|
|
182
|
-
readonly maxConcurrency: number;
|
|
183
|
-
private _active;
|
|
184
|
-
private _queue;
|
|
185
|
-
private _signals;
|
|
186
|
-
private _resolve?;
|
|
187
|
-
constructor(maxConcurrency: number);
|
|
188
|
-
get active(): number;
|
|
189
|
-
get pending(): number;
|
|
190
|
-
get stats(): string;
|
|
191
|
-
schedule<T>(fn: () => Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
192
|
-
drain(): Promise<void>;
|
|
193
|
-
private flush;
|
|
194
|
-
private next;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export declare type ConsoleCallback = (level: string, message: string) => void;
|
|
198
|
-
|
|
199
|
-
export declare interface ConsoleMsg {
|
|
200
|
-
type: IpcMsgType.Console;
|
|
201
|
-
level: string;
|
|
202
|
-
message: string;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export declare function createHwVideoEncoder(opts: HwVideoFactoryOptions, muxer: FormatMuxer): Promise<VideoSetup>;
|
|
206
|
-
|
|
207
|
-
export declare function createStegoURL(src: string, size: Size): string;
|
|
208
|
-
|
|
209
|
-
export declare function debounce<T extends (...args: unknown[]) => void>(fn: T, delay?: number): T;
|
|
210
|
-
|
|
211
|
-
export declare interface DecodedFrame {
|
|
212
|
-
idx: number;
|
|
213
|
-
buf: Buffer;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export declare function decodeFrames(src: string, meta: VideoMeta, signal: AbortSignal): AsyncGenerator<DecodedFrame>;
|
|
217
|
-
|
|
218
|
-
export declare class DecodeSession {
|
|
219
|
-
readonly meta: VideoMeta;
|
|
220
|
-
private readonly _src;
|
|
221
|
-
private _buf;
|
|
222
|
-
private _ready;
|
|
223
|
-
private _want;
|
|
224
|
-
private _done;
|
|
225
|
-
private _closed;
|
|
226
|
-
private _gen;
|
|
227
|
-
private _ctrl;
|
|
228
|
-
private _waiters;
|
|
229
|
-
private _resume;
|
|
230
|
-
private _restart;
|
|
231
|
-
private readonly _leadFrames;
|
|
232
|
-
private readonly _keepCount;
|
|
233
|
-
private readonly _pumpDone;
|
|
234
|
-
constructor(meta: VideoMeta, _src: string);
|
|
235
|
-
getFrame(idx: number): Promise<Buffer>;
|
|
236
|
-
close(): Promise<void>;
|
|
237
|
-
private wait;
|
|
238
|
-
private wake;
|
|
239
|
-
private requestRestart;
|
|
240
|
-
private pump;
|
|
241
|
-
private decodePass;
|
|
242
|
-
private pause;
|
|
243
|
-
private untilRestart;
|
|
244
|
-
private evict;
|
|
245
|
-
private drainWaiters;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export declare function decodeStego(bitmap: Buffer, size: Size): number | undefined;
|
|
249
|
-
|
|
250
|
-
declare const DEFAULT_DURATION = 5;
|
|
251
|
-
export { DEFAULT_DURATION }
|
|
252
|
-
export { DEFAULT_DURATION as DEFAULT_DURATION_alias_1 }
|
|
253
|
-
|
|
254
|
-
declare const DEFAULT_FPS = 30;
|
|
255
|
-
export { DEFAULT_FPS }
|
|
256
|
-
export { DEFAULT_FPS as DEFAULT_FPS_alias_1 }
|
|
257
|
-
|
|
258
|
-
declare const DEFAULT_HEIGHT = 1080;
|
|
259
|
-
export { DEFAULT_HEIGHT }
|
|
260
|
-
export { DEFAULT_HEIGHT as DEFAULT_HEIGHT_alias_1 }
|
|
261
|
-
|
|
262
|
-
export declare const DEFAULT_OUT_FILE = "out/html.mp4,out/html.webm";
|
|
263
|
-
|
|
264
|
-
declare const DEFAULT_WIDTH = 1920;
|
|
265
|
-
export { DEFAULT_WIDTH }
|
|
266
|
-
export { DEFAULT_WIDTH as DEFAULT_WIDTH_alias_1 }
|
|
267
|
-
|
|
268
|
-
declare const DEFAULT_WINDOW_TIMEOUT = 10;
|
|
269
|
-
export { DEFAULT_WINDOW_TIMEOUT }
|
|
270
|
-
export { DEFAULT_WINDOW_TIMEOUT as DEFAULT_WINDOW_TIMEOUT_alias_1 }
|
|
271
|
-
|
|
272
|
-
export declare const defaultRenderOptions: RenderOptions;
|
|
273
|
-
|
|
274
|
-
export declare function disposeWindow(win: BrowserWindow): Promise<void>;
|
|
275
|
-
|
|
276
|
-
export declare interface DoneMsg {
|
|
277
|
-
type: IpcMsgType.Done;
|
|
278
|
-
payload: IpcDonePayload;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
export declare function drainPackets(ctx: CodecContext, pkt: Packet, stream: Stream, muxer: FormatMuxer): Promise<void>;
|
|
282
|
-
|
|
283
|
-
export declare class DualLayerMux {
|
|
284
|
-
private _s;
|
|
285
|
-
private _baseQueue;
|
|
286
|
-
private _alphaQueue;
|
|
287
|
-
constructor(s: DualLayerMuxOptions);
|
|
288
|
-
drain(muxer: FormatMuxer): Promise<void>;
|
|
289
|
-
desyncAfterEof(): string | undefined;
|
|
290
|
-
private receiveAll;
|
|
291
|
-
private snapshot;
|
|
292
|
-
private writePair;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export declare interface DualLayerMuxOptions {
|
|
296
|
-
baseCtx: CodecContext;
|
|
297
|
-
alphaCtx: CodecContext;
|
|
298
|
-
basePkt: Packet;
|
|
299
|
-
alphaPkt: Packet;
|
|
300
|
-
stream: Stream;
|
|
301
|
-
hevcCfg: NvencHevcConfig;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export declare function electronOpts(disableGpu: boolean): Promise<string[]>;
|
|
305
|
-
|
|
306
|
-
export declare function encodeNalHeader(type: number, layerId: number, temporalId: number): [number, number];
|
|
307
|
-
|
|
308
|
-
export declare class EncoderPipeline {
|
|
309
|
-
private _s;
|
|
310
|
-
private _disposed;
|
|
311
|
-
private constructor();
|
|
312
|
-
static create(opts: EncoderPipelineOptions): Promise<EncoderPipeline>;
|
|
313
|
-
setupAudio(sampleRate: number): void;
|
|
314
|
-
encodeBGRA(input: Buffer): Promise<void>;
|
|
315
|
-
encodePNG(pngData: Buffer): Promise<void>;
|
|
316
|
-
encodeAudio(pcm: Buffer): Promise<void>;
|
|
317
|
-
finish(): Promise<string[]>;
|
|
318
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
319
|
-
private free;
|
|
320
|
-
private bgraFrame;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
export declare interface EncoderPipelineOptions {
|
|
324
|
-
width: number;
|
|
325
|
-
height: number;
|
|
326
|
-
fps: number;
|
|
327
|
-
outFile: string;
|
|
328
|
-
withAudio?: boolean;
|
|
329
|
-
disableHwCodec?: boolean;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export declare type EnvParser<T> = (value: unknown) => T;
|
|
333
|
-
|
|
334
|
-
export declare interface ErrorMsg {
|
|
335
|
-
type: IpcMsgType.Error;
|
|
336
|
-
error: string;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export declare function evalIn(cdp: Debugger, expression: string): Promise<unknown>;
|
|
340
|
-
|
|
341
|
-
export declare function exec(cmd: string, options?: SpawnOptions): ProcessHandle;
|
|
342
|
-
|
|
343
|
-
export declare function extractAlphaToYuv420pBuffer(bgraFrame: Frame, buf: Buffer): void;
|
|
344
|
-
|
|
345
|
-
export declare function fire(el: EventTarget, type: string): void;
|
|
346
|
-
|
|
347
|
-
export declare function fitRect(srcW: number, srcH: number, dstW: number, dstH: number, fit: string): Vec4;
|
|
348
|
-
|
|
349
|
-
export declare class FormatMuxer {
|
|
350
|
-
private readonly _ctx;
|
|
351
|
-
private _opened;
|
|
352
|
-
private _disposed;
|
|
353
|
-
constructor(outPath: string, formatName?: string);
|
|
354
|
-
addStream(codecCtx: CodecContext, codecTag?: string): Stream;
|
|
355
|
-
open(): Promise<void>;
|
|
356
|
-
writePacket(pkt: Packet): Promise<void>;
|
|
357
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export declare const FRAME_SYNC_MARKER_HEIGHT = 1;
|
|
361
|
-
|
|
362
|
-
export declare const FRAME_SYNC_MARKER_WIDTH = 32;
|
|
363
|
-
|
|
364
|
-
export declare class FrameCache {
|
|
365
|
-
private _caches;
|
|
366
|
-
cacheOf(id: string): VideoCache;
|
|
367
|
-
fetch(state: VideoState, idx: number): Promise<ImageBitmap | undefined>;
|
|
368
|
-
prefetch(state: VideoState, fromIdx: number, count: number): void;
|
|
369
|
-
evict(c: VideoCache): void;
|
|
370
|
-
release(id: string, state: VideoState): void;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
export declare type FrameCb = (now: number, meta: VideoFrameMeta) => void;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Frame drop quality score (0 = perfect, 1 = worst).
|
|
377
|
-
*
|
|
378
|
-
* Combines two dimensions:
|
|
379
|
-
* - Global: overall drop rate across the timeline
|
|
380
|
-
* - Local: perceptual severity of consecutive drops (bursts)
|
|
381
|
-
*
|
|
382
|
-
* Uses complementary multiplication: score = 1 - (1-g)(1-l)
|
|
383
|
-
*/
|
|
384
|
-
export declare interface FrameDropScore {
|
|
385
|
-
global: number;
|
|
386
|
-
local: number;
|
|
387
|
-
jank: number;
|
|
388
|
-
expected: number;
|
|
389
|
-
actual: number;
|
|
390
|
-
maxBurst: number;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
export declare class FrameDropStats {
|
|
394
|
-
private readonly _fps;
|
|
395
|
-
private _actual;
|
|
396
|
-
private _currentBurst;
|
|
397
|
-
private _bursts;
|
|
398
|
-
constructor(fps: number);
|
|
399
|
-
/** Call when a frame is actually written to the encoder. */
|
|
400
|
-
wrote(count?: number): void;
|
|
401
|
-
/** Call when a frame is dropped. */
|
|
402
|
-
dropped(count?: number): void;
|
|
403
|
-
/** Finalize and return the score. */
|
|
404
|
-
finalize(): FrameDropScore;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
export declare class FrameServer {
|
|
408
|
-
private readonly _useInnerProxy;
|
|
409
|
-
private _sessions;
|
|
410
|
-
private _closed;
|
|
411
|
-
constructor(_useInnerProxy: boolean);
|
|
412
|
-
open(opts: OpenOptions): Promise<VideoMeta>;
|
|
413
|
-
getFrame(id: string, idx: number): Promise<Buffer>;
|
|
414
|
-
close(id: string): Promise<void>;
|
|
415
|
-
closeAll(): Promise<void>;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export declare const HAVE_ENOUGH_DATA = 4;
|
|
419
|
-
|
|
420
|
-
export declare const HAVE_METADATA = 1;
|
|
421
|
-
|
|
422
|
-
export declare const HAVE_NOTHING = 0;
|
|
423
|
-
|
|
424
|
-
export declare type HwEncoder = VideoToolboxEncoder | NvencDualLayerEncoder;
|
|
425
|
-
|
|
426
|
-
export declare interface HwVideoEncoderOptions {
|
|
427
|
-
width: number;
|
|
428
|
-
height: number;
|
|
429
|
-
fps: number;
|
|
430
|
-
hw: HardwareContext;
|
|
431
|
-
bitrate: number;
|
|
432
|
-
muxer: FormatMuxer;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
export declare interface HwVideoFactoryOptions {
|
|
436
|
-
width: number;
|
|
437
|
-
height: number;
|
|
438
|
-
fps: number;
|
|
439
|
-
bitrate?: number;
|
|
440
|
-
disableHwCodec?: boolean;
|
|
441
|
-
sharedHw?: HardwareContext;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
export declare function installMediaShim(hook: VideoHook): void;
|
|
445
|
-
|
|
446
|
-
export declare function installTickHook(): void;
|
|
447
|
-
|
|
448
|
-
export declare function installVideoHook(): void;
|
|
449
|
-
|
|
450
|
-
export declare function interleaveAccessUnits(baseNals: NalUnit[], alphaNals: NalUnit[], cfg: NvencHevcConfig): Buffer;
|
|
451
|
-
|
|
452
|
-
export declare interface IpcDonePayload {
|
|
453
|
-
written: number;
|
|
454
|
-
jank: number;
|
|
455
|
-
outFile: string;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
export declare interface IpcEvents {
|
|
459
|
-
progress: [value: number];
|
|
460
|
-
console: [level: string, msg: string];
|
|
461
|
-
done: [payload: IpcDonePayload];
|
|
462
|
-
error: [error: Error];
|
|
463
|
-
close: [code: number | null];
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
export declare type IpcMsg = ConsoleMsg | ProgressMsg | DoneMsg | ErrorMsg | CancelMsg;
|
|
467
|
-
|
|
468
|
-
export declare enum IpcMsgType {
|
|
469
|
-
Console = "console",
|
|
470
|
-
Progress = "progress",
|
|
471
|
-
Done = "done",
|
|
472
|
-
Error = "error",
|
|
473
|
-
Cancel = "cancel"
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
export declare class IpcReader extends EventEmitter<IpcEvents> {
|
|
477
|
-
constructor(child: ChildProcess);
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
export declare interface IPCRenderOptions extends RenderOptions {
|
|
481
|
-
source: string;
|
|
482
|
-
signal: AbortSignal;
|
|
483
|
-
onProgress: ProgressCallback;
|
|
484
|
-
onConsole: ConsoleCallback;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
export declare class IpcWriter {
|
|
488
|
-
writeConsole(level: string, message: string): void;
|
|
489
|
-
writeProgress(value: number): void;
|
|
490
|
-
writeError(error: string): Promise<void>;
|
|
491
|
-
writeDone(payload: IpcDonePayload): Promise<void>;
|
|
492
|
-
private send;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
export declare function isEmpty(image: NativeImage): boolean;
|
|
496
|
-
|
|
497
|
-
declare class Lazy<T> {
|
|
498
|
-
readonly makeValue: () => T;
|
|
499
|
-
constructor(makeValue: () => T);
|
|
500
|
-
get value(): T;
|
|
501
|
-
get initialized(): boolean;
|
|
502
|
-
private _initialized;
|
|
503
|
-
private _value;
|
|
504
|
-
}
|
|
505
|
-
export { Lazy }
|
|
506
|
-
export { Lazy as Lazy_alias_1 }
|
|
507
|
-
|
|
508
|
-
export declare function loadWindow({ source, renderer, onCreated, signal }: WindowOptions): Promise<BrowserWindow>;
|
|
509
|
-
|
|
510
|
-
declare class Logger implements LoggerLike {
|
|
511
|
-
private _level;
|
|
512
|
-
private _impl?;
|
|
513
|
-
get level(): number;
|
|
514
|
-
set level(value: number);
|
|
515
|
-
get impl(): LoggerLike | undefined;
|
|
516
|
-
set impl(value: LoggerLike);
|
|
517
|
-
constructor(_level?: number);
|
|
518
|
-
debug(...messages: unknown[]): void;
|
|
519
|
-
info(...messages: unknown[]): void;
|
|
520
|
-
warn(...messages: unknown[]): void;
|
|
521
|
-
error(...messages: unknown[]): void;
|
|
522
|
-
fatal(...messages: unknown[]): void;
|
|
523
|
-
private dispatch;
|
|
524
|
-
attach(proc: ChildProcess, name: string): Promise<void>;
|
|
525
|
-
}
|
|
526
|
-
export { Logger }
|
|
527
|
-
export { Logger as Logger_alias_1 }
|
|
528
|
-
|
|
529
|
-
declare const logger: Logger;
|
|
530
|
-
export { logger }
|
|
531
|
-
export { logger as logger_alias_1 }
|
|
532
|
-
|
|
533
|
-
declare interface LoggerLike {
|
|
534
|
-
debug?(this: void, ...messages: unknown[]): void;
|
|
535
|
-
info?(this: void, ...messages: unknown[]): void;
|
|
536
|
-
warn?(this: void, ...messages: unknown[]): void;
|
|
537
|
-
error?(this: void, ...messages: unknown[]): void;
|
|
538
|
-
}
|
|
539
|
-
export { LoggerLike }
|
|
540
|
-
export { LoggerLike as LoggerLike_alias_1 }
|
|
541
|
-
|
|
542
|
-
export declare function makeCLI(options: CLIOptions): Promise<void>;
|
|
543
|
-
|
|
544
|
-
export declare function makeFrame(width: number, height: number, pixFmt: AVPixelFormat): Frame;
|
|
545
|
-
|
|
546
|
-
export declare function makePacket(): Packet;
|
|
547
|
-
|
|
548
|
-
export declare const MAX_RENDER_ATTEMPTS = 3;
|
|
549
|
-
|
|
550
|
-
export declare const MEDIA_ERR_DECODE = 3;
|
|
551
|
-
|
|
552
|
-
export declare const MEDIA_ERR_NETWORK = 2;
|
|
553
|
-
|
|
554
|
-
export declare interface MediaErrorLike {
|
|
555
|
-
code: number;
|
|
556
|
-
message: string;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
export declare const NAL_BLA_W_LP = 16;
|
|
560
|
-
|
|
561
|
-
export declare const NAL_HEADER_SIZE = 2;
|
|
562
|
-
|
|
563
|
-
export declare const NAL_IDR_N_LP = 20;
|
|
564
|
-
|
|
565
|
-
export declare const NAL_IDR_W_RADL = 19;
|
|
566
|
-
|
|
567
|
-
export declare const NAL_PPS = 34;
|
|
568
|
-
|
|
569
|
-
export declare const NAL_RSV_IRAP_VCL23 = 23;
|
|
570
|
-
|
|
571
|
-
export declare const NAL_SEI_PREFIX = 39;
|
|
572
|
-
|
|
573
|
-
export declare const NAL_SEI_SUFFIX = 40;
|
|
574
|
-
|
|
575
|
-
export declare const NAL_SPS = 33;
|
|
576
|
-
|
|
577
|
-
export declare const NAL_VPS = 32;
|
|
578
|
-
|
|
579
|
-
export declare interface NalUnit {
|
|
580
|
-
type: number;
|
|
581
|
-
layerId: number;
|
|
582
|
-
data: Buffer;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
export declare const NETWORK_EMPTY = 0;
|
|
586
|
-
|
|
587
|
-
export declare const NETWORK_IDLE = 1;
|
|
588
|
-
|
|
589
|
-
export declare const NETWORK_LOADING = 2;
|
|
590
|
-
|
|
591
|
-
export declare const NETWORK_NO_SOURCE = 3;
|
|
592
|
-
|
|
593
|
-
export declare interface NetworkOptions {
|
|
594
|
-
source: string;
|
|
595
|
-
window: BrowserWindow;
|
|
596
|
-
useInnerProxy?: boolean;
|
|
597
|
-
cancelMedia?: boolean;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
export declare function newVideoState(video: HTMLVideoElement, cv: HTMLCanvasElement): VideoState;
|
|
601
|
-
|
|
602
|
-
declare function noerr<A extends unknown[], R, D>(fn: (...args: A) => R, defaultValue: D): (...args: A) => R | D;
|
|
603
|
-
export { noerr }
|
|
604
|
-
export { noerr as noerr_alias_1 }
|
|
605
|
-
|
|
606
|
-
export declare class NvencDualLayerEncoder implements Disposable {
|
|
607
|
-
private _s;
|
|
608
|
-
private _mux;
|
|
609
|
-
private _pts;
|
|
610
|
-
private constructor();
|
|
611
|
-
static create(opts: HwVideoEncoderOptions): Promise<NvencDualLayerEncoder>;
|
|
612
|
-
encode(bgraFrame: Frame, muxer: FormatMuxer): Promise<void>;
|
|
613
|
-
flush(muxer: FormatMuxer): Promise<void>;
|
|
614
|
-
[Symbol.dispose](): void;
|
|
615
|
-
private sendEof;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
export declare interface NvencHevcConfig {
|
|
619
|
-
log2MaxPocLsb: number;
|
|
620
|
-
numShortTermRefPicSets: number;
|
|
621
|
-
numDeltaPocsSet0: number;
|
|
622
|
-
longTermRefPicsPresent: boolean;
|
|
623
|
-
spsTemporalMvpEnabled: boolean;
|
|
624
|
-
saoEnabled: boolean;
|
|
625
|
-
cabacInitPresent: boolean;
|
|
626
|
-
ppsHasLoopFilterAcrossSlicesFlag: boolean;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
export declare function openInput(src: string, signal?: AbortSignal): Promise<Demuxer>;
|
|
630
|
-
|
|
631
|
-
export declare interface OpenOptions {
|
|
632
|
-
src: string;
|
|
633
|
-
fps: number;
|
|
634
|
-
/** Display-box pixels (canvas backing store); decode is downscaled to cover this, never upscaled. */
|
|
635
|
-
dstW?: number;
|
|
636
|
-
dstH?: number;
|
|
637
|
-
/** objectFit; "none" needs 1:1 native pixels so it skips downscale. */
|
|
638
|
-
fit?: string;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
export declare function openSession(hook: VideoHook, args: AttachArgs): Promise<VideoState | undefined>;
|
|
642
|
-
|
|
643
|
-
export declare function openVideoCtx(opts: VideoCtxOptions, label: string): Promise<CodecContext>;
|
|
644
|
-
|
|
645
|
-
export declare class OutputSink implements AsyncDisposable {
|
|
646
|
-
private _s;
|
|
647
|
-
private _disposed;
|
|
648
|
-
private constructor();
|
|
649
|
-
static kindFromPath(path: string): SinkKind;
|
|
650
|
-
static create(opts: SinkOptions): Promise<OutputSink>;
|
|
651
|
-
private static mp4Video;
|
|
652
|
-
private static webmVideo;
|
|
653
|
-
private static audioFor;
|
|
654
|
-
setInputRate(sampleRate: number): void;
|
|
655
|
-
encodeBGRA(bgraFrame: Frame): Promise<void>;
|
|
656
|
-
encodeDecodedFrame(src: Frame): Promise<void>;
|
|
657
|
-
encodeAudio(pcm: Buffer): Promise<void>;
|
|
658
|
-
flush(): Promise<void>;
|
|
659
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
660
|
-
private swEncode;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
export declare function packBits(bits: number[]): Buffer;
|
|
664
|
-
|
|
665
|
-
export declare function pargs(): string[];
|
|
666
|
-
|
|
667
|
-
declare function parseNumber(x: unknown): number;
|
|
668
|
-
export { parseNumber }
|
|
669
|
-
export { parseNumber as parseNumber_alias_1 }
|
|
670
|
-
|
|
671
|
-
export declare function parseNvencHevcConfig(extradata: Buffer): NvencHevcConfig;
|
|
672
|
-
|
|
673
|
-
export declare function parseString(x: unknown): string;
|
|
674
|
-
|
|
675
|
-
/** Patch every VPS/SPS NAL in an Annex B bitstream so PTL matches Apple/x265. */
|
|
676
|
-
export declare function patchHevcAlphaPtl(bitstream: Buffer): Buffer;
|
|
677
|
-
|
|
678
|
-
export declare function pauseVirtualTime(cdp: Debugger): Promise<void>;
|
|
679
|
-
|
|
680
|
-
declare function penv<T>(name: string, parser: EnvParser<T>, defaultValue: T): T;
|
|
681
|
-
|
|
682
|
-
declare function penv<T>(name: string, parser: EnvParser<T>, defaultValue?: T): T | undefined;
|
|
683
|
-
export { penv }
|
|
684
|
-
export { penv as penv_alias_1 }
|
|
685
|
-
|
|
686
|
-
declare function periodical(callback: (count: number) => Promise<number | undefined> | undefined, ms: number): () => void;
|
|
687
|
-
export { periodical }
|
|
688
|
-
export { periodical as periodical_alias_1 }
|
|
689
|
-
|
|
690
|
-
export declare function probe(src: string): Promise<ProbeResult>;
|
|
691
|
-
|
|
692
|
-
export declare interface ProbeResult {
|
|
693
|
-
width: number;
|
|
694
|
-
height: number;
|
|
695
|
-
duration: number;
|
|
696
|
-
/** PTS (s) of the first decodable frame; a corrupt/empty leading run is held on it, like Chrome. */
|
|
697
|
-
leadGap: number;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
export declare interface ProcessHandle {
|
|
701
|
-
process: ChildProcess;
|
|
702
|
-
wait: Promise<void>;
|
|
703
|
-
get killed(): boolean;
|
|
704
|
-
kill(): void;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
declare class ProgressBar {
|
|
708
|
-
private _written;
|
|
709
|
-
private _shown;
|
|
710
|
-
private readonly _total;
|
|
711
|
-
private readonly _out;
|
|
712
|
-
private readonly _tty;
|
|
713
|
-
private readonly _showCount;
|
|
714
|
-
constructor(opts: BarOptions);
|
|
715
|
-
get total(): number;
|
|
716
|
-
update(written: number): void;
|
|
717
|
-
updatePercent(pct: number): void;
|
|
718
|
-
clear(): void;
|
|
719
|
-
redraw(): void;
|
|
720
|
-
log(line: string): void;
|
|
721
|
-
finish(line: string): void;
|
|
722
|
-
private render;
|
|
723
|
-
}
|
|
724
|
-
export { ProgressBar }
|
|
725
|
-
export { ProgressBar as ProgressBar_alias_1 }
|
|
726
|
-
|
|
727
|
-
declare type ProgressCallback = (progress: number) => void;
|
|
728
|
-
export { ProgressCallback }
|
|
729
|
-
export { ProgressCallback as ProgressCallback_alias_1 }
|
|
730
|
-
|
|
731
|
-
export declare interface ProgressMsg {
|
|
732
|
-
type: IpcMsgType.Progress;
|
|
733
|
-
value: number;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
export declare function proxiedUrl(url: string): string;
|
|
737
|
-
|
|
738
|
-
declare function pup(source: string, options: Partial<PupOptions>): Promise<PupResult>;
|
|
739
|
-
export { pup }
|
|
740
|
-
export { pup as pup_alias_1 }
|
|
741
|
-
|
|
742
|
-
export declare const PUP_ARGS_KEY = "--pup-priv-args";
|
|
743
|
-
|
|
744
|
-
export declare const pupApp: string;
|
|
745
|
-
|
|
746
|
-
export declare const pupAudioPreload: string;
|
|
747
|
-
|
|
748
|
-
export declare const pupIframePreload: string;
|
|
749
|
-
|
|
750
|
-
export declare const pupLogLevel: number;
|
|
751
|
-
|
|
752
|
-
declare interface PupOptions extends Partial<RenderOptions> {
|
|
753
|
-
signal?: AbortSignal;
|
|
754
|
-
onProgress?: ProgressCallback;
|
|
755
|
-
onConsole?: ConsoleCallback;
|
|
756
|
-
}
|
|
757
|
-
export { PupOptions }
|
|
758
|
-
export { PupOptions as PupOptions_alias_1 }
|
|
759
|
-
|
|
760
|
-
export declare const pupPkgRoot: string;
|
|
761
|
-
|
|
762
|
-
declare interface PupResult extends RenderResult {
|
|
763
|
-
}
|
|
764
|
-
export { PupResult }
|
|
765
|
-
export { PupResult as PupResult_alias_1 }
|
|
766
|
-
|
|
767
|
-
/** Remove emulation prevention bytes (00 00 03 → 00 00) from RBSP. */
|
|
768
|
-
export declare function removeEmulationPrevention(data: Buffer): Buffer;
|
|
769
|
-
|
|
770
|
-
export declare function render(options: IPCRenderOptions): Promise<IpcDonePayload>;
|
|
771
|
-
|
|
772
|
-
declare type RenderOptions = z.infer<typeof renderSchema>;
|
|
773
|
-
export { RenderOptions }
|
|
774
|
-
export { RenderOptions as RenderOptions_alias_1 }
|
|
775
|
-
|
|
776
|
-
declare interface RenderResult {
|
|
777
|
-
options: RenderOptions;
|
|
778
|
-
written: number;
|
|
779
|
-
jank: number;
|
|
780
|
-
outFile: string;
|
|
781
|
-
}
|
|
782
|
-
export { RenderResult }
|
|
783
|
-
export { RenderResult as RenderResult_alias_1 }
|
|
784
|
-
|
|
785
|
-
export declare const renderSchema: z.ZodObject<{
|
|
786
|
-
duration: z.ZodNumber;
|
|
787
|
-
width: z.ZodNumber;
|
|
788
|
-
height: z.ZodNumber;
|
|
789
|
-
fps: z.ZodNumber;
|
|
790
|
-
withAudio: z.ZodBoolean;
|
|
791
|
-
outFile: z.ZodString;
|
|
792
|
-
useInnerProxy: z.ZodBoolean;
|
|
793
|
-
deterministic: z.ZodBoolean;
|
|
794
|
-
disableGpu: z.ZodBoolean;
|
|
795
|
-
disableHwCodec: z.ZodBoolean;
|
|
796
|
-
windowTolerant: z.ZodBoolean;
|
|
797
|
-
windowTimeout: z.ZodNumber;
|
|
798
|
-
}, z.core.$strip>;
|
|
799
|
-
|
|
800
|
-
export declare function resizeDrawable(cdp: Debugger, size: Size): Promise<void>;
|
|
801
|
-
|
|
802
|
-
declare interface RetryOptions<Args extends unknown[], Ret> {
|
|
803
|
-
fn: (...args: Args) => Promise<Ret>;
|
|
804
|
-
maxAttempts?: number;
|
|
805
|
-
timeout?: number;
|
|
806
|
-
signal?: AbortSignal;
|
|
807
|
-
}
|
|
808
|
-
export { RetryOptions }
|
|
809
|
-
export { RetryOptions as RetryOptions_alias_1 }
|
|
810
|
-
|
|
811
|
-
/** Alpha PPS: pps_pic_parameter_set_id 0 → 1, pps_seq_parameter_set_id 0 → 1. */
|
|
812
|
-
export declare function rewriteAlphaPps(pps: Buffer): Buffer;
|
|
813
|
-
|
|
814
|
-
/**
|
|
815
|
-
* Rewrite alpha slice header: slice_pic_parameter_set_id 0 → 1.
|
|
816
|
-
* The +2-bit shift is absorbed by emitting a fresh byte_alignment then appending the
|
|
817
|
-
* original CABAC slice_segment_data bytes verbatim. CABAC byte boundary is preserved.
|
|
818
|
-
*/
|
|
819
|
-
export declare function rewriteAlphaSliceHeader(slice: Buffer, nalType: number, cfg: NvencHevcConfig): Buffer;
|
|
820
|
-
|
|
821
|
-
/** Alpha SPS: sps_seq_parameter_set_id 0 → 1. */
|
|
822
|
-
export declare function rewriteAlphaSps(sps: Buffer): Buffer;
|
|
823
|
-
|
|
824
|
-
/** Rewrite nuh_layer_id in a NAL unit (returns copy). */
|
|
825
|
-
export declare function rewriteNalLayerId(nal: Buffer, layerId: number): Buffer;
|
|
826
|
-
|
|
827
|
-
/** Rewrite nal_unit_type in a NAL unit (returns copy). */
|
|
828
|
-
export declare function rewriteNalType(nal: Buffer, newType: number): Buffer;
|
|
829
|
-
|
|
830
|
-
export declare function runElectronApp({ args }: RunElectronAppOptions): Promise<ProcessHandle>;
|
|
831
|
-
|
|
832
|
-
export declare interface RunElectronAppOptions {
|
|
833
|
-
args: unknown[];
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
export declare const SCHEME = "pup-frame://";
|
|
837
|
-
|
|
838
|
-
export declare function send(cdp: Debugger, method: string, params?: object): Promise<unknown>;
|
|
839
|
-
|
|
840
|
-
export declare function setInterceptor({ source, window, useInnerProxy, cancelMedia }: NetworkOptions): void;
|
|
841
|
-
|
|
842
|
-
export declare function setupCanvas(video: HTMLVideoElement, snap: OffscreenCanvas | undefined): HTMLCanvasElement;
|
|
843
|
-
|
|
844
|
-
export declare function setupPupProtocol(): void;
|
|
845
|
-
|
|
846
|
-
export declare function shoot(options: IPCRenderOptions): Promise<IpcDonePayload>;
|
|
847
|
-
|
|
848
|
-
export declare type SinkKind = "mp4" | "webm";
|
|
849
|
-
|
|
850
|
-
export declare interface SinkOptions {
|
|
851
|
-
outFile: string;
|
|
852
|
-
kind: SinkKind;
|
|
853
|
-
width: number;
|
|
854
|
-
height: number;
|
|
855
|
-
fps: number;
|
|
856
|
-
withAudio: boolean;
|
|
857
|
-
disableHwCodec: boolean;
|
|
858
|
-
sharedHw?: HardwareContext;
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
export declare function sizeEquals(a: Size, b: Size): boolean;
|
|
862
|
-
|
|
863
|
-
declare function sleep(ms: number): Promise<void>;
|
|
864
|
-
export { sleep }
|
|
865
|
-
export { sleep as sleep_alias_1 }
|
|
866
|
-
|
|
867
|
-
/** Split Annex B bitstream into NAL units. */
|
|
868
|
-
export declare function splitNalUnits(bitstream: Buffer): NalUnit[];
|
|
869
|
-
|
|
870
|
-
export declare function startElectronCrashReporter(): void;
|
|
871
|
-
|
|
872
|
-
export declare function startStego(cdp: Debugger): Promise<unknown>;
|
|
873
|
-
|
|
874
|
-
export declare const STEGO_TICK_CHANNEL = "stego-tick";
|
|
875
|
-
|
|
876
|
-
export declare function stopStego(cdp: Debugger): Promise<unknown>;
|
|
877
|
-
|
|
878
|
-
export declare function swapBuffer(wc: WebContents, expected: number, interval: number): Promise<void>;
|
|
879
|
-
|
|
880
|
-
export declare function syncOverlay(video: HTMLVideoElement, cv: HTMLCanvasElement): void;
|
|
881
|
-
|
|
882
|
-
export declare const TAG = "[VideoHook]";
|
|
883
|
-
|
|
884
|
-
export declare function tick(args: AdvanceOptions): Promise<void>;
|
|
885
|
-
|
|
886
|
-
export declare const TICK_SYMBOL = "__pup_tick__";
|
|
887
|
-
|
|
888
|
-
export declare function timeRanges(end: number): TimeRangesLike;
|
|
889
|
-
|
|
890
|
-
export declare interface TimeRangesLike {
|
|
891
|
-
length: number;
|
|
892
|
-
start(i: number): number;
|
|
893
|
-
end(i: number): number;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
export declare interface UnifiedExtradataOptions {
|
|
897
|
-
baseExtradata: Buffer;
|
|
898
|
-
alphaExtradata: Buffer;
|
|
899
|
-
width: number;
|
|
900
|
-
height: number;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
export declare function unsetInterceptor(window: BrowserWindow): void;
|
|
904
|
-
|
|
905
|
-
export declare function useFrameProtocol(useInnerProxy: boolean): AsyncDisposable;
|
|
906
|
-
|
|
907
|
-
declare function useRetry<Args extends unknown[], Ret>({ fn, maxAttempts, timeout, signal, }: RetryOptions<Args, Ret>): (...args: Args) => Promise<Ret>;
|
|
908
|
-
export { useRetry }
|
|
909
|
-
export { useRetry as useRetry_alias_1 }
|
|
910
|
-
|
|
911
|
-
declare type Vec4 = [number, number, number, number];
|
|
912
|
-
|
|
913
|
-
export declare interface VideoCache {
|
|
914
|
-
bitmaps: Map<number, ImageBitmap>;
|
|
915
|
-
inFlight: Map<number, Promise<ImageBitmap | undefined>>;
|
|
916
|
-
readers: Map<VideoState, number>;
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
export declare interface VideoCtxOptions {
|
|
920
|
-
codec: Codec;
|
|
921
|
-
width: number;
|
|
922
|
-
height: number;
|
|
923
|
-
fps: number;
|
|
924
|
-
bitrate: number;
|
|
925
|
-
pixelFormat: AVPixelFormat;
|
|
926
|
-
codecTag?: string;
|
|
927
|
-
colorRange?: AVColorRange;
|
|
928
|
-
options?: Record<string, string>;
|
|
929
|
-
hwFramesCtx?: HardwareFramesContext;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
declare class VideoEncoder_2 implements Disposable {
|
|
933
|
-
private readonly _ctx;
|
|
934
|
-
private readonly _pkt;
|
|
935
|
-
private readonly _stream;
|
|
936
|
-
private _pts;
|
|
937
|
-
private constructor();
|
|
938
|
-
static create(opts: VideoEncoderOptions): Promise<VideoEncoder_2>;
|
|
939
|
-
encode(frame: Frame, muxer: FormatMuxer): Promise<void>;
|
|
940
|
-
flush(muxer: FormatMuxer): Promise<void>;
|
|
941
|
-
[Symbol.dispose](): void;
|
|
942
|
-
private drain;
|
|
943
|
-
}
|
|
944
|
-
export { VideoEncoder_2 as VideoEncoder }
|
|
945
|
-
|
|
946
|
-
export declare interface VideoEncoderOptions {
|
|
947
|
-
width: number;
|
|
948
|
-
height: number;
|
|
949
|
-
fps: number;
|
|
950
|
-
codecName: FFVideoEncoder;
|
|
951
|
-
codecTag?: string;
|
|
952
|
-
codecOpts: Record<string, string>;
|
|
953
|
-
bitrate: number;
|
|
954
|
-
pixelFormat: AVPixelFormat;
|
|
955
|
-
muxer: FormatMuxer;
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
export declare interface VideoFrameMeta {
|
|
959
|
-
presentationTime: number;
|
|
960
|
-
expectedDisplayTime: number;
|
|
961
|
-
width: number;
|
|
962
|
-
height: number;
|
|
963
|
-
mediaTime: number;
|
|
964
|
-
presentedFrames: number;
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
export declare class VideoHook {
|
|
968
|
-
readonly sessions: WeakMap<HTMLVideoElement, VideoState>;
|
|
969
|
-
readonly attaching: WeakMap<HTMLVideoElement, Promise<VideoState | undefined>>;
|
|
970
|
-
readonly opening: Set<Promise<unknown>>;
|
|
971
|
-
readonly cache: FrameCache;
|
|
972
|
-
rvfcSeq: number;
|
|
973
|
-
currMs: number;
|
|
974
|
-
private _lastSnapshot;
|
|
975
|
-
install(): void;
|
|
976
|
-
attach(video: HTMLVideoElement, native?: boolean): Promise<VideoState | undefined>;
|
|
977
|
-
ready(): Promise<void>;
|
|
978
|
-
resume(video: HTMLVideoElement, state: VideoState): void;
|
|
979
|
-
detach(video: HTMLVideoElement): void;
|
|
980
|
-
onSrcChange(video: HTMLVideoElement): void;
|
|
981
|
-
reattach(video: HTMLVideoElement, state: VideoState): void;
|
|
982
|
-
private scan;
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
export declare interface VideoMeta {
|
|
986
|
-
id: string;
|
|
987
|
-
/** Intrinsic source dimensions (reported as videoWidth/videoHeight). */
|
|
988
|
-
width: number;
|
|
989
|
-
height: number;
|
|
990
|
-
/** Decoded+scaled frame dimensions actually served (≤ source; capped to the display box). */
|
|
991
|
-
frameWidth: number;
|
|
992
|
-
frameHeight: number;
|
|
993
|
-
fps: number;
|
|
994
|
-
duration: number;
|
|
995
|
-
/** Seconds of corrupt/empty leading content held on the first decodable frame. */
|
|
996
|
-
leadGap: number;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
export declare interface VideoMeta_alias_1 {
|
|
1000
|
-
id: string;
|
|
1001
|
-
width: number;
|
|
1002
|
-
height: number;
|
|
1003
|
-
frameWidth: number;
|
|
1004
|
-
frameHeight: number;
|
|
1005
|
-
duration: number;
|
|
1006
|
-
fps: number;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
export declare interface VideoSetup {
|
|
1010
|
-
video?: VideoEncoder_2;
|
|
1011
|
-
hwVideo?: HwEncoder;
|
|
1012
|
-
codec?: CodecState_2;
|
|
1013
|
-
hw?: HardwareContext;
|
|
1014
|
-
ownsHw: boolean;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
export declare interface VideoState {
|
|
1018
|
-
meta?: VideoMeta_alias_1;
|
|
1019
|
-
cv: HTMLCanvasElement;
|
|
1020
|
-
ctx: CanvasRenderingContext2D;
|
|
1021
|
-
paused: boolean;
|
|
1022
|
-
currentTime: number;
|
|
1023
|
-
ended: boolean;
|
|
1024
|
-
lastDrawnIdx: number;
|
|
1025
|
-
dead: boolean;
|
|
1026
|
-
objectFit: string;
|
|
1027
|
-
readyState: number;
|
|
1028
|
-
networkState: number;
|
|
1029
|
-
seeking: boolean;
|
|
1030
|
-
waiting: boolean;
|
|
1031
|
-
error: MediaErrorLike | undefined;
|
|
1032
|
-
presentedFrames: number;
|
|
1033
|
-
maxReached: number;
|
|
1034
|
-
rvfc: Map<number, FrameCb>;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
export declare class VideoToolboxEncoder implements Disposable {
|
|
1038
|
-
private _ctx;
|
|
1039
|
-
private _pkt;
|
|
1040
|
-
private _stream;
|
|
1041
|
-
private _pts;
|
|
1042
|
-
private constructor();
|
|
1043
|
-
static create(opts: HwVideoEncoderOptions): Promise<VideoToolboxEncoder>;
|
|
1044
|
-
encode(bgraFrame: Frame, muxer: FormatMuxer): Promise<void>;
|
|
1045
|
-
flush(muxer: FormatMuxer): Promise<void>;
|
|
1046
|
-
[Symbol.dispose](): void;
|
|
1047
|
-
private drain;
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
export declare class WaitableEvent {
|
|
1051
|
-
private _promise?;
|
|
1052
|
-
private _resolve?;
|
|
1053
|
-
private _timeoutToken?;
|
|
1054
|
-
wait(options?: WaitOptions): Promise<void>;
|
|
1055
|
-
signal(): void;
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
export declare interface WaitOptions {
|
|
1059
|
-
timeout: number;
|
|
1060
|
-
onTimeout?: () => void;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
export declare type WindowCreatedCallback = (window: BrowserWindow) => void | Promise<void>;
|
|
1064
|
-
|
|
1065
|
-
export declare interface WindowOptions {
|
|
1066
|
-
source: string;
|
|
1067
|
-
renderer: IPCRenderOptions;
|
|
1068
|
-
tolerant?: boolean;
|
|
1069
|
-
onCreated?: WindowCreatedCallback;
|
|
1070
|
-
signal?: AbortSignal;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
export declare function withRerender<T>(signal: AbortSignal, action: () => Promise<T>): Promise<T>;
|
|
1074
|
-
|
|
1075
|
-
export declare function withTimeout<T>(p: Promise<T>, ms: number, label: string): Promise<T>;
|
|
1076
|
-
|
|
1077
|
-
export { }
|