diff options
author | metamuffin <metamuffin@disroot.org> | 2023-10-02 20:02:06 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-10-02 20:02:06 +0200 |
commit | e25beb3e0c2531b09d8efd70e858396dcc631dd2 (patch) | |
tree | 917189b7e5e5363c830fbdabcb416e16623a6438 /common/src | |
parent | 839c1e1490e7cd856e6ada1dcfd82f3d4505c89c (diff) | |
download | jellything-e25beb3e0c2531b09d8efd70e858396dcc631dd2.tar jellything-e25beb3e0c2531b09d8efd70e858396dcc631dd2.tar.bz2 jellything-e25beb3e0c2531b09d8efd70e858396dcc631dd2.tar.zst |
add profiles to jhls
Diffstat (limited to 'common/src')
-rw-r--r-- | common/src/config.rs | 5 | ||||
-rw-r--r-- | common/src/jhls.rs | 20 | ||||
-rw-r--r-- | common/src/lib.rs | 19 |
3 files changed, 23 insertions, 21 deletions
diff --git a/common/src/config.rs b/common/src/config.rs index e30e70b..2666d17 100644 --- a/common/src/config.rs +++ b/common/src/config.rs @@ -4,7 +4,7 @@ Copyright (C) 2023 metamuffin <metamuffin.org> */ -use crate::{user::PermissionSet, EncodingProfile}; +use crate::{jhls::EncodingProfile, user::PermissionSet}; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, path::PathBuf}; @@ -30,9 +30,10 @@ pub struct GlobalConfig { } mod default { - use crate::EncodingProfile; use std::path::PathBuf; + use crate::jhls::EncodingProfile; + pub fn admin_username() -> String { "admin".into() } diff --git a/common/src/jhls.rs b/common/src/jhls.rs index 306161f..e3ef23c 100644 --- a/common/src/jhls.rs +++ b/common/src/jhls.rs @@ -5,6 +5,7 @@ use std::ops::Range; #[derive(Debug, Clone, Deserialize, Serialize)] pub struct JhlsMetadata { pub duration: f64, + pub extra_profiles: Vec<EncodingProfile>, pub tracks: Vec<JhlsTrack>, } @@ -13,3 +14,22 @@ 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, + }, +} diff --git a/common/src/lib.rs b/common/src/lib.rs index 6d1a78c..c425c21 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -142,22 +142,3 @@ pub enum SourceTrackKind { }, Subtitles, } - -#[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, - }, -} |