From 30e3d18c6ec50572365baaaaa3542769e82e763a Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 30 Sep 2023 15:21:57 +0200 Subject: move some files around for new remuxer + small changes --- common/src/helpers.rs | 5 +++++ common/src/lib.rs | 14 ++++++++++++++ common/src/stream.rs | 12 +++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'common/src') 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 +*/ 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, + pub keyframes: Vec, } #[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 +*/ #[cfg(feature = "rocket")] use rocket::{FromForm, FromFormField, UriDisplayQuery}; use serde::{Deserialize, Serialize}; @@ -10,6 +15,7 @@ pub struct StreamSpec { pub webm: Option, pub abr: Option, pub vbr: Option, + pub width: Option, pub index: Option, } @@ -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 } -- cgit v1.2.3-70-g09d2