aboutsummaryrefslogtreecommitdiff
path: root/stream/types/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-03-04 17:52:03 +0100
committermetamuffin <metamuffin@disroot.org>2026-03-04 17:52:03 +0100
commit7ded052e22df1be30b29a2943b2bbe9196152a2d (patch)
tree1c6aae6e342101c78dd97f304ab2868ee7e2665d /stream/types/src
parent3eaba0353512ee6ebb909722fde931136b44a4f8 (diff)
downloadjellything-7ded052e22df1be30b29a2943b2bbe9196152a2d.tar
jellything-7ded052e22df1be30b29a2943b2bbe9196152a2d.tar.bz2
jellything-7ded052e22df1be30b29a2943b2bbe9196152a2d.tar.zst
move codec parameter string code in remuxer; init frag for transcodes
Diffstat (limited to 'stream/types/src')
-rw-r--r--stream/types/src/lib.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/stream/types/src/lib.rs b/stream/types/src/lib.rs
index 433b757..50227ec 100644
--- a/stream/types/src/lib.rs
+++ b/stream/types/src/lib.rs
@@ -139,13 +139,16 @@ pub enum StreamContainer {
}
impl StreamContainer {
- pub fn mime_type(&self) -> &'static str {
- match self {
- Self::WebM => "video/webm",
- Self::Matroska => "video/x-matroska",
- Self::WebVTT => "text/vtt",
- Self::JVTT => "application/jellything-vtt+json",
- Self::MPEG4 => "video/mp4",
+ pub fn mime_type(&self, kind: TrackKind) -> &'static str {
+ match (self, kind) {
+ (Self::WebM, TrackKind::Audio) => "audio/webm",
+ (Self::WebM, _) => "video/webm",
+ (Self::Matroska, TrackKind::Audio) => "audio/x-matroska",
+ (Self::Matroska, _) => "video/x-matroska",
+ (Self::MPEG4, TrackKind::Audio) => "audio/mp4",
+ (Self::MPEG4, _) => "video/mp4",
+ (Self::WebVTT, _) => "text/vtt",
+ (Self::JVTT, _) => "application/jellything-vtt+json",
}
}
}