Skip to content

Commit 7cd16b3

Browse files
committed
Add spec references
1 parent 6842f8e commit 7cd16b3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mp4parse/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,8 @@ fn read_infe<T: Read>(src: &mut BMFFBox<T>) -> Result<ItemInfoEntry> {
15181518
Ok(ItemInfoEntry { item_id, item_type })
15191519
}
15201520

1521+
/// Parse an Item Reference Box
1522+
/// See ISO 14496-12:2015 § 8.11.12
15211523
fn read_iref<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<SingleItemTypeReferenceBox>> {
15221524
let mut item_references = TryVec::new();
15231525
let version = read_fullbox_version_no_flags(src)?;
@@ -1555,6 +1557,8 @@ fn read_iref<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<SingleItemTypeRefer
15551557
Ok(item_references)
15561558
}
15571559

1560+
/// Parse an Item Properties Box
1561+
/// See ISO 23008-12:2017 § 9.3.1
15581562
fn read_iprp<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<AssociatedProperty>> {
15591563
let mut iter = src.box_iter();
15601564

@@ -1605,6 +1609,7 @@ fn read_iprp<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<AssociatedProperty>
16051609
Ok(associated)
16061610
}
16071611

1612+
/// See ISO 23008-12:2017 § 9.3.1
16081613
#[derive(Debug, PartialEq)]
16091614
pub enum ItemProperty {
16101615
Channels(TryVec<u8>),
@@ -1622,12 +1627,16 @@ impl TryClone for ItemProperty {
16221627
}
16231628
}
16241629

1630+
/// For storing ItemPropertyAssociation data
1631+
/// See ISO 23008-12:2017 § 9.3.1
16251632
struct Association {
16261633
item_id: u32,
16271634
essential: bool,
16281635
property_index: u16,
16291636
}
16301637

1638+
/// For storing ItemPropertiesBox data
1639+
/// See ISO 23008-12:2017 § 9.3.1
16311640
pub struct AssociatedProperty {
16321641
pub item_id: u32,
16331642
pub property: ItemProperty,
@@ -1663,6 +1672,8 @@ fn read_ipma<T: Read>(
16631672
Ok(associations)
16641673
}
16651674

1675+
/// Parse an ItemPropertyContainerBox
1676+
/// See ISO 23008-12:2017 § 9.3.1
16661677
fn read_ipco<T: Read>(src: &mut BMFFBox<T>) -> Result<TryHashMap<u16, ItemProperty>> {
16671678
let mut properties = TryHashMap::with_capacity(1)?;
16681679

@@ -1688,6 +1699,8 @@ fn read_ipco<T: Read>(src: &mut BMFFBox<T>) -> Result<TryHashMap<u16, ItemProper
16881699
Ok(properties)
16891700
}
16901701

1702+
/// Parse pixel information
1703+
/// See ISO 23008-12:2017 § 6.5.6
16911704
fn read_pixi<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<u8>> {
16921705
let version = read_fullbox_version_no_flags(src)?;
16931706
if version != 0 {
@@ -1706,6 +1719,7 @@ fn read_pixi<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<u8>> {
17061719
Ok(channels)
17071720
}
17081721

1722+
/// See ISO 23008-12:2017 § 6.5.8
17091723
#[derive(Debug, PartialEq)]
17101724
pub struct AuxiliaryTypeProperty {
17111725
aux_type: TryString,
@@ -1721,6 +1735,8 @@ impl TryClone for AuxiliaryTypeProperty {
17211735
}
17221736
}
17231737

1738+
/// Parse image properties for auxiliary images
1739+
/// See ISO 23008-12:2017 § 6.5.8
17241740
fn read_auxc<T: Read>(src: &mut BMFFBox<T>) -> Result<AuxiliaryTypeProperty> {
17251741
let version = read_fullbox_version_no_flags(src)?;
17261742
if version != 0 {

0 commit comments

Comments
 (0)