aboutsummaryrefslogtreecommitdiffstats
path: root/src/boxes/dinf.rs
blob: cff0f649be1b95b79ee8ec01543b8e73e473ee1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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(())
    }
}