From 7ded052e22df1be30b29a2943b2bbe9196152a2d Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 4 Mar 2026 17:52:03 +0100 Subject: move codec parameter string code in remuxer; init frag for transcodes --- stream/types/src/lib.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'stream/types/src') 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", } } } -- cgit v1.3