From: Kostya Shishkov Date: Wed, 25 Mar 2026 17:44:52 +0000 (+0100) Subject: nihav_registry: add functions for MOV fourcc look-up X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=01f5e2b73280a33d24d2681ac96df6cb169b778b;p=nihav.git nihav_registry: add functions for MOV fourcc look-up --- diff --git a/nihav-registry/src/register.rs b/nihav-registry/src/register.rs index 917ad10..dcb2103 100644 --- a/nihav-registry/src/register.rs +++ b/nihav-registry/src/register.rs @@ -556,6 +556,22 @@ pub fn find_codec_from_mov_audio_fourcc(fcc: &[u8;4]) -> Option<&'static str> { None } +/// Returns FOURCC (used in MOV format) for provided video codec name. +pub fn find_mov_video_fourcc(codecname: &str) -> Option<[u8; 4]> { + for (fourcc, name) in MOV_VIDEO_CODEC_REGISTER.iter() { + if *name == codecname { return Some(**fourcc); } + } + None +} + +/// Returns FOURCC (used in MOV format) for provided audio codec name. +pub fn find_mov_audio_fourcc(codecname: &str) -> Option<[u8; 4]> { + for (fourcc, name) in MOV_AUDIO_CODEC_REGISTER.iter() { + if *name == codecname { return Some(**fourcc); } + } + None +} + #[cfg(test)] mod test { use super::*;