-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Handle windows rgb types properly #1026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,5 +11,5 @@ pub use windows::*; | |||||||||||||||||||||||||
| pub trait CapturedFrameExt { | ||||||||||||||||||||||||||
| /// Creates an ffmpeg video frame from the native frame. | ||||||||||||||||||||||||||
| /// Only size, format, and data are set. | ||||||||||||||||||||||||||
| fn to_ffmpeg(&self) -> Result<ffmpeg::frame::Video, ToFfmpegError>; | ||||||||||||||||||||||||||
| fn as_ffmpeg(&self) -> Result<ffmpeg::frame::Video, AsFFmpegError>; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
Comment on lines
11
to
15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gate the trait on supported platforms to avoid missing-type compile errors on others. AsFFmpegError is re-exported only on macOS/Windows. On other targets, this trait references an undefined type. Apply: - pub trait CapturedFrameExt {
+ #[cfg(any(target_os = "macos", target_os = "windows"))]
+ pub trait CapturedFrameExt {
/// Creates an ffmpeg video frame from the native frame.
/// Only size, format, and data are set.
fn as_ffmpeg(&self) -> Result<ffmpeg::frame::Video, AsFFmpegError>;
}Optionally, also make the windows module gating consistent with macOS by using target_os = "windows". 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ declare global { | |
| const IconCapSettings: typeof import('~icons/cap/settings.jsx')['default'] | ||
| const IconCapShadow: typeof import('~icons/cap/shadow.jsx')['default'] | ||
| const IconCapSquare: typeof import('~icons/cap/square.jsx')['default'] | ||
| const IconCapStopCircle: typeof import("~icons/cap/stop-circle.jsx")["default"] | ||
| const IconCapStopCircle: typeof import('~icons/cap/stop-circle.jsx')['default'] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 🧩 Analysis chainFormatting-only change in a generated file; OK, but avoid hand-editing artifacts. Swapping to single quotes matches the prevailing style in this file and is no-op semantically. Since this file is generated by unplugin-auto-import, prefer regenerating rather than hand edits to prevent drift and churn. Run this to check for remaining double-quoted imports so you can fix at the generator/config level instead of manual edits: 🏁 Script executed: #!/bin/bash
# List any lines still using double-quoted typeof import() entries
rg -nP 'typeof import\("~icons/.+?"\)\["default"\]' packages/ui-solid/src/auto-imports.d.ts || trueLength of output: 476 Regenerate auto-imports with single-quote imports There are still double-quoted typeof import() entries in packages/ui-solid/src/auto-imports.d.ts — change the auto-import generator/config to emit single quotes and regenerate the file (avoid hand edits). Occurrences:
🤖 Prompt for AI Agents |
||
| const IconCapTrash: typeof import('~icons/cap/trash.jsx')['default'] | ||
| const IconCapUndo: typeof import('~icons/cap/undo.jsx')['default'] | ||
| const IconCapUpload: typeof import("~icons/cap/upload.jsx")["default"] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Breaking rename: ensure all call sites migrated from to_ffmpeg to as_ffmpeg.
This is a public API change; sweep the workspace for stragglers.
Additionally, sanity‑check Windows RGB handling as part of this PR’s objective (RGB24 row width and Y inversion).
I can propose a fix if the checks above surface issues.
🏁 Script executed:
Length of output: 402
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 41545
Rename migrated; docs update + critical Windows RGB24 bug
CapturedFrameExt::to_ffmpeg()andToFfmpegError— update toas_ffmpeg/AsFFmpegError.row_width = width * 4andsrc_row = &bytes[height * row_width..](constant offset). Change to 3 bytes/pixel and per-row indexing (e.g.row_width = width * 3andsrc_row = &bytes[y * row_width..]or&bytes[(height - y - 1) * row_width..]to match ARGB/RGB32 inversion). Current code will copy incorrect byte counts and can cause pixel corruption / OOB.🤖 Prompt for AI Agents