Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support EBML (Matroska, WebM) files #218

Draft
wants to merge 64 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
1587658
EBML: Stub implement `EbmlFile` and `EbmlTag`
Serial-ATA Jun 7, 2023
cc3bb81
Tests: Add a matroska test asset
Serial-ATA Jun 8, 2023
a37cd85
EBML: Fix warnings
Serial-ATA Jul 4, 2023
fbcd082
EBML: Support parsing VINTs
Serial-ATA Aug 5, 2023
3aa1fb4
Clippy
Serial-ATA Aug 5, 2023
eb435e8
Tests: Add files from official Matroska test suite
Serial-ATA Aug 6, 2023
d94ec8c
EBML: Implement reader/Parse the header for properties
Serial-ATA Sep 5, 2023
88538ad
Clippy: Ignore some new lints
Serial-ATA Sep 5, 2023
d472a88
lofty_attr: Add proc macro to define EBML master elements
Serial-ATA Nov 23, 2023
82acd9e
EBML: Make use of `max_id_length` when reading
Serial-ATA Nov 24, 2023
d700500
EBML: Properly parse element ID VInts
Serial-ATA Nov 25, 2023
10d1a31
EBML: Specify more master elements
Serial-ATA Nov 25, 2023
4ff820c
EBML: Support locking the `ElementReader` to the current master
Serial-ATA Nov 25, 2023
ca7e3fe
EBML: Stub implement Segment parsing
Serial-ATA Nov 25, 2023
f928d0a
EBML: Implement integer parsing
Serial-ATA Nov 25, 2023
2c86127
EBML: Implement string parsing
Serial-ATA Nov 25, 2023
9e4f287
EBML: Fix reading outside of EBML header
Serial-ATA Nov 25, 2023
eb5253b
EBML: Store previous master element's size
Serial-ATA Nov 26, 2023
131049c
EBML: Start parsing segment.Info
Serial-ATA Nov 26, 2023
f418d34
EBML: Parse segment.Info.TimecodeScale
Serial-ATA Nov 26, 2023
de3536c
EBML: Finish parsing segment.Info
Serial-ATA Nov 26, 2023
f783dd0
EBML: Add missing derive
Serial-ATA Nov 28, 2023
daef1a2
EBML: Specify most properties we'll end up reading
Serial-ATA Nov 28, 2023
f5f52ac
EBML: Stop requiring explicit locking of reader
Serial-ATA Nov 28, 2023
f27d7c3
EBML: Stub implement Segment.Tracks
Serial-ATA Nov 28, 2023
dd93d9d
EBML: Bring branch up to date
Serial-ATA Jul 29, 2024
a61e084
Tests: Move matroska test files
Serial-ATA Jul 29, 2024
9f1d632
EBML: Stub implement remaining Segment elements
Serial-ATA Jul 29, 2024
10c3e30
EBML: Start parsing \Ebml\Segments\Tracks
Serial-ATA Jul 29, 2024
0e99b36
EBML: Try to document the `ebml_master_elements` macro
Serial-ATA Jul 29, 2024
1031dab
EBML: Derive Default for VInt
Serial-ATA Aug 10, 2024
2ff8dc6
EBML: Define more master elements
Serial-ATA Aug 10, 2024
09f170e
EBML: Improve ElementReader locking
Serial-ATA Aug 10, 2024
9233d4a
EBML: Restrict parser to certain DocTypes
Serial-ATA Aug 12, 2024
16bb3c0
EBML: Retain all audio tracks
Serial-ATA Aug 24, 2024
e92a2cd
EBML: Add basic matroska integration tests (not yet working)
Serial-ATA Aug 24, 2024
009defc
EBML: Start parsing \Ebml\Segment\Attachments
Serial-ATA Aug 31, 2024
1c30150
Fuzz: Add `EbmlFile` fuzz target
Serial-ATA Aug 31, 2024
761b37f
EBML: Support locking at multiple depths
Serial-ATA Aug 31, 2024
9cfa003
Tests: Convert EBML tests to `test_log`
Serial-ATA Sep 1, 2024
e197f7e
EBML: Start parsing \Ebml\Segment\Tags\Tag\Targets
Serial-ATA Sep 2, 2024
7a3860c
EBML: Start parsing \Ebml\Segment\Tags\Tag\SimpleTag
Serial-ATA Sep 9, 2024
92bca37
EBML: Improve `ElementReader` tree navigation
Serial-ATA Sep 15, 2024
6f1404a
EBML: Finish parsing \Segment\Tags
Serial-ATA Sep 15, 2024
0eb55e6
EBML: Impl some TagExt methods
Serial-ATA Sep 16, 2024
f1a1a44
EBML: Make `SimpleTag` creation easier
Serial-ATA Sep 16, 2024
9f88cd4
EBML: Start defining structure for writes
Serial-ATA Sep 17, 2024
6274652
EBML: Handle `EbmlTag` -> `Tag` conversion
Serial-ATA Oct 13, 2024
27f3ff5
EBML: Make `TagName` enum non-exhaustive
Serial-ATA Oct 13, 2024
84f93ad
EBML: Add properties test
Serial-ATA Oct 13, 2024
ef5ab65
EBML: Define more tag mappings
Serial-ATA Oct 13, 2024
0cf3101
EBML: Get MKA properties test passing
Serial-ATA Oct 14, 2024
f4542bb
EBML: Rename `TagType::Ebml` -> `TagType::Matroska`
Serial-ATA Oct 14, 2024
c3c16fc
EBML: Add mapping for `ItemKey::TrackSubtitle`
Serial-ATA Oct 14, 2024
e45a036
EBML: Support duration and bitrate calculation
Serial-ATA Oct 15, 2024
1954e2c
Tests: Enable property reading for `*::read` tests
Serial-ATA Oct 15, 2024
13c5ff9
misc: Clippy
Serial-ATA Oct 15, 2024
f13a9c5
EBML: Retain companion tag
Serial-ATA Oct 15, 2024
3785955
misc: fmt
Serial-ATA Oct 15, 2024
0dd9557
EBML: Stub MergeTag impl
Serial-ATA Oct 15, 2024
756f022
EBML: Add generic tag conversion test
Serial-ATA Oct 19, 2024
d99f902
EBML: Writing WIP
Serial-ATA Oct 28, 2024
84bbc45
EBML: add generic conversion to `MatroskaTagRef`
Serial-ATA Nov 2, 2024
bcce2f0
misc: Clippy + rustdoc
Serial-ATA Nov 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ needless_return = "allow" # Explicit returns are needed from time to time
redundant_guards = "allow" # Currently broken for some cases, might enable later
into_iter_without_iter = "allow" # This is only going to fire on some internal types, doesn't matter much
struct_excessive_bools = "allow" # I have yet to find one case of this being useful
struct_field_names = "allow"

[workspace.lints.rustdoc]
broken_intra_doc_links = "deny"
Expand Down
4 changes: 4 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ path = "fuzz_targets/apefile_read_from.rs"
test = false
doc = false

[[bin]]
name = "ebmlfile_read_from"
path = "fuzz_targets/ebmlfile_read_from.rs"

[[bin]]
name = "flacfile_read_from"
path = "fuzz_targets/flacfile_read_from.rs"
Expand Down
11 changes: 11 additions & 0 deletions fuzz/fuzz_targets/ebmlfile_read_from.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![no_main]

use std::io::Cursor;

use libfuzzer_sys::fuzz_target;
use lofty::config::ParseOptions;
use lofty::file::AudioFile;

fuzz_target!(|data: Vec<u8>| {
let _ = lofty::ebml::EbmlFile::read_from(&mut Cursor::new(data), ParseOptions::new());
});
2 changes: 1 addition & 1 deletion lofty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ byteorder = { workspace = true }
# ID3 compressed frames
flate2 = { version = "1.0.30", optional = true }
# Proc macros
lofty_attr = "0.11.0"
lofty_attr = { path = "../lofty_attr" }
# Debug logging
log = "0.4.22"
# OGG Vorbis/Opus
Expand Down
1 change: 1 addition & 0 deletions lofty/src/ape/tag/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ mod tests {
fn skip_reading_cover_art() {
let p = Picture::new_unchecked(
PictureType::CoverFront,
None,
Some(MimeType::Jpeg),
None,
std::iter::repeat(0).take(50).collect::<Vec<u8>>(),
Expand Down
Loading
Loading