blob: 3b3379a929d38472909c067c4dfa5f930b2fbc63 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import { OVar } from "../jshelper/mod.ts";
import { EncodingProfile, JhlsMetadata } from "./jhls.d.ts";
export interface EncodingProfileExt extends EncodingProfile { id: number }
export class ProfileSelector {
profiles_video: EncodingProfileExt[] = []
profiles_audio: EncodingProfileExt[] = []
profiles_subtitles: EncodingProfileExt[] = []
constructor(private bandwidth: OVar<number>, private metadata: JhlsMetadata) {
for (let id = 0; id < metadata.extra_profiles.length; id++) {
const p = metadata.extra_profiles[id];
if (p.audio) this.profiles_audio.push({ id, ...p })
if (p.video) this.profiles_video.push({ id, ...p })
if (p.subtitles) this.profiles_subtitles.push({ id, ...p })
}
}
select_optimal_profile(track: number, profile: OVar<EncodingProfileExt>) {
// TODO
}
}
|