/* 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) 2026 metamuffin */ use crate::codec_param::{av1::av1_codec_param, hevc::hevc_codec_param}; use winter_matroska::TrackEntry; mod av1; mod hevc; pub fn codec_param(te: &TrackEntry) -> String { let empty_cp = vec![]; let cp = te.codec_private.as_ref().unwrap_or(&empty_cp); match te.codec_id.as_str() { "A_AAC" => format!("mp4a.40.2"), // TODO "A_FLAC" => "flac".to_string(), "A_OPUS" => "opus".to_string(), "A_VORBIS" => "vorbis".to_string(), "V_AV1" => av1_codec_param(cp), "V_MPEG4/ISO/AVC" => format!("avc1.{:02x}{:02x}{:02x}", cp[1], cp[2], cp[3]), "V_MPEGH/ISO/HEVC" => hevc_codec_param(cp), "V_VP9" => "vp09.00.50.08".to_string(), // TODO x => todo!("{x:?}"), } }