/*! * Copyright (c) 2025-present, Vanilagy and contributors * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { Frame } from 'node-av'; declare class BufferFrameResource { data: Uint8Array; layout: ComputedPlaneLayout[]; constructor(data: Uint8Array, layout: ComputedPlaneLayout[]); } export declare const getOpenVideoFrameCount: () => number; /** * A video frame in decoded form. * * Corresponds to the WebCodecs VideoFrame API. */ export declare class VideoFramePolyfill { /** @internal */ data: Frame | BufferFrameResource | null; private closed; /** * The pixel format of the frame, or null if closed. */ readonly format: VideoPixelFormat | null; /** * The width of the frame in pixels. */ readonly codedWidth: number; /** * The height of the frame in pixels. */ readonly codedHeight: number; /** * The coded rectangle, or null if unknown. */ readonly codedRect: DOMRectReadOnly | null; /** * The visible rectangle within the coded frame. */ readonly visibleRect: DOMRectReadOnly | null; /** * The display width in pixels after applying rotation and flip. */ readonly displayWidth: number; /** * The display height in pixels after applying rotation and flip. */ readonly displayHeight: number; /** * The rotation in degrees (0, 90, 180, or 270). */ readonly rotation: number; /** * Whether the frame is flipped horizontally. */ readonly flip: boolean; /** * The timestamp in integer microseconds. */ readonly timestamp: number; /** * The duration in integer microseconds, or null if not specified. */ readonly duration: number | null; /** * The color space of the frame. */ readonly colorSpace: VideoColorSpace; constructor(data: AllowSharedBufferSource, init: VideoFrameBufferInit); constructor(source: CanvasImageSource, init?: VideoFrameInit); constructor(data: Frame, init?: VideoFrameInit); private ensureNotClosed; /** * Returns the number of bytes needed to hold a copy of the frame's pixel data. */ allocationSize(options?: VideoFrameCopyToOptions): number; /** * Copies the frame's pixel data to a destination buffer. Returns the layout of the planes in the destination * buffer. */ copyTo(destination: AllowSharedBufferSource, options?: VideoFrameCopyToOptions): Promise; /** * Creates a copy of this frame. */ clone(): VideoFramePolyfill; /** * Closes the frame and releases all resources. */ close(): void; } type ComputedPlaneLayout = { destinationOffset: number; destinationStride: number; sourceTop: number; sourceHeight: number; sourceLeftBytes: number; sourceWidthBytes: number; }; export {};