Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4c260d8
feat: Massive performance overhaul for editor playback
richiemcilroy Dec 10, 2025
e62ccca
clippy bits
richiemcilroy Dec 10, 2025
5a4a18b
Add performance logging and playback optimizations
richiemcilroy Dec 12, 2025
38b171c
Add YUV420P to RGBA shader and canvas render metrics
richiemcilroy Dec 12, 2025
1a2ffd8
Refactor YUV conversion pipeline and shaders
richiemcilroy Dec 12, 2025
169582b
wip: Editor playback optimisations
richiemcilroy Dec 15, 2025
48e2c5a
feat: Further optimisation of editor
richiemcilroy Dec 15, 2025
d4c7558
Optimize project state access during playback
richiemcilroy Dec 15, 2025
aa30be3
Implement OffscreenCanvas and SharedArrayBuffer for playback
richiemcilroy Dec 15, 2025
4699889
Refactor frame padding stripping into helper function
richiemcilroy Dec 15, 2025
37f4822
Debounce canvas container bounds updates in PreviewCanvas
richiemcilroy Dec 15, 2025
c98daa8
Show grid only after frame is rendered in PreviewCanvas
richiemcilroy Dec 15, 2025
f50000f
Allow biome format command in desktop app
richiemcilroy Dec 15, 2025
c2faa86
Increase FPS constant from 30 to 60
richiemcilroy Dec 15, 2025
7e262f8
Add frame queuing and render loop for offscreen canvas
richiemcilroy Dec 15, 2025
ac08897
remove logging
richiemcilroy Dec 15, 2025
1773135
back to 30fps
richiemcilroy Dec 15, 2025
34e8b5f
Add WebGPU renderer support to frame worker
richiemcilroy Dec 15, 2025
12f42d8
coderabbit bits
richiemcilroy Dec 15, 2025
b8cccd5
coderabbit bits
richiemcilroy Dec 15, 2025
d53791c
clippy
richiemcilroy Dec 15, 2025
36631c6
clippy
richiemcilroy Dec 15, 2025
7b34a39
clippy
richiemcilroy Dec 15, 2025
5f23cbe
clippy
richiemcilroy Dec 15, 2025
d7e5d91
Add tray mode selection and dynamic tray icons
richiemcilroy Dec 15, 2025
1d18b15
Add CycleRecordingMode hotkey action
richiemcilroy Dec 15, 2025
6272334
Redesign mode select UI and update window sizing
richiemcilroy Dec 15, 2025
5ca9fbc
Add 'cycleRecordingMode' hotkey to settings
richiemcilroy Dec 15, 2025
4534dd8
clippy
richiemcilroy Dec 15, 2025
7a66fac
clippy
richiemcilroy Dec 15, 2025
33625f0
Add zero-copy Metal IOSurface NV12 support on macOS
richiemcilroy Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@
"Bash(pnpm exec tsc:*)",
"Bash(pnpm biome check:*)",
"Bash(pnpm --dir apps/desktop exec tsc:*)",
"Bash(xxd:*)"
"Bash(xxd:*)",
"Bash(git checkout:*)",
"WebFetch(domain:www.npmjs.com)",
"Bash(pnpm install:*)",
"Bash(pnpm --dir apps/desktop exec biome check:*)",
"Bash(pnpm --dir apps/desktop exec biome format:*)",
"Bash(echo:*)",
"Bash(pnpm exec biome:*)",
"Bash(rustfmt:*)",
"Bash(cargo tree:*)",
"WebFetch(domain:github.com)",
"WebFetch(domain:docs.rs)"
],
"deny": [],
"ask": []
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ jobs:
run: node scripts/setup.js

- name: Run Clippy
uses: actions-rs-plus/clippy-check@v2
with:
args: --workspace --all-features --locked
run: cargo clippy --workspace --all-features --locked -- -D warnings

lint-biome:
name: Lint (Biome)
Expand Down Expand Up @@ -279,6 +277,4 @@ jobs:

- name: Run Clippy
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' || matrix.settings.target == 'x86_64-pc-windows-msvc' }}
uses: actions-rs-plus/clippy-check@v2
with:
args: --workspace --all-features --locked
run: cargo clippy --workspace --all-features --locked -- -D warnings
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "b9c8079e82e2",
"serialize",
] }
nokhwa-bindings-macos = { git = "https://github.com/CapSoftware/nokhwa", rev = "b9c8079e82e2" }
wgpu = "25.0.0"
wgpu = { version = "25.0.0", features = ["wgpu-core"] }
wgpu-hal = "25.0.0"
wgpu-core = "25.0.0"
flume = "0.11.0"
thiserror = "1.0"
sentry = { version = "0.42.0", features = [
Expand All @@ -53,12 +55,15 @@ cidre = { git = "https://github.com/CapSoftware/cidre", rev = "bf84b67079a8", fe
"macos_12_7",
"cv",
"cf",
"cg",
"core_audio",
"sc",
"av",
"blocks",
"async",
"dispatch",
"io_surface",
"mtl",
], default-features = false }

windows = "0.60.0"
Expand Down
10 changes: 8 additions & 2 deletions apps/desktop/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import capUIPlugin from "@cap/ui-solid/vite";
import { defineConfig } from "@solidjs/start/config";
import topLevelAwait from "vite-plugin-top-level-await";
import wasm from "vite-plugin-wasm";
Comment on lines +3 to +4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n apps/desktop/app.config.ts

Repository: CapSoftware/Cap

Length of output: 1378


🏁 Script executed:

cat package.json | jq '.dependencies, .devDependencies' | grep -E "(vite|lz4|wasm|top-level)"

Repository: CapSoftware/Cap

Length of output: 41


🏁 Script executed:

cd apps/desktop && cat -n package.json 2>/dev/null || cd .. && cat -n package.json | head -100

Repository: CapSoftware/Cap

Length of output: 7470


🌐 Web query:

vite-plugin-wasm 3.4.1 compatibility Vite 6

💡 Result:

Yes — vite-plugin-wasm (including v3.4.1) is compatible with Vite 6. The plugin's README and package pages state it supports Vite 2.x through 6.x. [1][2]

Sources:
[1] vite-plugin-wasm README (GitHub).
[2] npm/jsDelivr package pages for vite-plugin-wasm.


🌐 Web query:

vite-plugin-top-level-await 1.4.4 Vite 6 compatibility

💡 Result:

Short answer: Not reliably. There’s a reported regression where vite v6.0.7 breaks vite-plugin-top-level-await@1.4.4 (works on 6.0.6 but fails on 6.0.7). [1][2]

Actions:

  • Upgrade vite-plugin-top-level-await to the latest release (1.6.0 at time of writing). [2]
  • Or pin Vite to 6.0.6 (or another Vite 6.x that is known working) until the plugin is updated. [1][2]

Sources:

  • Issue reporting break in Vite 6.0.7 with vite-plugin-top-level-await 1.4.4. [1]
  • vite-plugin-top-level-await package (current versions). [2]
  • Vite 6 announcement (context). [3]

Upgrade vite-plugin-top-level-await to 1.6.0+ or pin Vite to 6.0.6.

A critical compatibility regression exists: vite-plugin-top-level-await@1.4.4 breaks on Vite 6.0.7 and later versions (including the current 6.3.5). Either upgrade the plugin to 1.6.0+ in devDependencies or constrain Vite to ^6.0.6. The vite-plugin-wasm@3.4.1 is confirmed compatible with Vite 6.3.5; plugin order is correct.

🤖 Prompt for AI Agents
In apps/desktop/app.config.ts around lines 3-4 the project imports
vite-plugin-top-level-await which is vulnerable to a compatibility regression
with Vite >=6.0.7; update package.json devDependencies to either upgrade
vite-plugin-top-level-await to version 1.6.0 or later, or pin vite to ^6.0.6 so
the plugin remains compatible, then run npm/yarn install and test the dev build
to verify the issue is resolved.

import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
Expand All @@ -13,18 +15,22 @@ export default defineConfig({
port: 3001,
strictPort: true,
watch: {
// 2. tell vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
// 3. to make use of `TAURI_DEBUG` and other env variables
// https://tauri.studio/v1/api/config#buildconfig.beforedevcommand
envPrefix: ["VITE_", "TAURI_"],
assetsInclude: ["**/*.riv"],
plugins: [
wasm(),
topLevelAwait(),
capUIPlugin,
tsconfigPaths({
// If this isn't set Vinxi hangs on startup
root: ".",
}),
],
Expand Down
Binary file removed apps/desktop/core
Binary file not shown.
4 changes: 4 additions & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@types/react-tooltip": "^4.2.4",
"cva": "npm:class-variance-authority@^0.7.0",
"effect": "^3.18.4",
"lz4-wasm": "^0.9.2",
"mp4box": "^0.5.2",
"posthog-js": "^1.215.3",
"solid-js": "^1.9.3",
Expand All @@ -72,6 +73,7 @@
},
"devDependencies": {
"@fontsource/geist-sans": "^5.0.3",
"@webgpu/types": "^0.1.44",
"@iconify/json": "^2.2.239",
"@tauri-apps/cli": ">=2.1.0",
"@total-typescript/ts-reset": "^0.6.1",
Expand All @@ -80,6 +82,8 @@
"cross-env": "^7.0.3",
"typescript": "^5.8.3",
"vite": "^6.3.5",
"vite-plugin-top-level-await": "^1.4.4",
"vite-plugin-wasm": "^3.4.1",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "~2.1.9"
}
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ tauri-plugin-sentry = "0.5.0"
thiserror.workspace = true
bytes = "1.10.1"
async-stream = "0.3.6"
lz4_flex = "0.11"
sanitize-filename = "0.6.0"
tracing-futures = { version = "0.2.5", features = ["futures-03"] }
tracing-opentelemetry = "0.32.0"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/desktop/src-tauri/icons/tray-default-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/desktop/src-tauri/icons/tray-stop-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/desktop/src-tauri/src/camera_legacy.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::time::Instant;

use cap_recording::FFmpegVideoFrame;
use flume::Sender;
use tokio_util::sync::CancellationToken;
Expand Down Expand Up @@ -62,6 +64,7 @@ pub async fn create_camera_preview_ws() -> (Sender<FFmpegVideoFrame>, u16, Cance
width: frame.width(),
height: frame.height(),
stride: frame.stride(0) as u32,
created_at: Instant::now(),
})
.ok();
}
Expand Down
Loading