The crate as crates.io publishes it, minus .cargo-ok, its Cargo.lock and data/testdata (13 MB of sample files only its own tests read). Not yet routed through [patch.crates-io]; the next commit is the patch.
25 lines
655 B
Rust
25 lines
655 B
Rust
// SPDX-License-Identifier: MIT
|
|
// Copyright 2020 Alfred Gutierrez
|
|
// Copyright 2021 Daniel Vogelbacher <daniel@chaospixel.com>
|
|
|
|
use super::{BoxHeader, FourCC, ReadBox, Result};
|
|
use serde::{Deserialize, Serialize};
|
|
use std::io::{Read, Seek, SeekFrom};
|
|
|
|
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
|
|
pub struct DinfBox {
|
|
pub header: BoxHeader,
|
|
}
|
|
|
|
impl DinfBox {
|
|
pub const TYP: FourCC = FourCC::with(['d', 'i', 'n', 'f']);
|
|
}
|
|
|
|
impl<R: Read + Seek> ReadBox<&mut R> for DinfBox {
|
|
fn read_box(reader: &mut R, header: BoxHeader) -> Result<Self> {
|
|
reader.seek(SeekFrom::Start(header.end_offset()))?;
|
|
|
|
Ok(Self { header })
|
|
}
|
|
}
|