/** * Parse HLS (m3u8) and DASH (mpd) manifests into a normalized summary the * correlation engine can reason about: declared codecs, container/segment * format, DRM signaling, and segment durations. * * The manifest bytes can come from three places (in priority order handled by * the caller): pasted `content`, an HTTP `url` fetch, or a response body that * was extracted from a Charles session entry. * * We intentionally do NOT validate against Roku's spec here — that judgment * lives in diagnose.ts so the spec data stays in one (dated, cited) place. */ export type StreamFormat = 'hls' | 'dash'; /** A normalized DRM signal found in the manifest. */ export interface ManifestDrmSignal { /** Widevine | PlayReady | AES-128 | ClearKey | Verimatrix | FairPlay | unknown */ system: string; /** The raw schemeIdUri (DASH) or KEYFORMAT/METHOD (HLS) we matched on. */ raw: string; /** DASH only: whether a was present (helps Roku start faster). */ hasPssh?: boolean; } /** A single video/audio rendition declared by the manifest. */ export interface ManifestTrack { type: 'video' | 'audio' | 'muxed' | 'unknown'; /** Raw codec string as declared, e.g. "avc1.640028,mp4a.40.2". */ codecs?: string; /** Friendly codec families we recognized, e.g. ["AVC", "AAC"]. */ codecFamilies: string[]; bandwidth?: number; resolution?: string; mimeType?: string; /** H.264/AVC level x10 (e.g. 51 = level 5.1), when derivable from the codec string. */ avcLevel?: number; /** HEVC level x10 (e.g. 61 = level 6.1), when derivable from the codec string. */ hevcLevel?: number; } export interface ManifestSummary { format: StreamFormat; /** Whether this looked like a master/multivariant playlist (HLS) or full MPD (DASH). */ isMultivariant: boolean; tracks: ManifestTrack[]; drm: ManifestDrmSignal[]; /** Container hint: "ts" | "fmp4" | "cmaf" | "mixed" | "unknown". */ container: string; /** Whether the container was observed from segment evidence (vs. defaulted). */ containerResolved?: boolean; /** Whether audio+video appear muxed in a single rendition. */ muxed: boolean; /** Max segment/target duration in seconds, if derivable. */ maxSegmentSeconds?: number; /** Whether the manifest is a live stream (DASH dynamic / HLS without ENDLIST). */ isLive: boolean; /** Distinct video codec families across all tracks. */ videoCodecs: string[]; /** Distinct audio codec families across all tracks. */ audioCodecs: string[]; /** Non-fatal notes about parsing (e.g. "media playlist; variants not analyzed"). */ notes: string[]; } export interface ManifestSource { /** Raw manifest text. */ content?: string; /** URL to fetch the manifest from (used only if content is absent). */ url?: string; /** Forced format; otherwise auto-detected. */ format?: StreamFormat; } /** * Extract the H.264/AVC level from an RFC 6381 codec string. * `avc1.PPCCLL` where LL is the level as a hex byte (e.g. `avc1.640033` -> 0x33 = 51 -> level 5.1). * Returns the level as an integer x10 (e.g. 51 means 5.1), or undefined. */ export declare function avcLevel(token: string): number | undefined; /** * Extract the HEVC level from an RFC 6381 codec string and return it x10. * `hvc1.A.B.LXXX.YY` where `LXXX` is the general_level_idc (e.g. L183). * level_idc = general_level * 30, so 183 -> 6.1 (returned as 61), 153 -> 5.1 (51), * 123 -> 4.1 (41). Returns level x10, or undefined. */ export declare function hevcLevel(token: string): number | undefined; /** Map a single codec token to a friendly family name. */ export declare function codecFamily(token: string): string | undefined; /** Auto-detect HLS vs DASH from text content and/or a URL. */ export declare function detectFormat(content: string | undefined, url: string | undefined, forced?: StreamFormat): StreamFormat; /** Fetch + parse a manifest from any of the supported sources. */ export declare function loadManifest(source: ManifestSource): Promise; /** Parse already-obtained manifest text. */ export declare function parseManifestText(content: string, format: StreamFormat): ManifestSummary; //# sourceMappingURL=manifest.d.ts.map