aboutsummaryrefslogtreecommitdiff
path: root/common/src/lib.rs
blob: a75f5991341096cc9af62793cf85c753b7650607 (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
pub mod r#impl;

use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct DirectoryInfo {
    pub name: String,
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ItemInfo {
    pub title: String,
    pub duration: f64, // in seconds
    pub tracks: BTreeMap<u64, SourceTrack>,
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SourceTrack {
    pub kind: SourceTrackKind,
    pub name: String,
    pub codec: String,
    pub language: String,
}

#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SourceTrackKind {
    Video {
        width: u64,
        height: u64,
        fps: f64,
    },
    Audio {
        channels: usize,
        sample_rate: f64,
        bit_depth: usize,
    },
    Subtitles,
}