Skip to content

Add frame extraction to cluster#1

Merged
b01o merged 6 commits into
masterfrom
lacing
Sep 30, 2025
Merged

Add frame extraction to cluster#1
b01o merged 6 commits into
masterfrom
lacing

Conversation

@b01o
Copy link
Copy Markdown
Owner

@b01o b01o commented Sep 29, 2025

  • add frame() to Cluster for frame access
  • implement a Lacer
  • add tests for Lacer
  • handle laced frames in Cluster frame() method

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.
@b01o b01o marked this pull request as ready for review September 30, 2025 15:32
@b01o b01o requested a review from Copilot September 30, 2025 15:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Lacer enum with support for Xiph, EBML, and FixedSize lacing methods
  • Adds a ClusterBlock enum to unify SimpleBlock and BlockGroup handling
  • Refactors Cluster to use a single blocks field 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.

Comment thread src/lacer.rs Outdated
Comment thread src/lacer.rs Outdated
Comment thread src/frame.rs
Comment thread src/frame.rs Outdated
b01o and others added 2 commits September 30, 2025 23:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@b01o b01o merged commit 2fb923a into master Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants