Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Add configurable editor preview quality setting

Richie McIlroy592d323378ce
diff --git a/apps/desktop/src-tauri/src/editor_window.rs b/apps/desktop/src-tauri/src/editor_window.rs
index 235453e3d..a5c2bde1e 100644
--- a/apps/desktop/src-tauri/src/editor_window.rs
+++ b/apps/desktop/src-tauri/src/editor_window.rs
@@ -12,6 +12,7 @@ pub struct EditorInstance {
inner: Arc<cap_editor::EditorInstance>,
pub ws_port: u16,
pub ws_shutdown_token: CancellationToken,
+ scale_tx: watch::Sender<u32>,
}
type PendingResult = Result<Arc<EditorInstance>, String>;
@@ -22,8 +23,9 @@ pub struct PendingEditorInstances(Arc<RwLock<HashMap<String, PendingReceiver>>>)
async fn do_prewarm(app: AppHandle, path: PathBuf) -> PendingResult {
let (frame_tx, frame_rx) = watch::channel(None);
+ let (scale_tx, scale_rx) = watch::channel(50u32);
- let (ws_port, ws_shutdown_token) = create_watch_frame_ws(frame_rx).await;
+ let (ws_port, ws_shutdown_token) = create_watch_frame_ws(frame_rx, scale_rx).await;
let inner = create_editor_instance_impl(
&app,
path,
@@ -45,6 +47,7 @@ async fn do_prewarm(app: AppHandle, path: PathBuf) -> PendingResult {
inner,
ws_port,
ws_shutdown_token,
+ scale_tx,
}))
}
@@ -96,6 +99,10 @@ impl EditorInstance {
self.ws_shutdown_token.cancel();
}
+
+ pub fn set_preview_scale(&self, scale_percent: u32) {
+ self.scale_tx.send_replace(scale_percent);
+ }
}
impl Deref for EditorInstance {
@@ -180,9 +187,10 @@ impl EditorInstances {
}
let (frame_tx, frame_rx) = watch::channel(None);
+ let (scale_tx, scale_rx) = watch::channel(50u32);
- let (ws_port, ws_shutdown_token) = create_watch_frame_ws(frame_rx).await;
- let instance = create_editor_instance_impl(
+ let (ws_port, ws_shutdown_token) = create_watch_frame_ws(frame_rx, scale_rx).await;
+ let inner = create_editor_instance_impl(
window.app_handle(),
path,
Box::new(move |frame| {
@@ -200,9 +208,10 @@ impl EditorInstances {
.await?;
let instance = Arc::new(EditorInstance {
- inner: instance.clone(),
+ inner,
ws_port,
ws_shutdown_token,
+ scale_tx,
});
entry.insert(instance.clone());
diff --git a/apps/desktop/src-tauri/src/frame_ws.rs b/apps/desktop/src-tauri/src/frame_ws.rs
index 28b390dc8..cd49bb8dd 100644
--- a/apps/desktop/src-tauri/src/frame_ws.rs
+++ b/apps/desktop/src-tauri/src/frame_ws.rs
@@ -7,7 +7,6 @@ static TOTAL_BYTES_SENT: AtomicU64 = AtomicU64::new(0);
static TOTAL_FRAMES_SENT: AtomicU32 = AtomicU32::new(0);
static LAST_LOG_TIME: AtomicU64 = AtomicU64::new(0);
-const DOWNSCALE_PERCENT: u32 = 75;
const NV12_FORMAT_MAGIC: u32 = 0x4e563132;
fn downscale_and_convert_to_nv12(
@@ -15,9 +14,10 @@ fn downscale_and_convert_to_nv12(
width: u32,
height: u32,
stride: u32,
+ scale_percent: u32,
) -> (Vec<u8>, u32, u32) {
- let new_width = ((width * DOWNSCALE_PERCENT) / 100) & !1;
- let new_height = ((height * DOWNSCALE_PERCENT) / 100) & !1;
+ let new_width = ((width * scale_percent) / 100) & !1;
+ let new_height = ((height * scale_percent) / 100) & !1;
if new_width == 0 || new_height == 0 {
return (Vec::new(), 0, 0);
@@ -148,6 +148,7 @@ pub struct WSFrame {
pub async fn create_watch_frame_ws(
frame_rx: watch::Receiver<Option<WSFrame>>,
+ scale_rx: watch::Receiver<u32>,
) -> (u16, CancellationToken) {
use axum::{
extract::{
@@ -158,41 +159,49 @@ pub async fn create_watch_frame_ws(
routing::get,
};
- type RouterState = watch::Receiver<Option<WSFrame>>;
+ type RouterState = (watch::Receiver<Option<WSFrame>>, watch::Receiver<u32>);
#[axum::debug_handler]
async fn ws_handler(
ws: WebSocketUpgrade,
State(state): State<RouterState>,
) -> impl IntoResponse {
- ws.on_upgrade(move |socket| handle_socket(socket, state))
+ ws.on_upgrade(move |socket| handle_socket(socket, state.0, state.1))
}
- async fn handle_socket(mut socket: WebSocket, mut camera_rx: RouterState) {
+ async fn handle_socket(
+ mut socket: WebSocket,
+ mut camera_rx: watch::Receiver<Option<WSFrame>>,
+ scale_rx: watch::Receiver<u32>,
+ ) {
tracing::info!("Socket connection established");
let now = std::time::Instant::now();
{
let frame_opt = camera_rx.borrow().clone();
+ let scale_percent = *scale_rx.borrow();
if let Some(frame) = frame_opt {
let (nv12_data, scaled_width, scaled_height) = downscale_and_convert_to_nv12(
&frame.data,
frame.width,
frame.height,
frame.stride,
+ scale_percent,
);
- let packed = pack_nv12_frame(
- nv12_data,
- scaled_width,
- scaled_height,
- frame.frame_number,
- frame.target_time_ns,
- );
-
- if let Err(e) = socket.send(Message::Binary(packed)).await {
- tracing::error!("Failed to send initial frame to socket: {:?}", e);
- return;
+ if scaled_width > 0 && scaled_height > 0 {
+ let packed = pack_nv12_frame(
+ nv12_data,
+ scaled_width,
+ scaled_height,
+ frame.frame_number,
+ frame.target_time_ns,
+ );
+
+ if let Err(e) = socket.send(Message::Binary(packed)).await {
+ tracing::error!("Failed to send initial frame to socket: {:?}", e);
+ return;
+ }
}
}
}
@@ -214,15 +223,20 @@ pub async fn create_watch_frame_ws(
},
_ = camera_rx.changed() => {
let frame_opt = camera_rx.borrow_and_update().clone();
+ let scale_percent = *scale_rx.borrow();
if let Some(frame) = frame_opt {
-
let (nv12_data, scaled_width, scaled_height) = downscale_and_convert_to_nv12(
&frame.data,
frame.width,
frame.height,
frame.stride,
+ scale_percent,
);
+ if scaled_width == 0 || scaled_height == 0 {
+ continue;
+ }
+
let packed = pack_nv12_frame(
nv12_data,
scaled_width,
@@ -270,7 +284,7 @@ pub async fn create_watch_frame_ws(
let router = axum::Router::new()
.route("/", get(ws_handler))
- .with_state(frame_rx);
+ .with_state((frame_rx, scale_rx));
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
let port = listener.local_addr().unwrap().port();
diff --git a/apps/desktop/src-tauri/src/general_settings.rs b/apps/desktop/src-tauri/src/general_settings.rs
index eadb4098e..33b995749 100644
--- a/apps/desktop/src-tauri/src/general_settings.rs
+++ b/apps/desktop/src-tauri/src/general_settings.rs
@@ -31,6 +31,25 @@ pub enum PostDeletionBehaviour {
ReopenRecordingWindow,
}
+#[derive(Default, Serialize, Deserialize, Type, Debug, Clone, Copy)]
+#[serde(rename_all = "camelCase")]
+pub enum EditorPreviewQuality {
+ Quarter,
+ #[default]
+ Half,
+ Full,
+}
+
+impl EditorPreviewQuality {
+ pub fn scale_percent(self) -> u32 {
+ match self {
+ Self::Quarter => 25,
+ Self::Half => 50,
+ Self::Full => 100,
+ }
+ }
+}
+
impl MainWindowRecordingStartBehaviour {
pub fn perform(&self, window: &tauri::WebviewWindow) -> tauri::Result<()> {
match self {
@@ -119,6 +138,8 @@ pub struct GeneralSettingsStore {
pub crash_recovery_recording: bool,
#[serde(default = "default_max_fps")]
pub max_fps: u32,
+ #[serde(default)]
+ pub editor_preview_quality: EditorPreviewQuality,
}
fn default_enable_native_camera_preview() -> bool {
@@ -184,6 +205,7 @@ impl Default for GeneralSettingsStore {
default_project_name_template: None,
crash_recovery_recording: true,
max_fps: 60,
+ editor_preview_quality: EditorPreviewQuality::Half,
}
}
}
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index 6e2553a9a..c4b53b793 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -58,7 +58,7 @@ use clipboard_rs::{Clipboard, ClipboardContext};
use cpal::StreamError;
use editor_window::{EditorInstances, WindowEditorInstance};
use ffmpeg::ffi::AV_TIME_BASE;
-use general_settings::GeneralSettingsStore;
+use general_settings::{EditorPreviewQuality, GeneralSettingsStore};
use kameo::{Actor, actor::ActorRef};
use notifications::NotificationType;
use recording::{InProgressRecording, RecordingEvent, RecordingInputKind};
@@ -1643,6 +1643,16 @@ async fn set_project_config(
Ok(())
}
+#[tauri::command]
+#[specta::specta]
+#[instrument(skip(editor_instance))]
+fn set_editor_preview_quality(
+ editor_instance: WindowEditorInstance,
+ quality: EditorPreviewQuality,
+) {
+ editor_instance.set_preview_scale(quality.scale_percent());
+}
+
#[tauri::command]
#[specta::specta]
#[instrument(skip(editor_instance))]
@@ -2497,6 +2507,7 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) {
stop_playback,
set_playhead_position,
set_project_config,
+ set_editor_preview_quality,
update_project_config_in_memory,
generate_zoom_segments_from_clicks,
permissions::open_permission_settings,
diff --git a/apps/desktop/src-tauri/src/screenshot_editor.rs b/apps/desktop/src-tauri/src/screenshot_editor.rs
index 1a56e9849..f550c1256 100644
--- a/apps/desktop/src-tauri/src/screenshot_editor.rs
+++ b/apps/desktop/src-tauri/src/screenshot_editor.rs
@@ -98,7 +98,8 @@ impl ScreenshotEditorInstances {
match instances.entry(window.label().to_string()) {
Entry::Vacant(entry) => {
let (frame_tx, frame_rx) = watch::channel(None);
- let (ws_port, ws_shutdown_token) = create_watch_frame_ws(frame_rx).await;
+ let (_scale_tx, scale_rx) = watch::channel(100u32);
+ let (ws_port, ws_shutdown_token) = create_watch_frame_ws(frame_rx, scale_rx).await;
let (data, width, height) = {
let key = path
diff --git a/apps/desktop/src/routes/editor/Editor.tsx b/apps/desktop/src/routes/editor/Editor.tsx
index e9be53c2e..dee5aced7 100644
--- a/apps/desktop/src/routes/editor/Editor.tsx
+++ b/apps/desktop/src/routes/editor/Editor.tsx
@@ -511,12 +511,17 @@ function Dialogs() {
const controls = canvasControls();
if (controls) {
- controls.captureFrame().then((blob) => {
- if (blob) {
- const url = URL.createObjectURL(blob);
- setFrameBlobUrl(url);
- }
- });
+ controls
+ .captureFrame()
+ .then((blob) => {
+ if (blob) {
+ const url = URL.createObjectURL(blob);
+ setFrameBlobUrl(url);
+ }
+ })
+ .catch((error) => {
+ console.warn("Frame capture failed:", error);
+ });
}
onCleanup(() => {
diff --git a/apps/desktop/src/routes/editor/context.ts b/apps/desktop/src/routes/editor/context.ts
index 1c6bec435..1c12c5abc 100644
--- a/apps/desktop/src/routes/editor/context.ts
+++ b/apps/desktop/src/routes/editor/context.ts
@@ -11,6 +11,7 @@ import {
type Accessor,
batch,
createEffect,
+ createMemo,
createResource,
createRoot,
createSignal,
@@ -19,6 +20,8 @@ import {
} from "solid-js";
import { createStore, produce, reconcile, unwrap } from "solid-js/store";
+import { generalSettingsStore } from "~/store";
+
import { createPresets } from "~/utils/createPresets";
import { createCustomDomainQuery } from "~/utils/queries";
import {
@@ -66,7 +69,7 @@ export const OUTPUT_SIZE = {
export type PreviewQuality = "quarter" | "half" | "full";
-export const DEFAULT_PREVIEW_QUALITY: PreviewQuality = "full";
+export const DEFAULT_PREVIEW_QUALITY: PreviewQuality = "half";
const previewQualityScale: Record<PreviewQuality, number> = {
full: 1,
@@ -523,10 +526,39 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(
),
);
- const [previewQuality, setPreviewQuality] = createSignal<PreviewQuality>(
+ const [storedSettings] = createResource(() => generalSettingsStore.get());
+ const initialPreviewQuality = createMemo((): PreviewQuality => {
+ const stored = storedSettings()?.editorPreviewQuality;
+ if (stored === "quarter" || stored === "half" || stored === "full") {
+ return stored;
+ }
+ return DEFAULT_PREVIEW_QUALITY;
+ });
+
+ const [previewQuality, _setPreviewQuality] = createSignal<PreviewQuality>(
DEFAULT_PREVIEW_QUALITY,
);
+ createEffect(() => {
+ const quality = initialPreviewQuality();
+ _setPreviewQuality(quality);
+ commands.setEditorPreviewQuality(quality).catch((error) => {
+ console.error("Failed to set initial editor preview quality", error);
+ });
+ });
+
+ const setPreviewQuality = (quality: PreviewQuality) => {
+ _setPreviewQuality(quality);
+ generalSettingsStore
+ .set({ editorPreviewQuality: quality })
+ .catch((error) => {
+ console.error("Failed to persist preview quality setting", error);
+ });
+ commands.setEditorPreviewQuality(quality).catch((error) => {
+ console.error("Failed to update editor preview quality", error);
+ });
+ };
+
const previewResolutionBase = () => getPreviewResolution(previewQuality());
const [dialog, setDialog] = createSignal<DialogState>({
diff --git a/apps/desktop/src/utils/socket.ts b/apps/desktop/src/utils/socket.ts
index a4a58cc76..af7ae32bc 100644
--- a/apps/desktop/src/utils/socket.ts
+++ b/apps/desktop/src/utils/socket.ts
@@ -191,7 +191,13 @@ export function createImageDataWS(
let mainThreadWebGPUInitializing = false;
let pendingNv12Frame: ArrayBuffer | null = null;
- let lastRenderedImageData: ImageData | null = null;
+ let lastRenderedFrameData: {
+ data: Uint8ClampedArray;
+ width: number;
+ height: number;
+ yStride: number;
+ isNv12: boolean;
+ } | null = null;
function cleanup() {
if (isCleanedUp) return;
@@ -228,7 +234,7 @@ export function createImageDataWS(
cachedStrideWidth = 0;
cachedStrideHeight = 0;
- lastRenderedImageData = null;
+ lastRenderedFrameData = null;
setIsConnected(false);
}
@@ -271,17 +277,13 @@ export function createImageDataWS(
yStride,
);
- const rgba = convertNv12ToRgbaMainThread(
- frameData,
+ lastRenderedFrameData = {
+ data: new Uint8ClampedArray(frameData),
width,
height,
yStride,
- );
- lastRenderedImageData = new ImageData(
- new Uint8ClampedArray(rgba),
- width,
- height,
- );
+ isNv12: true,
+ };
if (!hasRenderedFrame()) {
setHasRenderedFrame(true);
@@ -332,7 +334,14 @@ export function createImageDataWS(
height,
);
directCtx.putImageData(imageData, 0, 0);
- lastRenderedImageData = imageData;
+
+ lastRenderedFrameData = {
+ data: new Uint8ClampedArray(frameData),
+ width,
+ height,
+ yStride,
+ isNv12: true,
+ };
if (!hasRenderedFrame()) {
setHasRenderedFrame(true);
@@ -420,11 +429,14 @@ export function createImageDataWS(
}
cachedStrideImageData.data.set(frameData);
directCtx.putImageData(cachedStrideImageData, 0, 0);
- lastRenderedImageData = new ImageData(
- new Uint8ClampedArray(cachedStrideImageData.data),
+
+ lastRenderedFrameData = {
+ data: new Uint8ClampedArray(cachedStrideImageData.data),
width,
height,
- );
+ yStride: width * 4,
+ isNv12: false,
+ };
if (!hasRenderedFrame()) {
setHasRenderedFrame(true);
@@ -436,17 +448,25 @@ export function createImageDataWS(
worker.postMessage({ type: "reset-frame-state" });
},
captureFrame: async () => {
- if (!lastRenderedImageData) {
+ if (!lastRenderedFrameData) {
return null;
}
+ const { data, width, height, yStride, isNv12 } = lastRenderedFrameData;
+ let imageData: ImageData;
+ if (isNv12) {
+ const rgba = convertNv12ToRgbaMainThread(data, width, height, yStride);
+ imageData = new ImageData(new Uint8ClampedArray(rgba), width, height);
+ } else {
+ imageData = new ImageData(new Uint8ClampedArray(data), width, height);
+ }
const canvas = document.createElement("canvas");
- canvas.width = lastRenderedImageData.width;
- canvas.height = lastRenderedImageData.height;
+ canvas.width = width;
+ canvas.height = height;
const ctx = canvas.getContext("2d");
if (!ctx) {
return null;
}
- ctx.putImageData(lastRenderedImageData, 0, 0);
+ ctx.putImageData(imageData, 0, 0);
return new Promise<Blob | null>((resolve) => {
canvas.toBlob((blob) => resolve(blob), "image/png");
});
@@ -643,17 +663,13 @@ export function createImageDataWS(
actualRendersCount++;
renderFrameCount++;
- const rgba = convertNv12ToRgbaMainThread(
- frameData,
+ lastRenderedFrameData = {
+ data: new Uint8ClampedArray(frameData),
width,
height,
yStride,
- );
- lastRenderedImageData = new ImageData(
- new Uint8ClampedArray(rgba),
- width,
- height,
- );
+ isNv12: true,
+ };
if (!hasRenderedFrame()) {
setHasRenderedFrame(true);
@@ -730,11 +746,14 @@ export function createImageDataWS(
}
cachedDirectImageData.data.set(rgbaData);
directCtx.putImageData(cachedDirectImageData, 0, 0);
- lastRenderedImageData = new ImageData(
- new Uint8ClampedArray(cachedDirectImageData.data),
+
+ lastRenderedFrameData = {
+ data: new Uint8ClampedArray(nv12Data),
width,
height,
- );
+ yStride,
+ isNv12: true,
+ };
actualRendersCount++;
renderFrameCount++;
@@ -821,11 +840,14 @@ export function createImageDataWS(
}
cachedDirectImageData.data.set(frameData);
directCtx.putImageData(cachedDirectImageData, 0, 0);
- lastRenderedImageData = new ImageData(
- new Uint8ClampedArray(cachedDirectImageData.data),
+
+ lastRenderedFrameData = {
+ data: new Uint8ClampedArray(cachedDirectImageData.data),
width,
height,
- );
+ yStride: width * 4,
+ isNv12: false,
+ };
renderFrameCount++;
if (!hasRenderedFrame()) {
diff --git a/apps/desktop/src/utils/tauri.ts b/apps/desktop/src/utils/tauri.ts
index 40623119e..4e6a428bf 100644
--- a/apps/desktop/src/utils/tauri.ts
+++ b/apps/desktop/src/utils/tauri.ts
@@ -137,6 +137,9 @@ async setPlayheadPosition(frameNumber: number) : Promise<null> {
async setProjectConfig(config: ProjectConfiguration) : Promise<null> {
return await TAURI_INVOKE("set_project_config", { config });
},
+async setEditorPreviewQuality(quality: EditorPreviewQuality) : Promise<void> {
+ await TAURI_INVOKE("set_editor_preview_quality", { quality });
+},
async updateProjectConfigInMemory(config: ProjectConfiguration, frameNumber: number | null, fps: number | null, resolutionBase: XY<number> | null) : Promise<null> {
return await TAURI_INVOKE("update_project_config_in_memory", { config, frameNumber, fps, resolutionBase });
},
@@ -372,7 +375,6 @@ uploadProgressEvent: "upload-progress-event"
/** user-defined types **/
-export type AllGpusInfo = { gpus: GpuInfoDiag[]; primaryGpuIndex: number | null; isMultiGpuSystem: boolean; hasDiscreteGpu: boolean }
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 }
export type AnnotationType = "arrow" | "circle" | "rectangle" | "text" | "mask"
export type AppTheme = "system" | "light" | "dark"
@@ -421,6 +423,7 @@ export type DevicesUpdated = { cameras: CameraInfo[]; microphones: string[]; per
export type DisplayId = string
export type DisplayInformation = { name: string | null; physical_size: PhysicalSize | null; logical_size: LogicalSize | null; refresh_rate: string }
export type DownloadProgress = { progress: number; message: string }
+export type EditorPreviewQuality = "quarter" | "half" | "full"
export type EditorStateChanged = { playhead_position: number }
export type ExportCompression = "Minimal" | "Social" | "Web" | "Potato"
export type ExportEstimates = { duration_seconds: number; estimated_time_seconds: number; estimated_size_mb: number }
@@ -430,7 +433,7 @@ export type ExportSettings = ({ format: "Mp4" } & Mp4ExportSettings) | ({ format
export type FileType = "recording" | "screenshot"
export type Flags = { captions: boolean }
export type FramesRendered = { renderedCount: number; totalFrames: number; type: "FramesRendered" }
-export type GeneralSettingsStore = { instanceId?: string; uploadIndividualFiles?: boolean; hideDockIcon?: boolean; autoCreateShareableLink?: boolean; enableNotifications?: boolean; disableAutoOpenLinks?: boolean; hasCompletedStartup?: boolean; theme?: AppTheme; commercialLicense?: CommercialLicense | null; lastVersion?: string | null; windowTransparency?: boolean; postStudioRecordingBehaviour?: PostStudioRecordingBehaviour; mainWindowRecordingStartBehaviour?: MainWindowRecordingStartBehaviour; custom_cursor_capture2?: boolean; serverUrl?: string; recordingCountdown?: number | null; enableNativeCameraPreview: boolean; autoZoomOnClicks?: boolean; postDeletionBehaviour?: PostDeletionBehaviour; excludedWindows?: WindowExclusion[]; deleteInstantRecordingsAfterUpload?: boolean; instantModeMaxResolution?: number; defaultProjectNameTemplate?: string | null; crashRecoveryRecording?: boolean; maxFps?: number }
+export type GeneralSettingsStore = { instanceId?: string; uploadIndividualFiles?: boolean; hideDockIcon?: boolean; autoCreateShareableLink?: boolean; enableNotifications?: boolean; disableAutoOpenLinks?: boolean; hasCompletedStartup?: boolean; theme?: AppTheme; commercialLicense?: CommercialLicense | null; lastVersion?: string | null; windowTransparency?: boolean; postStudioRecordingBehaviour?: PostStudioRecordingBehaviour; mainWindowRecordingStartBehaviour?: MainWindowRecordingStartBehaviour; custom_cursor_capture2?: boolean; serverUrl?: string; recordingCountdown?: number | null; enableNativeCameraPreview: boolean; autoZoomOnClicks?: boolean; postDeletionBehaviour?: PostDeletionBehaviour; excludedWindows?: WindowExclusion[]; deleteInstantRecordingsAfterUpload?: boolean; instantModeMaxResolution?: number; defaultProjectNameTemplate?: string | null; crashRecoveryRecording?: boolean; maxFps?: number; editorPreviewQuality?: EditorPreviewQuality }
export type GifExportSettings = { fps: number; resolution_base: XY<number>; quality: GifQuality | null }
export type GifQuality = {
/**
@@ -441,7 +444,6 @@ quality: number | null;
* Whether to prioritize speed over quality (default: false)
*/
fast: boolean | null }
-export type GpuInfoDiag = { vendor: string; description: string; dedicatedVideoMemoryMb: number; adapterIndex: number; isSoftwareAdapter: boolean; isBasicRenderDriver: boolean; supportsHardwareEncoding: boolean }
export type HapticPattern = "alignment" | "levelChange" | "generic"
export type HapticPerformanceTime = "default" | "now" | "drawCompleted"
export type Hotkey = { code: string; meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }
@@ -454,6 +456,7 @@ export type JsonValue<T> = [T]
export type LogicalBounds = { position: LogicalPosition; size: LogicalSize }
export type LogicalPosition = { x: number; y: number }
export type LogicalSize = { width: number; height: number }
+export type MacOSVersionInfo = { displayName: string }
export type MainWindowRecordingStartBehaviour = "close" | "minimise"
export type MaskKeyframes = { position?: MaskVectorKeyframe[]; size?: MaskVectorKeyframe[]; intensity?: MaskScalarKeyframe[] }
export type MaskKind = "sensitive" | "highlight"
@@ -496,7 +499,6 @@ export type RecordingStatus = "pending" | "recording"
export type RecordingStopped = null
export type RecordingTargetMode = "display" | "window" | "area"
export type RenderFrameEvent = { frame_number: number; fps: number; resolution_base: XY<number> }
-export type RenderingStatus = { isUsingSoftwareRendering: boolean; isUsingBasicRenderDriver: boolean; hardwareEncodingAvailable: boolean; warningMessage: string | null }
export type RequestOpenRecordingPicker = { target_mode: RecordingTargetMode | null }
export type RequestOpenSettings = { page: string }
export type RequestScreenCapturePrewarm = { force?: boolean }
@@ -517,7 +519,7 @@ export type StartRecordingInputs = { capture_target: ScreenCaptureTarget; captur
export type StereoMode = "stereo" | "monoL" | "monoR"
export type StudioRecordingMeta = { segment: SingleSegment } | { inner: MultipleSegments }
export type StudioRecordingStatus = { status: "InProgress" } | { status: "NeedsRemux" } | { status: "Failed"; error: string } | { status: "Complete" }
-export type SystemDiagnostics = { windowsVersion: WindowsVersionInfo | null; gpuInfo: GpuInfoDiag | null; allGpus: AllGpusInfo | null; renderingStatus: RenderingStatus; availableEncoders: string[]; graphicsCaptureSupported: boolean; d3D11VideoProcessorAvailable: boolean }
+export type SystemDiagnostics = { macosVersion: MacOSVersionInfo | null; availableEncoders: string[]; screenCaptureSupported: boolean }
export type TargetUnderCursor = { display_id: DisplayId | null; window: WindowUnderCursor | null }
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 }
export type TimelineConfiguration = { segments: TimelineSegment[]; zoomSegments: ZoomSegment[]; sceneSegments?: SceneSegment[]; maskSegments?: MaskSegment[]; textSegments?: TextSegment[] }
@@ -534,7 +536,6 @@ export type VideoUploadInfo = { id: string; link: string; config: S3UploadMeta }
export type WindowExclusion = { bundleIdentifier?: string | null; ownerName?: string | null; windowTitle?: string | null }
export type WindowId = string
export type WindowUnderCursor = { id: WindowId; app_name: string; bounds: LogicalBounds }
-export type WindowsVersionInfo = { major: number; minor: number; build: number; displayName: string; meetsRequirements: boolean; isWindows11: boolean }
export type XY<T> = { x: T; y: T }
export type ZoomMode = "auto" | { manual: { x: number; y: number } }
export type ZoomSegment = { start: number; end: number; amount: number; mode: ZoomMode }