Skip to content

Adds Matroska view functionality#2

Merged
b01o merged 6 commits into
masterfrom
feat/view
Oct 9, 2025
Merged

Adds Matroska view functionality#2
b01o merged 6 commits into
masterfrom
feat/view

Conversation

@b01o
Copy link
Copy Markdown
Owner

@b01o b01o commented Oct 4, 2025

Adds MatroskaView and SegmentView structs for efficiently parsing Matroska files without loading cluster data into memory. This allows for faster analysis of file metadata.

Adds a `view` module with `MatroskaView` and `SegmentView` structs.
@b01o b01o added the enhancement New feature or request label Oct 4, 2025
Introduces `MatroskaView` and `SegmentView` structs to enable parsing Matroska files without loading Cluster data into memory, improving performance.

The implementation includes both synchronous and asynchronous (tokio) versions for flexible integration.
b01o added 4 commits October 6, 2025 13:19
Refactors segment parsing to handle multiple segments
within a single Matroska file.

Now returns a `Vec` from the `SegmentView::new`
and `SegmentView::new_async` functions.

Also implements logic to find next segment using SeekHead
information to skip to the next segment when a Cluster
is encountered.
Adds integration tests for the Matroska view functionality,
including tests for basic segment parsing, segments without clusters,
multiple segments, and un-sized segments. This ensures that the
view parsing logic correctly handles various Matroska file structures.

Also introduces `WriteElement` trait for writing structs from the `element` module.
Refactors the segment view parsing logic to correctly handle edge cases,
such as segments without clusters and segments with unknown sizes.
Specifically, it skips to the end of the segment if a cluster is not found and the segment size is known.

Adds comprehensive asynchronous tests to validate the functionality of
MatroskaView, including handling multiple segments, segments without
clusters, and segments with unknown sizes.
Enables a new `utils` feature that introduces utility modules, such as the `view` module, for easier interaction with Matroska files.

The `view` module provides `MatroskaView` and `SegmentView` structs, designed for efficiently parsing MKV file metadata without the need to load the entire cluster data into memory, which is useful for large files.

Also enables the `utils` feature in the integration tests.
@b01o b01o marked this pull request as ready for review October 9, 2025 02:51
@b01o b01o merged commit bd6bbaf into master Oct 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant