/*! * 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 { AVPixelFormat, AVCodecID, Codec, HardwareContext, AVSampleFormat } from 'node-av'; export declare function assert(x: unknown): asserts x; export declare const inferCodecFromCodecString: (codecString: string) => AVCodecID | null; export declare const getChannelLayout: (numChannels: number) => import("node-av").ChannelLayout; export declare const mapColorPrimaries: (primaries: string) => import("node-av").AVColorPrimaries | null; export declare const unmapColorPrimaries: (primaries: number) => "bt709" | "bt470bg" | "smpte170m" | "bt2020" | "smpte432" | null; export declare const mapTransferCharacteristics: (transfer: string) => import("node-av").AVColorTransferCharacteristic | null; export declare const unmapTransferCharacteristics: (transfer: number) => "bt709" | "smpte170m" | "iec61966-2-1" | "linear" | "pq" | "hlg" | null; export declare const mapMatrixCoefficients: (matrix: string) => import("node-av").AVColorSpace | null; export declare const unmapMatrixCoefficients: (matrix: number) => "bt709" | "bt470bg" | "smpte170m" | "rgb" | "bt2020-ncl" | null; export declare const toPixelFormat: (ffmpegPixelFormat: AVPixelFormat) => "I420" | "I420P10" | "I420P12" | "I420A" | "I420AP10" | "I422" | "I422P10" | "I422P12" | "I422A" | "I422AP10" | "I422AP12" | "I444" | "I444P10" | "I444P12" | "I444A" | "I444AP10" | "I444AP12" | "NV12" | "RGBA" | "RGBX" | "BGRA" | "BGRX" | null; export declare const fromPixelFormat: (pixelFormat: string) => AVPixelFormat; export declare const toAudioSampleFormat: (ffmpegSampleFormat: AVSampleFormat) => AudioSampleFormat | null; export declare const fromAudioSampleFormat: (sampleFormat: AudioSampleFormat) => AVSampleFormat; export declare const toUint8Array: (source: AllowSharedBufferSource) => Uint8Array; export declare const toDataView: (source: AllowSharedBufferSource) => DataView; export declare const promiseWithResolvers: () => { promise: Promise; resolve: (value: T) => void; reject: (reason: unknown) => void; }; export interface AsyncMutexLock extends Disposable { readonly pending: boolean; readonly ready: Promise | null; release(): void; } export declare class AsyncMutex { private locked; private resolverQueue; lock(): AsyncMutexLock; private createLock; private dispatch; } export declare class Bitstream { bytes: Uint8Array; /** Current offset in bits. */ pos: number; constructor(bytes: Uint8Array); seekToByte(byteOffset: number): void; private readBit; readBits(n: number): number; writeBits(n: number, value: number): void; readAlignedByte(): number; skipBits(n: number): void; getBitsLeft(): number; clone(): Bitstream; } /** Reads an exponential-Golomb universal code from a Bitstream. */ export declare const readExpGolomb: (bitstream: Bitstream) => number; /** Reads a signed exponential-Golomb universal code from a Bitstream. */ export declare const readSignedExpGolomb: (bitstream: Bitstream) => number; export declare const bytesToHexString: (bytes: Uint8Array) => string; export declare const reverseBitsU32: (x: number) => number; export declare const getHardwareContext: () => HardwareContext | null; export declare const getHardwareEncoderCodec: (codecId: AVCodecID) => Codec | null; export declare const getHardwareDecoderCodec: (codecId: AVCodecID) => Codec | null; export declare const clamp: (value: number, min: number, max: number) => number;