aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'common/src')
-rw-r--r--common/src/helpers.rs5
-rw-r--r--common/src/lib.rs14
-rw-r--r--common/src/stream.rs12
3 files changed, 30 insertions, 1 deletions
diff --git a/common/src/helpers.rs b/common/src/helpers.rs
index 5150667..86072cc 100644
--- a/common/src/helpers.rs
+++ b/common/src/helpers.rs
@@ -1,3 +1,8 @@
+/*
+ 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) 2023 metamuffin <metamuffin.org>
+*/
use std::ops::Deref;
#[derive(PartialEq, PartialOrd)]
diff --git a/common/src/lib.rs b/common/src/lib.rs
index b7f975a..d57d2c0 100644
--- a/common/src/lib.rs
+++ b/common/src/lib.rs
@@ -140,9 +140,13 @@ pub enum SourceTrackKind {
Subtitles,
}
+pub const SEEK_INDEX_VERSION: u32 = 0x5eef1de4;
+
#[derive(Debug, Clone, Decode, Encode)]
pub struct SeekIndex {
+ pub version: u32,
pub blocks: Vec<BlockIndex>,
+ pub keyframes: Vec<usize>,
}
#[derive(Debug, Clone, Decode, Encode)]
@@ -151,3 +155,13 @@ pub struct BlockIndex {
pub source_off: usize,
pub size: usize,
}
+
+impl Default for SeekIndex {
+ fn default() -> Self {
+ Self {
+ version: SEEK_INDEX_VERSION,
+ blocks: Vec::new(),
+ keyframes: Vec::new(),
+ }
+ }
+}
diff --git a/common/src/stream.rs b/common/src/stream.rs
index ca09999..af19062 100644
--- a/common/src/stream.rs
+++ b/common/src/stream.rs
@@ -1,3 +1,8 @@
+/*
+ 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) 2023 metamuffin <metamuffin.org>
+*/
#[cfg(feature = "rocket")]
use rocket::{FromForm, FromFormField, UriDisplayQuery};
use serde::{Deserialize, Serialize};
@@ -10,6 +15,7 @@ pub struct StreamSpec {
pub webm: Option<bool>,
pub abr: Option<usize>,
pub vbr: Option<usize>,
+ pub width: Option<usize>,
pub index: Option<usize>,
}
@@ -31,6 +37,7 @@ impl Default for StreamSpec {
tracks: Vec::new(),
format: StreamFormat::Matroska,
webm: Some(true),
+ width: None,
abr: None,
vbr: None,
index: None,
@@ -66,7 +73,10 @@ impl StreamSpec {
writeln!(u, "&index={index}").unwrap();
}
if let Some(webm) = self.webm {
- writeln!(u, "&webmm={webm}").unwrap();
+ writeln!(u, "&webm={webm}").unwrap();
+ }
+ if let Some(width) = self.width {
+ writeln!(u, "&width={width}").unwrap();
}
u
}