1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-06-11 09:29:21 +00:00

wip(mp4box): bin adding box for opus

This commit is contained in:
Stuart Woodbury 2023-07-05 09:47:17 -04:00
parent 55875d72de
commit 6a6e746c3f
2 changed files with 35 additions and 1 deletions

View file

@ -86,6 +86,7 @@ pub(crate) mod mp4a;
pub(crate) mod mvex;
pub(crate) mod mvhd;
pub(crate) mod smhd;
pub(crate) mod soun;
pub(crate) mod stbl;
pub(crate) mod stco;
pub(crate) mod stsc;
@ -198,7 +199,8 @@ boxtype! {
DayBox => 0xa9646179,
CovrBox => 0x636f7672,
DescBox => 0x64657363,
WideBox => 0x77696465
WideBox => 0x77696465,
SounBox => 0x736F756E
}
pub trait Mp4Box: Sized {

32
src/mp4box/soun.rs Normal file
View file

@ -0,0 +1,32 @@
use serde::Serialize;
use crate::mp4box::*;
// for opus
// https://opus-codec.org/docs/opus_in_isobmff.html
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct SounBox {}
impl Default for SounBox {
fn default() -> Self {
Self {}
}
}
impl Mp4Box for SounBox {
fn box_type(&self) -> BoxType {
BoxType::SounBox
}
fn box_size(&self) -> u64 {
todo!()
}
fn to_json(&self) -> Result<String> {
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
}
fn summary(&self) -> Result<String> {
todo!()
}
}