Skip to content

Conversation

Brendonovich
Copy link
Member

@Brendonovich Brendonovich commented Oct 17, 2025

In preparation to use the frame-specific width/height to calculate texture bounds

Summary by CodeRabbit

  • Refactor

    • Improved internal frame processing to better track and propagate frame dimension metadata throughout the rendering pipeline.
    • Updated frame data access patterns for consistency.
  • Chores

    • Enabled interactive mode for database operations.

@Brendonovich Brendonovich merged commit 35f4d96 into main Oct 17, 2025
14 checks passed
@Brendonovich Brendonovich deleted the decoded-frame-struct branch October 17, 2025 12:58
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR refactors DecodedFrame from a type alias to a struct containing width and height fields alongside pixel data. Decoders populate these dimensions from source frames, and all consumers updated to access data via the new .data() accessor method.

Changes

Cohort / File(s) Summary
Decoder infrastructure refactoring
crates/rendering/src/decoder/mod.rs
Replaces type alias DecodedFrame = Arc<Vec<u8>> with a struct containing data, width, and height fields; adds accessor methods data(), width(), and height().
Decoder implementations
crates/rendering/src/decoder/avassetreader.rs, crates/rendering/src/decoder/ffmpeg.rs
Both decoders now populate width and height from decoded frames and emit DecodedFrame struct with all three fields in both cache-hit and deferred send paths.
Layer consumers
crates/rendering/src/layers/camera.rs, crates/rendering/src/layers/display.rs
Updated to call .data() accessor on DecodedFrame when passing pixel data to GPU texture uploads.
Build configuration
turbo.json
Added interactive: true property to the db:push task.

Sequence Diagram

sequenceDiagram
    participant Decoder
    participant FrameProcessor
    participant Consumer

    rect rgb(200, 230, 255)
    Note over Decoder,Consumer: New Frame Processing Flow
    Decoder->>FrameProcessor: Decode frame with width/height
    FrameProcessor->>FrameProcessor: Create DecodedFrame { data, width, height }
    FrameProcessor->>Consumer: Send DecodedFrame
    Consumer->>Consumer: Call .data() for bytes<br/>.width() for metadata<br/>.height() for metadata
    Consumer->>Consumer: Upload to GPU with dimensions
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

The changes involve consistent, mechanical updates across multiple decoder and consumer files. Logic is straightforward—dimension tracking and struct field access—but the scope spans five files with interrelated changes requiring verification that all code paths correctly populate and consume the new fields.

Possibly related PRs

Poem

🐰 Frames now carry their story wide,
With width and height locked inside,
Through decoders they dance and flow,
Dimensions tagged before they go,
To layers bright where textures glow! ✨

✨ 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 decoded-frame-struct

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 494f4ff and 60c8f0e.

📒 Files selected for processing (6)
  • crates/rendering/src/decoder/avassetreader.rs (3 hunks)
  • crates/rendering/src/decoder/ffmpeg.rs (3 hunks)
  • crates/rendering/src/decoder/mod.rs (1 hunks)
  • crates/rendering/src/layers/camera.rs (1 hunks)
  • crates/rendering/src/layers/display.rs (1 hunks)
  • turbo.json (1 hunks)

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.

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