diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/src/stream.rs | 17 |
1 files changed, 10 insertions, 7 deletions
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<usize>, pub format: StreamFormat, + pub webm: Option<bool>, pub abr: Option<usize>, pub vbr: Option<usize>, pub index: Option<usize>, @@ -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", |