Skip to content

Commit 444df9e

Browse files
Merge pull request #1462 from CapSoftware/encoder-fixes
Fix memory leaks and reduce memory usage in recording pipeline
2 parents 2ece58b + 5e2fc84 commit 444df9e

File tree

22 files changed

+1781
-214
lines changed

22 files changed

+1781
-214
lines changed

.claude/settings.local.json

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
{
2-
"permissions": {
3-
"allow": [
4-
"Bash(pnpm typecheck:*)",
5-
"Bash(pnpm lint:*)",
6-
"Bash(pnpm build:*)",
7-
"Bash(cargo check:*)",
8-
"Bash(cargo fmt:*)",
9-
"Bash(pnpm format:*)",
10-
"Bash(pnpm exec biome check:*)",
11-
"Bash(grep:*)",
12-
"Bash(cargo metadata:*)",
13-
"Bash(ffprobe:*)",
14-
"Bash(ls:*)",
15-
"Bash(find:*)",
16-
"Bash(cat:*)",
17-
"WebFetch(domain:raw.githubusercontent.com)",
18-
"WebFetch(domain:api.github.com)",
19-
"Bash(cargo doc:*)",
20-
"Bash(cargo clippy:*)",
21-
"Bash(python3:*)",
22-
"Bash(cargo run:*)",
23-
"WebSearch",
24-
"Bash(xargs ls:*)",
25-
"WebFetch(domain:ffmpeg.org)",
26-
"Bash(git log:*)",
27-
"Bash(tree:*)",
28-
"Bash(tail:*)",
29-
"Bash(pnpm typecheck:desktop:*)",
30-
"Bash(pnpm exec tsc:*)",
31-
"Bash(pnpm biome check:*)",
32-
"Bash(pnpm --dir apps/desktop exec tsc:*)",
33-
"Bash(xxd:*)",
34-
"Bash(git checkout:*)",
35-
"WebFetch(domain:www.npmjs.com)",
36-
"Bash(pnpm install:*)",
37-
"Bash(pnpm --dir apps/desktop exec biome check:*)",
38-
"Bash(pnpm --dir apps/desktop exec biome format:*)",
39-
"Bash(echo:*)",
40-
"Bash(pnpm exec biome:*)",
41-
"Bash(rustfmt:*)",
42-
"Bash(cargo tree:*)",
43-
"WebFetch(domain:github.com)",
44-
"WebFetch(domain:docs.rs)",
45-
"WebFetch(domain:gix.github.io)",
46-
"Bash(cargo clean:*)",
47-
"Bash(cargo test:*)",
48-
"Bash(powershell -Command \"[System.Environment]::OSVersion.Version.ToString()\")",
49-
"Bash(cargo build:*)",
50-
"Bash(gh api:*)",
51-
"Bash(curl:*)",
52-
"Bash(node -e:*)",
53-
"Bash(findstr:*)"
54-
],
55-
"deny": [],
56-
"ask": []
57-
}
2+
"permissions": {
3+
"allow": [
4+
"Bash(pnpm typecheck:*)",
5+
"Bash(pnpm lint:*)",
6+
"Bash(pnpm build:*)",
7+
"Bash(cargo check:*)",
8+
"Bash(cargo fmt:*)",
9+
"Bash(pnpm format:*)",
10+
"Bash(pnpm exec biome check:*)",
11+
"Bash(grep:*)",
12+
"Bash(cargo metadata:*)",
13+
"Bash(ffprobe:*)",
14+
"Bash(ls:*)",
15+
"Bash(find:*)",
16+
"Bash(cat:*)",
17+
"WebFetch(domain:raw.githubusercontent.com)",
18+
"WebFetch(domain:api.github.com)",
19+
"Bash(cargo doc:*)",
20+
"Bash(cargo clippy:*)",
21+
"Bash(python3:*)",
22+
"Bash(cargo run:*)",
23+
"WebSearch",
24+
"Bash(xargs ls:*)",
25+
"WebFetch(domain:ffmpeg.org)",
26+
"Bash(git log:*)",
27+
"Bash(tree:*)",
28+
"Bash(tail:*)",
29+
"Bash(pnpm typecheck:desktop:*)",
30+
"Bash(pnpm exec tsc:*)",
31+
"Bash(pnpm biome check:*)",
32+
"Bash(pnpm --dir apps/desktop exec tsc:*)",
33+
"Bash(xxd:*)",
34+
"Bash(git checkout:*)",
35+
"WebFetch(domain:www.npmjs.com)",
36+
"Bash(pnpm install:*)",
37+
"Bash(pnpm --dir apps/desktop exec biome check:*)",
38+
"Bash(pnpm --dir apps/desktop exec biome format:*)",
39+
"Bash(echo:*)",
40+
"Bash(pnpm exec biome:*)",
41+
"Bash(rustfmt:*)",
42+
"Bash(cargo tree:*)",
43+
"WebFetch(domain:github.com)",
44+
"WebFetch(domain:docs.rs)",
45+
"WebFetch(domain:gix.github.io)",
46+
"Bash(ffmpeg:*)",
47+
"Bash(DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH ./target/release/examples/memory-leak-detector:*)",
48+
"Bash(ln:*)",
49+
"Bash(./target/release/examples/memory-leak-detector:*)",
50+
"Bash(cargo build:*)",
51+
"Bash(footprint:*)",
52+
"Bash(RUST_LOG=info,cap_recording=debug ./target/release/examples/memory-leak-detector:*)",
53+
"Bash(git rm:*)"
54+
],
55+
"deny": [],
56+
"ask": []
57+
}
5858
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ tauri.windows.conf.json
5151
.cursor
5252
.env*.local
5353
.docs/
54+
.claude/

apps/desktop/src/routes/(window-chrome)/settings/feedback.tsx

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default function FeedbackTab() {
132132
>
133133
{(diag) => (
134134
<div class="space-y-3 text-sm">
135-
<Show when={diag().windowsVersion}>
135+
<Show when={diag().macosVersion}>
136136
{(ver) => (
137137
<div class="space-y-1">
138138
<p class="text-gray-11 font-medium">Operating System</p>
@@ -143,45 +143,21 @@ export default function FeedbackTab() {
143143
)}
144144
</Show>
145145

146-
<Show when={diag().gpuInfo}>
147-
{(gpu) => (
148-
<div class="space-y-1">
149-
<p class="text-gray-11 font-medium">Graphics</p>
150-
<p class="text-gray-10 bg-gray-2 px-2 py-1.5 rounded font-mono text-xs">
151-
{gpu().description} ({gpu().vendor},{" "}
152-
{gpu().dedicatedVideoMemoryMb} MB VRAM)
153-
</p>
154-
</div>
155-
)}
156-
</Show>
157-
158146
<div class="space-y-1">
159147
<p class="text-gray-11 font-medium">Capture Support</p>
160148
<div class="flex gap-2 flex-wrap">
161149
<span
162150
class={`px-2 py-1 rounded text-xs ${
163-
diag().graphicsCaptureSupported
151+
diag().screenCaptureSupported
164152
? "bg-green-500/20 text-green-400"
165153
: "bg-red-500/20 text-red-400"
166154
}`}
167155
>
168-
Graphics Capture:{" "}
169-
{diag().graphicsCaptureSupported
156+
Screen Capture:{" "}
157+
{diag().screenCaptureSupported
170158
? "Supported"
171159
: "Not Supported"}
172160
</span>
173-
<span
174-
class={`px-2 py-1 rounded text-xs ${
175-
diag().d3D11VideoProcessorAvailable
176-
? "bg-green-500/20 text-green-400"
177-
: "bg-yellow-500/20 text-yellow-400"
178-
}`}
179-
>
180-
D3D11 Video:{" "}
181-
{diag().d3D11VideoProcessorAvailable
182-
? "Available"
183-
: "Unavailable"}
184-
</span>
185161
</div>
186162
</div>
187163

apps/desktop/src/utils/tauri.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ uploadProgressEvent: "upload-progress-event"
358358

359359
/** user-defined types **/
360360

361-
export type AllGpusInfo = { gpus: GpuInfoDiag[]; primaryGpuIndex: number | null; isMultiGpuSystem: boolean; hasDiscreteGpu: boolean }
362361
export type Annotation = { id: string; type: AnnotationType; x: number; y: number; width: number; height: number; strokeColor: string; strokeWidth: number; fillColor: string; opacity: number; rotation: number; text: string | null; maskType?: MaskType | null; maskLevel?: number | null }
363362
export type AnnotationType = "arrow" | "circle" | "rectangle" | "text" | "mask"
364363
export type AppTheme = "system" | "light" | "dark"
@@ -424,7 +423,6 @@ quality: number | null;
424423
* Whether to prioritize speed over quality (default: false)
425424
*/
426425
fast: boolean | null }
427-
export type GpuInfoDiag = { vendor: string; description: string; dedicatedVideoMemoryMb: number; adapterIndex: number; isSoftwareAdapter: boolean; isBasicRenderDriver: boolean; supportsHardwareEncoding: boolean }
428426
export type HapticPattern = "alignment" | "levelChange" | "generic"
429427
export type HapticPerformanceTime = "default" | "now" | "drawCompleted"
430428
export type Hotkey = { code: string; meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }
@@ -437,6 +435,7 @@ export type JsonValue<T> = [T]
437435
export type LogicalBounds = { position: LogicalPosition; size: LogicalSize }
438436
export type LogicalPosition = { x: number; y: number }
439437
export type LogicalSize = { width: number; height: number }
438+
export type MacOSVersionInfo = { displayName: string }
440439
export type MainWindowRecordingStartBehaviour = "close" | "minimise"
441440
export type MaskKeyframes = { position?: MaskVectorKeyframe[]; size?: MaskVectorKeyframe[]; intensity?: MaskScalarKeyframe[] }
442441
export type MaskKind = "sensitive" | "highlight"
@@ -479,7 +478,6 @@ export type RecordingStatus = "pending" | "recording"
479478
export type RecordingStopped = null
480479
export type RecordingTargetMode = "display" | "window" | "area"
481480
export type RenderFrameEvent = { frame_number: number; fps: number; resolution_base: XY<number> }
482-
export type RenderingStatus = { isUsingSoftwareRendering: boolean; isUsingBasicRenderDriver: boolean; hardwareEncodingAvailable: boolean; warningMessage: string | null }
483481
export type RequestOpenRecordingPicker = { target_mode: RecordingTargetMode | null }
484482
export type RequestOpenSettings = { page: string }
485483
export type RequestScreenCapturePrewarm = { force?: boolean }
@@ -500,7 +498,7 @@ export type StartRecordingInputs = { capture_target: ScreenCaptureTarget; captur
500498
export type StereoMode = "stereo" | "monoL" | "monoR"
501499
export type StudioRecordingMeta = { segment: SingleSegment } | { inner: MultipleSegments }
502500
export type StudioRecordingStatus = { status: "InProgress" } | { status: "NeedsRemux" } | { status: "Failed"; error: string } | { status: "Complete" }
503-
export type SystemDiagnostics = { windowsVersion: WindowsVersionInfo | null; gpuInfo: GpuInfoDiag | null; allGpus: AllGpusInfo | null; renderingStatus: RenderingStatus; availableEncoders: string[]; graphicsCaptureSupported: boolean; d3D11VideoProcessorAvailable: boolean }
501+
export type SystemDiagnostics = { macosVersion: MacOSVersionInfo | null; availableEncoders: string[]; screenCaptureSupported: boolean }
504502
export type TargetUnderCursor = { display_id: DisplayId | null; window: WindowUnderCursor | null }
505503
export type TextSegment = { start: number; end: number; enabled?: boolean; content?: string; center?: XY<number>; size?: XY<number>; fontFamily?: string; fontSize?: number; fontWeight?: number; italic?: boolean; color?: string; fadeDuration?: number }
506504
export type TimelineConfiguration = { segments: TimelineSegment[]; zoomSegments: ZoomSegment[]; sceneSegments?: SceneSegment[]; maskSegments?: MaskSegment[]; textSegments?: TextSegment[] }
@@ -517,7 +515,6 @@ export type VideoUploadInfo = { id: string; link: string; config: S3UploadMeta }
517515
export type WindowExclusion = { bundleIdentifier?: string | null; ownerName?: string | null; windowTitle?: string | null }
518516
export type WindowId = string
519517
export type WindowUnderCursor = { id: WindowId; app_name: string; bounds: LogicalBounds }
520-
export type WindowsVersionInfo = { major: number; minor: number; build: number; displayName: string; meetsRequirements: boolean; isWindows11: boolean }
521518
export type XY<T> = { x: T; y: T }
522519
export type ZoomMode = "auto" | { manual: { x: number; y: number } }
523520
export type ZoomSegment = { start: number; end: number; amount: number; mode: ZoomMode }

0 commit comments

Comments
 (0)