From 9e6e4962f2346a3fbd96ab3e6c331858ef6ec0d1 Mon Sep 17 00:00:00 2001 From: Felix Kaaman Date: Thu, 7 Jan 2021 20:32:49 +0100 Subject: Initial commit --- src/boxes/dinf.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/boxes/dinf.rs (limited to 'src/boxes/dinf.rs') diff --git a/src/boxes/dinf.rs b/src/boxes/dinf.rs new file mode 100644 index 0000000..cff0f64 --- /dev/null +++ b/src/boxes/dinf.rs @@ -0,0 +1,26 @@ +use four_cc::FourCC; + +use bytes::BytesMut; + +use crate::Mp4Box; +use crate::Mp4BoxError; + +use super::DataReferenceBox; + +pub struct DataInformationBox { + pub dref: DataReferenceBox, +} + +impl Mp4Box for DataInformationBox { + const NAME: FourCC = FourCC(*b"dinf"); + + fn content_size(&self) -> u64 { + self.dref.size() + } + + fn write_box_contents(&self, writer: &mut BytesMut) -> Result<(), Mp4BoxError> { + self.dref.write(writer)?; + + Ok(()) + } +} -- cgit v1.2.3-70-g09d2