aboutsummaryrefslogtreecommitdiff
path: root/common/src/jhls.rs
blob: e3ef23c2545e28e27a635085d6d6c3aec40d8460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use crate::SourceTrack;
use serde::{Deserialize, Serialize};
use std::ops::Range;

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct JhlsMetadata {
    pub duration: f64,
    pub extra_profiles: Vec<EncodingProfile>,
    pub tracks: Vec<JhlsTrack>,
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct JhlsTrack {
    pub info: SourceTrack,
    pub segments: Vec<Range<f64>>,
}

#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum EncodingProfile {
    Video {
        codec: String,
        preset: u8,
        bitrate: usize,
        width: usize,
    },
    Audio {
        codec: String,
        bitrate: usize,
        sample_rate: Option<f64>,
    },
    Subtitles {
        codec: String,
    },
}