Skip to content

Conversation

@bradh
Copy link
Collaborator

@bradh bradh commented Jan 18, 2026

I missed the ccst on hev1 the first time around, so its probably better to have a shared implementation. There are more boxes to go in (e.g. lhvC).

Took the opportunity to add hvc2 and hev2 which are the same (at least from https://mpeggroup.github.io/FileFormatConformance/?query=%3D%22hvc2%22 ).

If this works out, I'll do the avc2, avc3, and avc4 in the same way.

@coderabbitai
Copy link

coderabbitai bot commented Jan 18, 2026

Walkthrough

This pull request refactors HEVC atom handling by consolidating four HEVC sample entry types (Hvc1, Hvc2, Hev1, Hev2) through a new define_hevc_sample_entry macro in hvc1.rs. The standalone hev1.rs file is deleted and its implementation is now macro-generated. New variants Hev2 and Hvc2 are added to the Any enum to support additional HEVC codec types. A ccst field is introduced to the Hvcc struct and related test structures. The module exports are updated to remove the separate hev1 module declaration.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main changes: refactoring hvc1 and hev1 into a shared implementation while adding new hvc2 and hev2 variants.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation (missed ccst field), the refactoring approach (shared implementation), and future plans.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/moov/trak/mdia/minf/stbl/stsd/hevc/hvc1.rs`:
- Around line 3-70: The match arms in the decode_body of the
define_hevc_sample_entry macro incorrectly use `.into()` to set Option fields
(e.g., hvcc, btrt, colr, pasp, taic, fiel, ccst); replace those assignments with
explicit Some(atom) (e.g., Any::Hvcc(atom) => hvcc = Some(atom)) inside the impl
Atom::decode_body for the generated types so each extracted atom is
idiomatically wrapped in Option; leave the
hvcc.ok_or(Error::MissingBox(Hvcc::KIND)) check as-is and do not change other
logic in encode_body or the Visual/Hvcc fields.

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.

1 participant