From 9e205e33a61d0268c35362740aa91ca459dbf428 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 30 Sep 2023 09:44:23 +0200 Subject: stream head + webm not a format anymore --- common/src/stream.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'common/src') diff --git a/common/src/stream.rs b/common/src/stream.rs index 3fb1008..ca09999 100644 --- a/common/src/stream.rs +++ b/common/src/stream.rs @@ -7,6 +7,7 @@ use serde::{Deserialize, Serialize}; pub struct StreamSpec { pub tracks: Vec, pub format: StreamFormat, + pub webm: Option, pub abr: Option, pub vbr: Option, pub index: Option, @@ -19,7 +20,6 @@ pub struct StreamSpec { pub enum StreamFormat { #[cfg_attr(feature = "rocket", field(value = "original"))] Original, #[cfg_attr(feature = "rocket", field(value = "matroska"))] Matroska, - #[cfg_attr(feature = "rocket", field(value = "webm"))] Webm, #[cfg_attr(feature = "rocket", field(value = "hls"))] Hls, #[cfg_attr(feature = "rocket", field(value = "jhls"))] Jhls, #[cfg_attr(feature = "rocket", field(value = "hlsseg"))] Segment, @@ -28,11 +28,12 @@ pub enum StreamFormat { impl Default for StreamSpec { fn default() -> Self { Self { - tracks: Default::default(), - format: StreamFormat::Webm, - abr: Default::default(), - vbr: Default::default(), - index: Default::default(), + tracks: Vec::new(), + format: StreamFormat::Matroska, + webm: Some(true), + abr: None, + vbr: None, + index: None, } } } @@ -64,6 +65,9 @@ impl StreamSpec { if let Some(index) = self.index { writeln!(u, "&index={index}").unwrap(); } + if let Some(webm) = self.webm { + writeln!(u, "&webmm={webm}").unwrap(); + } u } } @@ -73,7 +77,6 @@ impl StreamFormat { match self { StreamFormat::Original => "original", StreamFormat::Matroska => "matroska", - StreamFormat::Webm => "webm", StreamFormat::Hls => "hls", StreamFormat::Jhls => "jhls", StreamFormat::Segment => "hlsseg", -- cgit v1.2.3-70-g09d2