Skip to main content

Module camera_ipc

Module camera_ipc 

Source
Expand description

JS-bridge bindings for the M-CAM.2 Tauri camera commands (M-CAM.4 / AUT-258 + M-REC.1 / AUT-260).

Mirrors crate::player_ipc for the camera surface. Each function invokes a __screen* helper declared in index.html’s inline script, which in turn wraps window.__TAURI__.core.invoke(...).

The returned values come back as JsValue and are deserialised into typed Rust structs via serde_wasm_bindgen — the same pattern the player IPC layer uses.

Structs§

AllPermissionsResult
Result of request_all_permissions — final TCC status for each protected resource.
CameraView
Mirror of crates/app/src/commands.rs::CameraView (M-CAM.2).

Enums§

CameraPermission
Mirror of crates/app/src/commands.rs::CameraPermission (M-CAM.2).

Functions§

camera_permission_status
Async helper: probe OS camera permission state.
camera_permission_status_js
__screenCameraPermissionStatus() in index.html — returns Promise<CameraPermission>.
list_cameras
Async helper: list every camera the OS exposes.
list_cameras_js
__screenListCameras() in index.html — returns Promise<CameraView[]>.
open_settings_camera
Async helper: shell out to open System Settings → Camera (M-RECP.0 / AUT-261). Silently no-ops outside Tauri (so trunk serve dev doesn’t error on click) and silently swallows spawn errors — the user-facing “tell me if I can’t open this” case is rare enough that surfacing it adds more noise than value.
open_settings_camera_js
__screenOpenSettingsCamera() (M-RECP.0 / AUT-261) — shells out to open System Settings → Privacy & Security → Camera.
request_all_permissions
Async helper: fire the macOS TCC prompts (M-PIX.9). Returns the post-prompt statuses. Outside Tauri this returns Granted for every channel so the picker UX in trunk serve is unaffected.
request_all_permissions_js
__screenRequestAllPermissions() (M-PIX.9) — fires the macOS TCC prompts for Camera + Mic + Screen Recording. Returns { camera, microphone, screen_recording } statuses.
start_preview
Async helper: kick off start_preview for the given camera id.
start_preview_js
__screenStartPreview(cameraId) in index.html — returns Promise<void>.
stop_preview
Async helper: tear down the active preview.
stop_preview_js
__screenStopPreview() in index.html — returns Promise<void>.