diff options
| author | Felix Kaaman <tmtu@tmtu.ee> | 2021-01-07 20:32:49 +0100 |
|---|---|---|
| committer | Felix Kaaman <tmtu@tmtu.ee> | 2021-01-07 20:32:49 +0100 |
| commit | 9e6e4962f2346a3fbd96ab3e6c331858ef6ec0d1 (patch) | |
| tree | 14b580295f71243def9c8df9c242c33f9f2c66a8 /src/boxes/dinf.rs | |
| download | fmp4-9e6e4962f2346a3fbd96ab3e6c331858ef6ec0d1.tar.gz fmp4-9e6e4962f2346a3fbd96ab3e6c331858ef6ec0d1.zip | |
Diffstat (limited to 'src/boxes/dinf.rs')
| -rw-r--r-- | src/boxes/dinf.rs | 26 |
1 files changed, 26 insertions, 0 deletions
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(()) + } +} |
