import type { StreamSourceEntry } from '../../device/camera-device.js';
export interface StreamMetadata {
    width?: number;
    height?: number;
    codec?: string;
    fps?: number;
    bitrateKbps?: number;
    /** Probed audio track. Undefined when stream carries no audio. */
    audio?: StreamAudioMetadata;
}
export interface StreamAudioMetadata {
    /** Codec name as reported by the demuxer (e.g. 'aac', 'pcm_mulaw', 'opus'). */
    codec?: string;
    /** Sample rate in Hz (e.g. 8000, 16000, 44100, 48000). */
    sampleRate?: number;
    /** Channel count (1 = mono, 2 = stereo). */
    channels?: number;
    /** Stated bitrate in kbps when the demuxer reports one. */
    bitrateKbps?: number;
    /** Codec profile/aac-mode (e.g. 'LC', 'HE-AAC') when known. */
    profile?: string;
}
export type StreamQuality = 'high' | 'mid' | 'low';
/** Friendly display labels for stream quality IDs. */
export declare const STREAM_QUALITY_LABELS: Readonly<Record<string, string>>;
/** Get a friendly label for a stream ID. Falls back to capitalised id. */
export declare function streamQualityLabel(id: string): string;
/**
 * Compute pixel count for sorting. Returns w*h, or 0 if unknown.
 */
export declare function streamPixels(meta: StreamMetadata): number;
/**
 * Classify streams relative to each other.
 * Highest resolution → high, lowest → low, everything else → mid.
 * With 1 stream: high. With 2: high + low.
 */
export declare function classifyStreams<T extends {
    metadata?: StreamMetadata;
}>(streams: readonly T[]): Array<T & {
    quality: StreamQuality;
}>;
/**
 * Classify a single stream in isolation (no relative context).
 * Use classifyStreams() when you have the full set.
 */
export declare function classifyStream(meta: StreamMetadata): StreamQuality;
export type StreamProtocolType = 'rtsp' | 'rtmp' | 'http' | 'flv' | 'rtp' | 'raw';
export interface StreamProtocol {
    type: StreamProtocolType;
    /** Source URL. undefined for 'raw' (push-based, e.g. Reolink Baichuan). */
    url?: string;
}
export interface AvailableStream {
    /** Unique identifier within the device (e.g. 'main', 'sub', 'ch0_0') */
    id: string;
    /** Ways to consume this stream */
    protocols: StreamProtocol[];
    /** Probed or provider-declared stream characteristics */
    metadata?: StreamMetadata;
    /** Computed from metadata via classifyStream() */
    quality: StreamQuality;
    /** Optional display hint */
    label?: string;
}
/** Convert AvailableStream to StreamSourceEntry for stream-broker consumers. */
export declare function toStreamSourceEntry(stream: AvailableStream): StreamSourceEntry;
/** A single stream entry in device settings. */
export interface CameraStreamEntry {
    readonly url: string;
    readonly label?: string;
}
export interface CameraStreamConfig {
    readonly streams: readonly CameraStreamEntry[];
    /**
     * Snapshot source URL (JPEG).
     * Used internally by the provider to implement ICamera.getSnapshot().
     * Clients should call snapshot.getSnapshot() instead of hitting this URL directly.
     */
    readonly snapshot_url?: string;
}
/** Extract CameraStreamConfig from untyped settings record. */
export declare function parseCameraStreamConfig(raw: Record<string, unknown>): CameraStreamConfig;
/**
 * Per-device mapping of quality profile → streamId.
 * Cameras expose N physical streams; the user assigns which stream
 * serves each of the 3 standard CamStack profiles.
 */
export interface StreamProfileMap {
    high?: string;
    mid?: string;
    low?: string;
}
/**
 * Auto-assign profiles based on quality classification.
 * With 1 stream: all profiles point to it.
 * With 2: high + low. With 3+: high + mid + low.
 */
export declare function autoAssignProfiles(streams: readonly AvailableStream[]): StreamProfileMap;
//# sourceMappingURL=camera.d.ts.map