Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

alpha 18

Brendan Allan6b092c99c6f7
diff --git a/Cargo.lock b/Cargo.lock
index a001bf99e..a70304f5f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1406,7 +1406,7 @@ dependencies = [
[[package]]
name = "desktop"
-version = "0.3.0-alpha.16"
+version = "0.3.0-alpha.18"
dependencies = [
"anyhow",
"axum",
diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml
index b2767a6c6..8b2d54dad 100644
--- a/apps/desktop/src-tauri/Cargo.toml
+++ b/apps/desktop/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "desktop"
-version = "0.3.0-alpha.17"
+version = "0.3.0-alpha.18"
description = "Effortless, instant screen sharing. Open source and cross-platform."
authors = ["you"]
edition = "2021"
diff --git a/apps/desktop/src-tauri/src/editor_instance.rs b/apps/desktop/src-tauri/src/editor_instance.rs
index 2e19a482c..e1e23132b 100644
--- a/apps/desktop/src-tauri/src/editor_instance.rs
+++ b/apps/desktop/src-tauri/src/editor_instance.rs
@@ -6,7 +6,7 @@ use cap_project::{ProjectConfiguration, RecordingMeta};
use cap_rendering::decoder::AsyncVideoDecoder;
use cap_rendering::{ProjectUniforms, RecordingDecoders, RenderOptions, RenderVideoConstants};
use std::ops::Deref;
-use std::{path::PathBuf, process::Command, sync::Arc};
+use std::{path::PathBuf, sync::Arc};
use tokio::sync::{mpsc, watch, Mutex};
type PreviewFrameInstruction = (u32, ProjectConfiguration);
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index 3b645d407..44fce599e 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -34,7 +34,7 @@ use std::{
collections::HashMap, marker::PhantomData, path::PathBuf, process::Command, sync::Arc,
time::Duration,
};
-use tauri::{AppHandle, Manager, State, WebviewUrl, WebviewWindow, WindowEvent, Wry};
+use tauri::{AppHandle, Manager, State, WebviewUrl, WebviewWindow, WindowEvent};
use tauri_nspanel::{cocoa::appkit::NSMainMenuWindowLevel, ManagerExt};
use tauri_plugin_decorum::WebviewWindowExt;
use tauri_specta::Event;
@@ -678,11 +678,11 @@ async fn create_editor_instance(
frames_socket_url: format!("ws://localhost:{}{FRAMES_WS_PATH}", editor_instance.ws_port),
recording_duration: editor_instance.recordings.duration(),
saved_project_config: std::fs::read_to_string(
- &editor_instance.project_path.join("project-config.json"),
+ editor_instance.project_path.join("project-config.json"),
)
.ok()
.and_then(|s| serde_json::from_str(&s).ok()),
- recordings: editor_instance.recordings.clone(),
+ recordings: editor_instance.recordings,
path: editor_instance.project_path.clone(),
})
}
@@ -1244,8 +1244,8 @@ struct RecordingMetaChanged {
#[tauri::command(async)]
#[specta::specta]
fn get_recording_meta(app: AppHandle, id: String) -> RecordingMeta {
- let meta = RecordingMeta::load_for_project(&recording_path(&app, &id)).unwrap();
- meta
+
+ RecordingMeta::load_for_project(&recording_path(&app, &id)).unwrap()
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
@@ -1343,7 +1343,7 @@ pub fn run() {
tray::create_tray(&app_handle).unwrap();
- let _window = create_in_progress_recording_window(&app.app_handle());
+ create_in_progress_recording_window(app.app_handle());
RequestStopRecording::listen_any(app, move |_| {
let app_handle = app_handle.clone();
diff --git a/apps/desktop/src-tauri/src/updater.rs b/apps/desktop/src-tauri/src/updater.rs
index 31399ec8c..30129b7f3 100644
--- a/apps/desktop/src-tauri/src/updater.rs
+++ b/apps/desktop/src-tauri/src/updater.rs
@@ -1,6 +1,5 @@
-use std::time::Duration;
-use tauri::{AppHandle, Manager};
+use tauri::AppHandle;
use tauri_plugin_dialog::DialogExt;
use tauri_plugin_updater::UpdaterExt;
@@ -61,5 +60,5 @@ pub async fn check_for_updates(app: AppHandle) -> Result<(), ()> {
app.restart();
}
- return Ok(());
+ Ok(())
}
diff --git a/apps/desktop/src-tauri/src/upload.rs b/apps/desktop/src-tauri/src/upload.rs
index 6da895ba7..6c9438fb3 100644
--- a/apps/desktop/src-tauri/src/upload.rs
+++ b/apps/desktop/src-tauri/src/upload.rs
@@ -105,10 +105,10 @@ pub async fn upload_video(
status,
error_body
);
- return Err(format!(
+ Err(format!(
"Failed to upload file. Status: {}. Body: {}",
status, error_body
- ));
+ ))
}
async fn get_s3_config(
@@ -201,7 +201,7 @@ fn build_video_upload_body(
let stream = input
.streams()
.best(ffmpeg_next::media::Type::Video)
- .ok_or_else(|| format!("Failed to find appropriate video stream in file"))?;
+ .ok_or_else(|| "Failed to find appropriate video stream in file".to_string())?;
let duration_millis = input.duration() as f64 / 1000.;
diff --git a/crates/ffmpeg/src/lib.rs b/crates/ffmpeg/src/lib.rs
index 7989b9b62..409acba20 100644
--- a/crates/ffmpeg/src/lib.rs
+++ b/crates/ffmpeg/src/lib.rs
@@ -239,10 +239,16 @@ pub struct FFmpeg {
source_index: u8,
}
+impl Default for FFmpeg {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl FFmpeg {
pub fn new() -> Self {
Self {
- command: Command::new(dbg!(relative_command_path("ffmpeg").unwrap())).into(),
+ command: Command::new(dbg!(relative_command_path("ffmpeg").unwrap())),
source_index: 0,
}
}
diff --git a/crates/rendering/src/decoder.rs b/crates/rendering/src/decoder.rs
index 71f1ee6bb..6396fb18d 100644
--- a/crates/rendering/src/decoder.rs
+++ b/crates/rendering/src/decoder.rs
@@ -3,7 +3,6 @@ use std::{
collections::BTreeMap,
path::PathBuf,
ptr::{null, null_mut},
- slice,
sync::{mpsc, Arc},
};
@@ -226,7 +225,7 @@ impl AsyncVideoDecoder {
let width = rgb_frame.width() as usize;
let height = rgb_frame.height() as usize;
- let stride = rgb_frame.stride(0) as usize;
+ let stride = rgb_frame.stride(0);
let data = rgb_frame.data(0);
let expected_size = width * height * 4;