Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Fix tauri call, h264 default, GPU check, sccache

Richie McIlroy9f387f43e6a3
diff --git a/apps/desktop/src/routes/editor/Header.tsx b/apps/desktop/src/routes/editor/Header.tsx
index eb6b10a3a..c314b2dc6 100644
--- a/apps/desktop/src/routes/editor/Header.tsx
+++ b/apps/desktop/src/routes/editor/Header.tsx
@@ -1,6 +1,6 @@
import { Button } from "@cap/ui-solid";
import { Dialog as KDialog } from "@kobalte/core/dialog";
-import { convertFileSrc, invoke } from "@tauri-apps/api/core";
+import { convertFileSrc } from "@tauri-apps/api/core";
import { LogicalPosition } from "@tauri-apps/api/dpi";
import type { UnlistenFn } from "@tauri-apps/api/event";
import { Menu, MenuItem } from "@tauri-apps/api/menu";
@@ -131,10 +131,8 @@ export function Header() {
}
await commands.setProjectConfig(serializeProjectConfiguration(project));
- const importedCount = await invoke<number>(
- "add_existing_recording_to_editor",
- { sourcePath },
- );
+ const importedCount =
+ await commands.addExistingRecordingToEditor(sourcePath);
toast.success(
importedCount === 1
? "Recording imported"
diff --git a/crates/enc-ffmpeg/src/video/h264.rs b/crates/enc-ffmpeg/src/video/h264.rs
index f8065b7bd..de347efe9 100644
--- a/crates/enc-ffmpeg/src/video/h264.rs
+++ b/crates/enc-ffmpeg/src/video/h264.rs
@@ -860,7 +860,7 @@ fn get_default_encoder_priority(_config: &VideoInfo) -> &'static [&'static str]
GpuVendor::Intel => ENCODER_PRIORITY_INTEL,
_ => ENCODER_PRIORITY_DEFAULT,
},
- None => &["libx264"],
+ None => ENCODER_PRIORITY_DEFAULT,
}
}
diff --git a/crates/frame-converter/src/d3d11.rs b/crates/frame-converter/src/d3d11.rs
index 5a2abac0e..863d57fdc 100644
--- a/crates/frame-converter/src/d3d11.rs
+++ b/crates/frame-converter/src/d3d11.rs
@@ -108,7 +108,8 @@ impl GpuInfo {
}
pub fn is_warp(&self) -> bool {
- matches_non_hardware_adapter_marker(&self.description)
+ self.description.contains("Microsoft Basic Render Driver")
+ || self.description.contains("WARP")
}
pub fn supports_hardware_encoding(&self) -> bool {
diff --git a/scripts/setup.js b/scripts/setup.js
index 2c85fe424..38ef03271 100644
--- a/scripts/setup.js
+++ b/scripts/setup.js
@@ -435,7 +435,7 @@ async function canUseSccache(sccachePath) {
const probePath = path.join(probeDir, "lib.rs");
try {
- await fs.writeFile(probePath, "");
+ await fs.writeFile(probePath, "fn main() {}\n");
await execFile(sccachePath, [
rustcPath,
probePath,
@@ -452,8 +452,6 @@ async function canUseSccache(sccachePath) {
"cdylib",
"--crate-type",
"staticlib",
- "--crate-type",
- "proc-macro",
"--print=sysroot",
"--print=split-debuginfo",
"--print=crate-name",