Skip to content

Commit f7b9ed0

Browse files
baumanjkornelski
authored andcommitted
Rename to ItemProperty
1 parent 579c1e3 commit f7b9ed0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

mp4parse/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ pub fn read_avif<T: Read>(f: &mut T, context: &mut AvifContext) -> Result<()> {
12801280
meta.properties.iter().any(|prop| {
12811281
prop.item_id == item_id
12821282
&& match &prop.property {
1283-
ImageProperty::AuxiliaryType(urn) => {
1283+
ItemProperty::AuxiliaryType(urn) => {
12841284
urn.as_slice()
12851285
== "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha".as_bytes()
12861286
}
@@ -1563,7 +1563,7 @@ fn read_iprp<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<AssociatedProperty>
15631563
x => x as usize - 1,
15641564
};
15651565
if let Some(prop) = properties.get(index) {
1566-
if *prop != ImageProperty::Unsupported {
1566+
if *prop != ItemProperty::Unsupported {
15671567
associated.push(AssociatedProperty {
15681568
item_id: a.item_id,
15691569
property: prop.clone()?,
@@ -1575,13 +1575,13 @@ fn read_iprp<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<AssociatedProperty>
15751575
}
15761576

15771577
#[derive(Debug, PartialEq)]
1578-
pub enum ImageProperty {
1578+
pub enum ItemProperty {
15791579
Channels(TryVec<u8>),
15801580
AuxiliaryType(TryString),
15811581
Unsupported,
15821582
}
15831583

1584-
impl ImageProperty {
1584+
impl ItemProperty {
15851585
fn clone(&self) -> Result<Self> {
15861586
Ok(match self {
15871587
Self::Channels(val) => Self::Channels(val.try_clone()?),
@@ -1598,7 +1598,7 @@ struct Association {
15981598

15991599
pub struct AssociatedProperty {
16001600
pub item_id: u32,
1601-
pub property: ImageProperty,
1601+
pub property: ItemProperty,
16021602
}
16031603

16041604
fn read_ipma<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<Association>> {
@@ -1632,18 +1632,18 @@ fn read_ipma<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<Association>> {
16321632
Ok(associations)
16331633
}
16341634

1635-
fn read_ipco<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<ImageProperty>> {
1635+
fn read_ipco<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<ItemProperty>> {
16361636
let mut properties = TryVec::new();
16371637

16381638
let mut iter = src.box_iter();
16391639
while let Some(mut b) = iter.next_box()? {
16401640
// Must push for every property to have correct index for them
16411641
properties.push(match b.head.name {
1642-
BoxType::PixelInformationBox => ImageProperty::Channels(read_pixi(&mut b)?),
1643-
BoxType::AuxiliaryTypeProperty => ImageProperty::AuxiliaryType(read_auxc(&mut b)?),
1642+
BoxType::PixelInformationBox => ItemProperty::Channels(read_pixi(&mut b)?),
1643+
BoxType::AuxiliaryTypeProperty => ItemProperty::AuxiliaryType(read_auxc(&mut b)?),
16441644
_ => {
16451645
skip_box_remain(&mut b)?;
1646-
ImageProperty::Unsupported
1646+
ItemProperty::Unsupported
16471647
}
16481648
})?;
16491649
}

0 commit comments

Comments
 (0)