pup-recorder 0.4.4 → 0.4.5

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.
@@ -10,7 +10,7 @@ import type { Debugger } from 'electron';
10
10
  import { Demuxer } from 'node-av/api';
11
11
  import { EventEmitter } from 'node:events';
12
12
  import { FFAudioEncoder } from 'node-av/constants';
13
- import type { FFVideoEncoder } from 'node-av/constants';
13
+ import { FFVideoEncoder } from 'node-av/constants';
14
14
  import { Frame } from 'node-av';
15
15
  import { HardwareContext } from 'node-av/api';
16
16
  import { HardwareFramesContext } from 'node-av';
@@ -129,6 +129,18 @@ export declare class BitWriter {
129
129
  copy(src: number[], start: number, len: number): void;
130
130
  }
131
131
 
132
+ export declare const BLANK_WARN_RATIO = 0.5;
133
+
134
+ export declare class BlankFrameStats {
135
+ private readonly _width;
136
+ private readonly _height;
137
+ private _total;
138
+ private _blank;
139
+ constructor(width: number, height: number);
140
+ sample(frame: Buffer): void;
141
+ finalize(): number;
142
+ }
143
+
132
144
  export declare function buildAlphaChannelInfoSEI(): Buffer;
133
145
 
134
146
  /**
@@ -239,6 +251,7 @@ export declare class DecodeSession {
239
251
  private requestRestart;
240
252
  private pump;
241
253
  private decodePass;
254
+ private get demand();
242
255
  private pause;
243
256
  private untilRestart;
244
257
  private evict;
@@ -329,6 +342,8 @@ export declare interface EncoderPipelineOptions {
329
342
  disableHwCodec?: boolean;
330
343
  }
331
344
 
345
+ export declare function encodeStubWebm({ width, height, duration }: StubEncodeOptions): Promise<Buffer>;
346
+
332
347
  export declare type EnvParser<T> = (value: unknown) => T;
333
348
 
334
349
  export declare interface ErrorMsg {
@@ -342,6 +357,8 @@ export declare function exec(cmd: string, options?: SpawnOptions): ProcessHandle
342
357
 
343
358
  export declare function extractAlphaToYuv420pBuffer(bgraFrame: Frame, buf: Buffer): void;
344
359
 
360
+ export declare const FF_ENCODER_LIBVPX_VP9: FFVideoEncoder;
361
+
345
362
  export declare function fire(el: EventTarget, type: string): void;
346
363
 
347
364
  export declare function fitRect(srcW: number, srcH: number, dstW: number, dstH: number, fit: string): Vec4;
@@ -407,11 +424,15 @@ export declare class FrameDropStats {
407
424
  export declare class FrameServer {
408
425
  private readonly _useInnerProxy;
409
426
  private _sessions;
427
+ private _probes;
428
+ private _stubs;
410
429
  private _closed;
411
430
  constructor(_useInnerProxy: boolean);
412
431
  open(opts: OpenOptions): Promise<VideoMeta>;
432
+ stub(src: string): Promise<Buffer>;
413
433
  getFrame(id: string, idx: number): Promise<Buffer>;
414
434
  close(id: string): Promise<void>;
435
+ private probeCached;
415
436
  closeAll(): Promise<void>;
416
437
  }
417
438
 
@@ -453,6 +474,7 @@ export declare interface IpcDonePayload {
453
474
  written: number;
454
475
  jank: number;
455
476
  outFile: string;
477
+ blank: number;
456
478
  }
457
479
 
458
480
  export declare interface IpcEvents {
@@ -492,6 +514,8 @@ export declare class IpcWriter {
492
514
  private send;
493
515
  }
494
516
 
517
+ export declare function isBlankFrame(bgra: Buffer, width: number, height: number): boolean;
518
+
495
519
  export declare function isEmpty(image: NativeImage): boolean;
496
520
 
497
521
  declare class Lazy<T> {
@@ -594,7 +618,7 @@ export declare interface NetworkOptions {
594
618
  source: string;
595
619
  window: BrowserWindow;
596
620
  useInnerProxy?: boolean;
597
- cancelMedia?: boolean;
621
+ stubMedia?: boolean;
598
622
  }
599
623
 
600
624
  export declare function newVideoState(video: HTMLVideoElement, cv: HTMLCanvasElement): VideoState;
@@ -778,6 +802,7 @@ declare interface RenderResult {
778
802
  written: number;
779
803
  jank: number;
780
804
  outFile: string;
805
+ blank: number;
781
806
  }
782
807
  export { RenderResult }
783
808
  export { RenderResult as RenderResult_alias_1 }
@@ -837,7 +862,7 @@ export declare const SCHEME = "pup-frame://";
837
862
 
838
863
  export declare function send(cdp: Debugger, method: string, params?: object): Promise<unknown>;
839
864
 
840
- export declare function setInterceptor({ source, window, useInnerProxy, cancelMedia }: NetworkOptions): void;
865
+ export declare function setInterceptor({ source, window, useInnerProxy, stubMedia }: NetworkOptions): void;
841
866
 
842
867
  export declare function setupCanvas(video: HTMLVideoElement, snap: OffscreenCanvas | undefined): HTMLCanvasElement;
843
868
 
@@ -875,6 +900,12 @@ export declare const STEGO_TICK_CHANNEL = "stego-tick";
875
900
 
876
901
  export declare function stopStego(cdp: Debugger): Promise<unknown>;
877
902
 
903
+ export declare interface StubEncodeOptions {
904
+ width: number;
905
+ height: number;
906
+ duration: number;
907
+ }
908
+
878
909
  export declare function swapBuffer(wc: WebContents, expected: number, interval: number): Promise<void>;
879
910
 
880
911
  export declare function syncOverlay(video: HTMLVideoElement, cv: HTMLCanvasElement): void;