Conversation
Adds functionality to extract frames from both SimpleBlock and BlockGroup types within a Cluster. Prepares for lacing data handling.
Implements lacing and delacing operations for frame data to optimize storage. Introduces a `Lacer` enum with `Xiph`, `FixedSize`, and `Ebml` variants. Currently, only `Xiph` lacing is implemented with tests. Adds `MalformedLacingData` error to handle corrupted lacing data.
Changes the `delace` function to return a `Vec` of slices instead of an iterator. This removes the need for nightly features. The previous implementation used a generator-like iterator which relied on unstable `iter_macro` and `yield_expr` features.
Adds support for extracting frames from Clusters, handling both SimpleBlocks and BlockGroups. Implements lacing and delacing for Xiph, FixedSize, and EBML lacing types, allowing for efficient packing of multiple frames into single blocks.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds frame extraction functionality to the Cluster element by implementing a Lacer for handling laced frames and providing a unified interface for accessing frames from both SimpleBlock and BlockGroup elements.
- Implements a
Lacerenum with support for Xiph, EBML, and FixedSize lacing methods - Adds a
ClusterBlockenum to unify SimpleBlock and BlockGroup handling - Refactors
Clusterto use a singleblocksfield instead of separate fields for different block types
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lacer.rs | New module implementing lacing/delacing logic for frame data with comprehensive tests |
| src/frame.rs | New module defining Frame and ClusterBlock types with frame extraction logic |
| src/master.rs | Refactored Cluster struct to use unified blocks field with manual Element implementation |
| src/error.rs | Added MalformedLacingData error variant |
| src/lib.rs | Updated module organization and public exports |
| src/io.rs | Added module documentation comment |
| tests/ietf-mkv-test-cases.rs | Updated tests to use new ClusterBlock enum and blocks field |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.