import type { EncodedPacket, DecodedFrame, Unsubscribe } from './stream-broker.js';
import type { FrameFormat } from '../types/io.js';
export interface DecoderSessionConfig {
    readonly codec: string;
    readonly maxFps: number;
    readonly outputFormat: FrameFormat;
    readonly scale: number;
    /** Source stream width — passed to decoder so it doesn't need to probe raw pipes */
    readonly width?: number;
    /** Source stream height — passed to decoder so it doesn't need to probe raw pipes */
    readonly height?: number;
    /**
     * Identifier of the camera this decoder session serves. Optional —
     * the cap is generic, but stream-broker passes it so decoder logs
     * include `deviceId` for per-camera filtering.
     */
    readonly deviceId?: number;
    /**
     * Free-form tag for log scoping (e.g. `broker:5/high`). Decoder
     * sessions surface it on every log line so a single camera profile
     * can be greps cleanly out of a fleet of brokers.
     */
    readonly tag?: string;
}
export interface DecoderStats {
    readonly inputFps: number;
    readonly outputFps: number;
    readonly avgDecodeTimeMs: number;
    readonly droppedFrames: number;
}
export interface IDecoderSession {
    /** Push an encoded packet for decoding (push mode — used by ffmpeg decoder) */
    pushPacket(packet: EncodedPacket): void;
    /** Open an RTSP stream directly for decoding (pull mode — used by node-av decoder) */
    openStream?(url: string): Promise<void>;
    /** Whether this session uses pull mode (opens RTSP directly instead of receiving packets) */
    readonly isPullMode?: boolean;
    /** Subscribe to decoded frames */
    onFrame(callback: (frame: DecodedFrame) => void): Unsubscribe;
    updateConfig(config: Partial<DecoderSessionConfig>): void;
    destroy(): Promise<void>;
    getStats(): DecoderStats;
}
export interface IDecoderProvider {
    readonly id: string;
    readonly name: string;
    /**
     * Lookup priority — lower values are preferred when multiple decoders
     * support the same codec. Hardware-accelerated decoders (e.g. node-av
     * with VideoToolbox) should use a low number (e.g. 10); software
     * decoders (e.g. ffmpeg child process) should use a high number
     * (e.g. 50, the default). The broker sorts by priority ascending.
     */
    readonly priority?: number;
    supportsCodec(input: {
        codec: string;
    }): Promise<boolean>;
    createSession(config: DecoderSessionConfig): Promise<IDecoderSession>;
    /** Whether this provider creates pull-mode sessions (open RTSP directly) */
    readonly isPullMode?: boolean;
}
//# sourceMappingURL=decoder.d.ts.map