WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Brendonovich
Copy link
Contributor

@Brendonovich Brendonovich commented Nov 4, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced video decoding with improved dimension tracking and processing accuracy, ensuring better video configuration handling and more reliable playback across various video formats and specifications.
  • Chores

    • Refined CI workflow configuration to optimize code quality checks on specific platforms, maintaining comprehensive testing across all supported environments.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 2025

Walkthrough

Two modifications are made: Windows is removed from the clippy CI job matrix (with commented history preserved), and AVAssetReaderDecoder struct now tracks image width and height dimensions, propagating them through FFmpeg decoder initialization, reader track output configuration, and the asset reader output dictionary.

Changes

Cohort / File(s) Summary
CI Workflow Update
\.github/workflows/ci\.yml
Removed Windows (x86_64-pc-windows-msvc) target from clippy job matrix; replaced with commented-out lines preserving prior configuration. Windows remains in other job matrices.
Video Decode Dimension Tracking
crates/video-decode/src/avassetreader\.rs
Added width: u32 and height: u32 fields to AVAssetReaderDecoder struct. Dimensions are retrieved from FFmpeg decoder during construction and threaded through reader track output creation and configuration. Asset reader output dictionary now includes width/height keys alongside pixel_format.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Review propagation of width/height fields through FFmpeg decoder initialization and reader setup to ensure correct data flow
  • Verify asset reader output dictionary keys and value assignments for width/height are properly typed and aligned with FFmpeg output
  • Confirm struct field initialization and reset flow handling of the new dimensions

Possibly related PRs

  • rendering: turn DecodedFrame into a struct #1230: Adds width/height propagation to DecodedFrame struct as a complementary data-carrying mechanism in the video decode pipeline, working alongside this PR's dimension tracking in AVAssetReaderDecoder.

Poem

🐰 With width and height now tracked with care,
Dimensions flow through reader's air,
From FFmpeg's realm to output's call,
The decoder remembers them all!

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'source frame width/height from ffmpeg for avassetreader' directly and specifically describes the main change: sourcing frame dimensions (width/height) from FFmpeg in the AVAssetReaderDecoder implementation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch avassetreader-size-fix

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
Contributor

@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: 0

🧹 Nitpick comments (1)
crates/video-decode/src/avassetreader.rs (1)

25-44: Consider validating that width and height are non-zero.

While FFmpeg's decoder.width() and decoder.height() typically return valid dimensions, corrupt or unusual video files could potentially have zero dimensions. Consider adding validation to return an error early if either dimension is zero, preventing downstream issues with the asset reader configuration.

Example validation:

let (pixel_format, width, height) = {
    // ... existing decoder setup ...
    
    let width = decoder.width();
    let height = decoder.height();
    
    if width == 0 || height == 0 {
        return Err(format!("Invalid video dimensions: {}x{}", width, height));
    }
    
    (
        pixel_to_pixel_format(decoder.format()),
        width,
        height,
    )
};
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff2867e and 9de6731.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (1 hunks)
  • crates/video-decode/src/avassetreader.rs (5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Format Rust code using rustfmt and ensure all Rust code passes workspace-level clippy lints.
Rust modules should be named with snake_case, and crate directories should be in kebab-case.

Files:

  • crates/video-decode/src/avassetreader.rs
crates/*/src/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Rust crates should place tests within the src/ and/or a sibling tests/ directory for each crate inside crates/*.

Files:

  • crates/video-decode/src/avassetreader.rs
🧬 Code graph analysis (1)
crates/video-decode/src/avassetreader.rs (2)
crates/rendering/src/decoder/avassetreader.rs (2)
  • new (45-51)
  • new (177-182)
crates/video-decode/src/ffmpeg.rs (3)
  • new (21-83)
  • decoder (103-105)
  • decoder (122-124)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Clippy (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Analyze (rust)
🔇 Additional comments (7)
.github/workflows/ci.yml (1)

106-108: Windows-specific clippy lints will no longer run.

While this reduces CI resource consumption, be aware that Rust clippy lints specific to Windows will not be caught until later in the pipeline (build-desktop job). Consider monitoring for any Windows-specific issues that might slip through.

crates/video-decode/src/avassetreader.rs (6)

19-20: LGTM - Width and height fields added.

The addition of width and height fields to track video dimensions is appropriate. These fields are properly typed as u32 and will store the frame dimensions sourced from the FFmpeg decoder.


48-48: LGTM - Constructor properly passes dimensions.

The updated call to get_reader_track_output correctly passes the extracted width and height values.


56-57: LGTM - Struct fields properly initialized.

The width and height fields are correctly initialized with the values extracted from the FFmpeg decoder.


68-69: LGTM - Reset correctly preserves dimensions.

The reset method appropriately reuses the stored width and height values, maintaining consistency with the original decoder configuration.


80-81: LGTM - Function signature updated to accept dimensions.

The function signature correctly adds width and height parameters that are needed for configuring the asset reader track output.


108-117: LGTM - Dictionary correctly configured with width and height.

The asset reader track output dictionary is properly expanded to include width and height alongside pixel format. The parallel arrays of keys and values are correctly aligned, and the Core Video pixel buffer keys are appropriately used for dimension configuration.

@Brendonovich Brendonovich merged commit 4449da3 into main Nov 4, 2025
16 checks passed
@Brendonovich Brendonovich deleted the avassetreader-size-fix branch November 4, 2025 18:06
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