Skip to content

Commit da2cb93

Browse files
authored
Merge pull request mozilla#193 from mozilla/avif-pitm
Add basic AVIF parsing support
2 parents bbb4a12 + 9246ad6 commit da2cb93

File tree

17 files changed

+960
-240
lines changed

17 files changed

+960
-240
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "mp4parse/av1-avif"]
2+
path = mp4parse/av1-avif
3+
url = https://github.com/AOMediaCodec/av1-avif.git

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ env:
1515

1616
script:
1717
- cargo test --all --verbose $RELEASE
18+
# We cannot run `cargo test` with the mp4parse_infallible feature enabled
19+
# (see comment where the feature is defined in mp4parse_capi/Cargo.toml),
20+
# but we can at least check for changes behind features that would break the
21+
# build. Also note that we can't run `cargo check` before `cargo test` or
22+
# else it breaks `build_ffi_test` for complicated reasons.
23+
# See https://github.com/mozilla/mp4parse-rust/issues/197
24+
- cargo check --all --verbose $RELEASE --tests --all-features
1825
- cargo doc --package mp4parse_capi

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ overflow-checks = true
99

1010
[profile.bench]
1111
overflow-checks = true
12+
13+
# Uncomment below to test local changes to mp4parse_fallible crate
14+
# [patch.crates-io]
15+
# mp4parse_fallible = { path = "../mp4parse_fallible" }

mp4parse/Cargo.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = [
55
"Ralph Giles <[email protected]>",
66
"Matthew Gregan <[email protected]>",
77
"Alfredo Yang <[email protected]>",
8+
"Jon Bauman <[email protected]>",
89
]
910

1011
description = "Parser for ISO base media file format (mp4)"
@@ -24,16 +25,13 @@ travis-ci = { repository = "https://github.com/mozilla/mp4parse-rust" }
2425

2526
[dependencies]
2627
byteorder = "1.2.1"
27-
afl = { version = "0.3", optional = true }
2828
abort_on_panic = { version = "1.0.0", optional = true }
29-
bitreader = { version = "0.3.0" }
29+
bitreader = { version = "0.3.2" }
3030
num-traits = "0.2.0"
31-
mp4parse_fallible = { version = "0.0.1", optional = true }
31+
mp4parse_fallible = { version = "0.0.3", optional = true }
3232
log = "0.4"
3333
static_assertions = "1.1.0"
3434

3535
[dev-dependencies]
3636
test-assembler = "0.1.2"
37-
38-
[features]
39-
fuzz = ["afl", "abort_on_panic"]
37+
env_logger = "0.7.1"

mp4parse/av1-avif

Submodule av1-avif added at 560a973

mp4parse/src/boxes.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ impl fmt::Display for FourCC {
9494

9595
box_database!(
9696
FileTypeBox 0x6674_7970, // "ftyp"
97+
MediaDataBox 0x6d64_6174, // "mdat"
98+
PrimaryItemBox 0x7069_746d, // "pitm"
99+
ItemInfoBox 0x6969_6e66, // "iinf"
100+
ItemInfoEntry 0x696e_6665, // "infe"
101+
ItemLocationBox 0x696c_6f63, // "iloc"
97102
MovieBox 0x6d6f_6f76, // "moov"
98103
MovieHeaderBox 0x6d76_6864, // "mvhd"
99104
TrackBox 0x7472_616b, // "trak"
@@ -135,7 +140,7 @@ box_database!(
135140
ProtectionSystemSpecificHeaderBox 0x7073_7368, // "pssh"
136141
SchemeInformationBox 0x7363_6869, // "schi"
137142
TrackEncryptionBox 0x7465_6e63, // "tenc"
138-
ProtectionSchemeInformationBox 0x7369_6e66, // "sinf"
143+
ProtectionSchemeInfoBox 0x7369_6e66, // "sinf"
139144
OriginalFormatBox 0x6672_6d61, // "frma"
140145
SchemeTypeBox 0x7363_686d, // "schm"
141146
MP3AudioSampleEntry 0x2e6d_7033, // ".mp3" - from F4V.
@@ -149,7 +154,6 @@ box_database!(
149154
MetadataItemListEntry 0x696c_7374, // "ilst"
150155
MetadataItemDataEntry 0x6461_7461, // "data"
151156
MetadataItemNameBox 0x6e61_6d65, // "name"
152-
MetadataItemInformationBox 0x6974_6966, // "itif"
153157
UserdataBox 0x7564_7461, // "udta"
154158
AlbumEntry 0xa961_6c62, // "©alb"
155159
ArtistEntry 0xa941_5254, // "©ART"

0 commit comments

Comments
 (0)