aboutsummaryrefslogtreecommitdiff
path: root/common/src/stream.rs
blob: 46f6abc8aff2bcea82fd9cb628db9c8e40d7bbb6 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2025 metamuffin <metamuffin.org>
*/
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Deserialize, Serialize)]
pub enum StreamSpec {
    Whep {
        track: u64,
        seek: u64,
    },
    WhepControl {
        token: String,
    },
    Remux {
        track: Vec<u64>,
        container: StreamContainer,
    },
    Original {
        track: u64,
    },
    HlsSuperMultiVariant {
        container: StreamContainer,
    },
    HlsMultiVariant {
        segment: u64,
        container: StreamContainer,
    },
    HlsVariant {
        segment: u64,
        track: u64,
        container: StreamContainer,
        format: usize,
    },
    Info {
        segment: Option<u64>,
    },
    FragmentIndex {
        segment: u64,
        track: u64,
    },
    Fragment {
        segment: u64,
        track: u64,
        index: u64,
        container: StreamContainer,
        format: usize,
    },
}

#[derive(Debug, Clone, Copy, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum StreamContainer {
    WebM,
    Matroska,
    WebVTT,
    JVTT,
}