Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: Recording issue on varying resolutions + optimized thumbnail

Richie McIlroyc92840d9500f
diff --git a/apps/desktop/src-tauri/Cargo.lock b/apps/desktop/src-tauri/Cargo.lock
index f54a795f9..ea99b9d36 100644
--- a/apps/desktop/src-tauri/Cargo.lock
+++ b/apps/desktop/src-tauri/Cargo.lock
@@ -2,6 +2,22 @@
# It is not intended for manual editing.
version = 3
+[[package]]
+name = "ab_glyph"
+version = "0.2.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225"
+dependencies = [
+ "ab_glyph_rasterizer",
+ "owned_ttf_parser",
+]
+
+[[package]]
+name = "ab_glyph_rasterizer"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046"
+
[[package]]
name = "addr2line"
version = "0.21.0"
@@ -17,6 +33,19 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+[[package]]
+name = "ahash"
+version = "0.8.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
+dependencies = [
+ "cfg-if",
+ "getrandom 0.2.12",
+ "once_cell",
+ "version_check",
+ "zerocopy",
+]
+
[[package]]
name = "aho-corasick"
version = "1.1.2"
@@ -63,6 +92,33 @@ dependencies = [
"pkg-config",
]
+[[package]]
+name = "android-activity"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289"
+dependencies = [
+ "android-properties",
+ "bitflags 2.4.2",
+ "cc",
+ "cesu8",
+ "jni 0.21.1",
+ "jni-sys",
+ "libc",
+ "log",
+ "ndk 0.8.0",
+ "ndk-context",
+ "ndk-sys 0.5.0+25.2.9519653",
+ "num_enum 0.7.2",
+ "thiserror",
+]
+
+[[package]]
+name = "android-properties"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04"
+
[[package]]
name = "android-tzdata"
version = "0.1.1"
@@ -99,11 +155,29 @@ dependencies = [
"objc_id",
"parking_lot",
"thiserror",
- "winapi 0.3.9",
+ "winapi",
"wl-clipboard-rs",
- "x11rb",
+ "x11rb 0.12.0",
]
+[[package]]
+name = "arrayref"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
+
+[[package]]
+name = "arrayvec"
+version = "0.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
+
+[[package]]
+name = "as-raw-xcb-connection"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b"
+
[[package]]
name = "async-broadcast"
version = "0.5.1"
@@ -161,7 +235,7 @@ checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af"
dependencies = [
"async-lock 2.8.0",
"autocfg",
- "cfg-if 1.0.0",
+ "cfg-if",
"concurrent-queue",
"futures-lite 1.13.0",
"log",
@@ -180,7 +254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65"
dependencies = [
"async-lock 3.3.0",
- "cfg-if 1.0.0",
+ "cfg-if",
"concurrent-queue",
"futures-io",
"futures-lite 2.2.0",
@@ -222,7 +296,7 @@ dependencies = [
"async-lock 2.8.0",
"async-signal",
"blocking",
- "cfg-if 1.0.0",
+ "cfg-if",
"event-listener 3.1.0",
"futures-lite 1.13.0",
"rustix 0.38.30",
@@ -249,7 +323,7 @@ dependencies = [
"async-io 2.3.1",
"async-lock 2.8.0",
"atomic-waker",
- "cfg-if 1.0.0",
+ "cfg-if",
"futures-core",
"futures-io",
"rustix 0.38.30",
@@ -319,7 +393,7 @@ checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
dependencies = [
"addr2line",
"cc",
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"miniz_oxide",
"object",
@@ -391,6 +465,25 @@ dependencies = [
"generic-array",
]
+[[package]]
+name = "block-sys"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7"
+dependencies = [
+ "objc-sys",
+]
+
+[[package]]
+name = "block2"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68"
+dependencies = [
+ "block-sys",
+ "objc2",
+]
+
[[package]]
name = "blocking"
version = "1.5.1"
@@ -489,6 +582,32 @@ dependencies = [
"system-deps 6.2.0",
]
+[[package]]
+name = "calloop"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298"
+dependencies = [
+ "bitflags 2.4.2",
+ "log",
+ "polling 3.3.2",
+ "rustix 0.38.30",
+ "slab",
+ "thiserror",
+]
+
+[[package]]
+name = "calloop-wayland-source"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02"
+dependencies = [
+ "calloop",
+ "rustix 0.38.30",
+ "wayland-backend",
+ "wayland-client",
+]
+
[[package]]
name = "cap"
version = "0.0.0"
@@ -503,6 +622,7 @@ dependencies = [
"fix-path-env",
"futures",
"image",
+ "jpeg-encoder",
"regex",
"reqwest",
"sentry",
@@ -519,6 +639,7 @@ dependencies = [
"which",
"window-shadows",
"window-vibrancy",
+ "winit",
]
[[package]]
@@ -526,9 +647,9 @@ name = "capture"
version = "0.0.1"
dependencies = [
"block",
- "cfg-if 0.1.10",
+ "cfg-if",
"libc",
- "winapi 0.2.8",
+ "winapi",
]
[[package]]
@@ -598,15 +719,15 @@ dependencies = [
[[package]]
name = "cfg-if"
-version = "0.1.10"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
-name = "cfg-if"
-version = "1.0.0"
+name = "cfg_aliases"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
[[package]]
name = "chrono"
@@ -642,7 +763,7 @@ checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362"
dependencies = [
"error-code",
"str-buf",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -835,7 +956,7 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -925,6 +1046,12 @@ dependencies = [
"syn 2.0.48",
]
+[[package]]
+name = "cursor-icon"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991"
+
[[package]]
name = "darling"
version = "0.20.4"
@@ -1046,7 +1173,7 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"dirs-sys-next",
]
@@ -1070,7 +1197,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
dependencies = [
"libc",
"redox_users",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -1176,7 +1303,7 @@ version = "0.8.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -1326,9 +1453,9 @@ version = "0.2.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
- "redox_syscall",
+ "redox_syscall 0.4.1",
"windows-sys 0.52.0",
]
@@ -1341,7 +1468,7 @@ dependencies = [
"cc",
"lazy_static",
"libc",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -1687,7 +1814,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177"
dependencies = [
"libc",
- "winapi 0.3.9",
+ "winapi",
+]
+
+[[package]]
+name = "gethostname"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818"
+dependencies = [
+ "libc",
+ "windows-targets 0.48.5",
]
[[package]]
@@ -1696,7 +1833,7 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"wasi 0.9.0+wasi-snapshot-preview1",
]
@@ -1707,7 +1844,7 @@ version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
]
@@ -1755,7 +1892,7 @@ dependencies = [
"gobject-sys",
"libc",
"system-deps 6.2.0",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -1972,7 +2109,7 @@ checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867"
dependencies = [
"libc",
"match_cfg",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -2099,6 +2236,17 @@ dependencies = [
"png",
]
+[[package]]
+name = "icrate"
+version = "0.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319"
+dependencies = [
+ "block2",
+ "dispatch",
+ "objc2",
+]
+
[[package]]
name = "ident_case"
version = "1.0.1"
@@ -2186,7 +2334,7 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -2195,11 +2343,11 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81f2533f3be42fffe3b5e63b71aeca416c1c3bc33e4e27be018521e76b1f38fb"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"rustc_version",
"to_method",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -2291,6 +2439,22 @@ dependencies = [
"walkdir",
]
+[[package]]
+name = "jni"
+version = "0.21.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
+dependencies = [
+ "cesu8",
+ "cfg-if",
+ "combine",
+ "jni-sys",
+ "log",
+ "thiserror",
+ "walkdir",
+ "windows-sys 0.45.0",
+]
+
[[package]]
name = "jni-sys"
version = "0.3.0"
@@ -2315,6 +2479,12 @@ dependencies = [
"rayon",
]
+[[package]]
+name = "jpeg-encoder"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2fefe5a4fb12fa836172dc53cc36c37af693f6197ae702f931faad8774caf926"
+
[[package]]
name = "js-sys"
version = "0.3.67"
@@ -2393,9 +2563,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.152"
+version = "0.2.153"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
+checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "libloading"
@@ -2403,8 +2573,8 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
dependencies = [
- "cfg-if 1.0.0",
- "winapi 0.3.9",
+ "cfg-if",
+ "winapi",
]
[[package]]
@@ -2413,7 +2583,7 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"windows-sys 0.48.0",
]
@@ -2425,7 +2595,18 @@ checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8"
dependencies = [
"bitflags 2.4.2",
"libc",
- "redox_syscall",
+ "redox_syscall 0.4.1",
+]
+
+[[package]]
+name = "libredox"
+version = "0.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607"
+dependencies = [
+ "bitflags 2.4.2",
+ "libc",
+ "redox_syscall 0.4.1",
]
[[package]]
@@ -2471,7 +2652,7 @@ version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"generator",
"scoped-tls",
"serde",
@@ -2558,6 +2739,15 @@ version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
+[[package]]
+name = "memmap2"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "memoffset"
version = "0.7.1"
@@ -2646,7 +2836,7 @@ dependencies = [
"bitflags 1.3.2",
"jni-sys",
"ndk-sys 0.3.0",
- "num_enum",
+ "num_enum 0.5.11",
"thiserror",
]
@@ -2659,8 +2849,23 @@ dependencies = [
"bitflags 1.3.2",
"jni-sys",
"ndk-sys 0.4.1+23.1.7779620",
- "num_enum",
- "raw-window-handle",
+ "num_enum 0.5.11",
+ "raw-window-handle 0.5.2",
+ "thiserror",
+]
+
+[[package]]
+name = "ndk"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7"
+dependencies = [
+ "bitflags 2.4.2",
+ "jni-sys",
+ "log",
+ "ndk-sys 0.5.0+25.2.9519653",
+ "num_enum 0.7.2",
+ "raw-window-handle 0.6.0",
"thiserror",
]
@@ -2688,6 +2893,15 @@ dependencies = [
"jni-sys",
]
+[[package]]
+name = "ndk-sys"
+version = "0.5.0+25.2.9519653"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691"
+dependencies = [
+ "jni-sys",
+]
+
[[package]]
name = "new_debug_unreachable"
version = "1.0.4"
@@ -2701,7 +2915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069"
dependencies = [
"bitflags 1.3.2",
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
]
@@ -2712,7 +2926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
dependencies = [
"bitflags 1.3.2",
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"memoffset 0.7.1",
"pin-utils",
@@ -2754,7 +2968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
dependencies = [
"overload",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -2793,7 +3007,16 @@ version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9"
dependencies = [
- "num_enum_derive",
+ "num_enum_derive 0.5.11",
+]
+
+[[package]]
+name = "num_enum"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
+dependencies = [
+ "num_enum_derive 0.7.2",
]
[[package]]
@@ -2808,6 +3031,18 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "num_enum_derive"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
+dependencies = [
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.48",
+]
+
[[package]]
name = "objc"
version = "0.2.7"
@@ -2924,7 +3159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8"
dependencies = [
"bitflags 2.4.2",
- "cfg-if 1.0.0",
+ "cfg-if",
"foreign-types 0.3.2",
"libc",
"once_cell",
@@ -2967,6 +3202,15 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
+[[package]]
+name = "orbclient"
+version = "0.3.47"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166"
+dependencies = [
+ "libredox 0.0.2",
+]
+
[[package]]
name = "ordered-stream"
version = "0.2.0"
@@ -2985,7 +3229,7 @@ checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e"
dependencies = [
"log",
"serde",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -3004,6 +3248,15 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
+[[package]]
+name = "owned_ttf_parser"
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7"
+dependencies = [
+ "ttf-parser",
+]
+
[[package]]
name = "pango"
version = "0.15.10"
@@ -3051,9 +3304,9 @@ version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
- "redox_syscall",
+ "redox_syscall 0.4.1",
"smallvec",
"windows-targets 0.48.5",
]
@@ -3278,7 +3531,7 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce"
dependencies = [
"autocfg",
"bitflags 1.3.2",
- "cfg-if 1.0.0",
+ "cfg-if",
"concurrent-queue",
"libc",
"log",
@@ -3292,7 +3545,7 @@ version = "3.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"concurrent-queue",
"pin-project-lite",
"rustix 0.38.30",
@@ -3490,6 +3743,12 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9"
+[[package]]
+name = "raw-window-handle"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544"
+
[[package]]
name = "rayon"
version = "1.8.1"
@@ -3510,6 +3769,15 @@ dependencies = [
"crossbeam-utils",
]
+[[package]]
+name = "redox_syscall"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
+dependencies = [
+ "bitflags 1.3.2",
+]
+
[[package]]
name = "redox_syscall"
version = "0.4.1"
@@ -3526,7 +3794,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4"
dependencies = [
"getrandom 0.2.12",
- "libredox",
+ "libredox 0.0.1",
"thiserror",
]
@@ -3632,7 +3900,7 @@ dependencies = [
"objc",
"objc-foundation",
"objc_id",
- "raw-window-handle",
+ "raw-window-handle 0.5.2",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
@@ -3735,6 +4003,19 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+[[package]]
+name = "sctk-adwaita"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550"
+dependencies = [
+ "ab_glyph",
+ "log",
+ "memmap2",
+ "smithay-client-toolkit",
+ "tiny-skia",
+]
+
[[package]]
name = "security-framework"
version = "2.9.2"
@@ -4026,7 +4307,7 @@ version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"cpufeatures",
"digest",
]
@@ -4037,7 +4318,7 @@ version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"cpufeatures",
"digest",
]
@@ -4058,7 +4339,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef"
dependencies = [
"libc",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -4103,6 +4384,40 @@ version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
+[[package]]
+name = "smithay-client-toolkit"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a"
+dependencies = [
+ "bitflags 2.4.2",
+ "calloop",
+ "calloop-wayland-source",
+ "cursor-icon",
+ "libc",
+ "log",
+ "memmap2",
+ "rustix 0.38.30",
+ "thiserror",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-csd-frame",
+ "wayland-cursor",
+ "wayland-protocols",
+ "wayland-protocols-wlr",
+ "wayland-scanner",
+ "xkeysym",
+]
+
+[[package]]
+name = "smol_str"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "socket2"
version = "0.4.10"
@@ -4110,7 +4425,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
dependencies = [
"libc",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -4187,6 +4502,12 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0"
+[[package]]
+name = "strict-num"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
+
[[package]]
name = "string_cache"
version = "0.8.7"
@@ -4348,7 +4669,7 @@ dependencies = [
"once_cell",
"parking_lot",
"png",
- "raw-window-handle",
+ "raw-window-handle 0.5.2",
"scopeguard",
"serde",
"tao-macros",
@@ -4418,7 +4739,7 @@ dependencies = [
"os_pipe",
"percent-encoding",
"rand 0.8.5",
- "raw-window-handle",
+ "raw-window-handle 0.5.2",
"regex",
"reqwest",
"rfd",
@@ -4522,7 +4843,7 @@ dependencies = [
"serde",
"tauri",
"time",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -4574,7 +4895,7 @@ dependencies = [
"http",
"http-range",
"rand 0.8.5",
- "raw-window-handle",
+ "raw-window-handle 0.5.2",
"serde",
"serde_json",
"tauri-utils",
@@ -4596,7 +4917,7 @@ dependencies = [
"gtk",
"percent-encoding",
"rand 0.8.5",
- "raw-window-handle",
+ "raw-window-handle 0.5.2",
"tauri-runtime",
"tauri-utils",
"uuid",
@@ -4662,9 +4983,9 @@ version = "3.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"fastrand 2.0.1",
- "redox_syscall",
+ "redox_syscall 0.4.1",
"rustix 0.38.30",
"windows-sys 0.52.0",
]
@@ -4712,7 +5033,7 @@ version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"once_cell",
]
@@ -4756,6 +5077,31 @@ dependencies = [
"time-core",
]
+[[package]]
+name = "tiny-skia"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"
+dependencies = [
+ "arrayref",
+ "arrayvec",
+ "bytemuck",
+ "cfg-if",
+ "log",
+ "tiny-skia-path",
+]
+
+[[package]]
+name = "tiny-skia-path"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"
+dependencies = [
+ "arrayref",
+ "bytemuck",
+ "strict-num",
+]
+
[[package]]
name = "tinyvec"
version = "1.6.0"
@@ -4995,6 +5341,12 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+[[package]]
+name = "ttf-parser"
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4"
+
[[package]]
name = "typenum"
version = "1.17.0"
@@ -5009,7 +5361,7 @@ checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"
dependencies = [
"memoffset 0.9.0",
"tempfile",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -5217,7 +5569,7 @@ version = "0.2.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"wasm-bindgen-macro",
]
@@ -5242,7 +5594,7 @@ version = "0.4.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"js-sys",
"wasm-bindgen",
"web-sys",
@@ -5316,6 +5668,28 @@ dependencies = [
"wayland-scanner",
]
+[[package]]
+name = "wayland-csd-frame"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
+dependencies = [
+ "bitflags 2.4.2",
+ "cursor-icon",
+ "wayland-backend",
+]
+
+[[package]]
+name = "wayland-cursor"
+version = "0.31.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba"
+dependencies = [
+ "rustix 0.38.30",
+ "wayland-client",
+ "xcursor",
+]
+
[[package]]
name = "wayland-protocols"
version = "0.31.2"
@@ -5328,6 +5702,19 @@ dependencies = [
"wayland-scanner",
]
+[[package]]
+name = "wayland-protocols-plasma"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479"
+dependencies = [
+ "bitflags 2.4.2",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-scanner",
+]
+
[[package]]
name = "wayland-protocols-wlr"
version = "0.2.0"
@@ -5360,6 +5747,7 @@ checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af"
dependencies = [
"dlib",
"log",
+ "once_cell",
"pkg-config",
]
@@ -5373,6 +5761,16 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "web-time"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
[[package]]
name = "webkit2gtk"
version = "0.18.2"
@@ -5476,12 +5874,6 @@ dependencies = [
"rustix 0.38.30",
]
-[[package]]
-name = "winapi"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
-
[[package]]
name = "winapi"
version = "0.3.9"
@@ -5504,7 +5896,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
dependencies = [
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -5513,7 +5905,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e"
dependencies = [
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -5530,7 +5922,7 @@ checksum = "67ff424735b1ac21293b0492b069394b0a189c8a463fb015a16dea7c2e221c08"
dependencies = [
"cocoa 0.25.0",
"objc",
- "raw-window-handle",
+ "raw-window-handle 0.5.2",
"windows-sys 0.48.0",
]
@@ -5542,7 +5934,7 @@ checksum = "af6abc2b9c56bd95887825a1ce56cde49a2a97c07e28db465d541f5098a2656c"
dependencies = [
"cocoa 0.25.0",
"objc",
- "raw-window-handle",
+ "raw-window-handle 0.5.2",
"windows-sys 0.52.0",
"windows-version",
]
@@ -5934,6 +6326,54 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
+[[package]]
+name = "winit"
+version = "0.29.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca"
+dependencies = [
+ "ahash",
+ "android-activity",
+ "atomic-waker",
+ "bitflags 2.4.2",
+ "bytemuck",
+ "calloop",
+ "cfg_aliases",
+ "core-foundation",
+ "core-graphics 0.23.1",
+ "cursor-icon",
+ "icrate",
+ "js-sys",
+ "libc",
+ "log",
+ "memmap2",
+ "ndk 0.8.0",
+ "ndk-sys 0.5.0+25.2.9519653",
+ "objc2",
+ "once_cell",
+ "orbclient",
+ "percent-encoding",
+ "raw-window-handle 0.6.0",
+ "redox_syscall 0.3.5",
+ "rustix 0.38.30",
+ "sctk-adwaita",
+ "smithay-client-toolkit",
+ "smol_str",
+ "unicode-segmentation",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-protocols-plasma",
+ "web-sys",
+ "web-time",
+ "windows-sys 0.48.0",
+ "x11-dl",
+ "x11rb 0.13.0",
+ "xkbcommon-dl",
+]
+
[[package]]
name = "winnow"
version = "0.5.35"
@@ -5949,7 +6389,7 @@ version = "0.50.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"windows-sys 0.48.0",
]
@@ -5959,7 +6399,7 @@ version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"windows-sys 0.48.0",
]
@@ -5969,7 +6409,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"windows-sys 0.48.0",
]
@@ -6058,11 +6498,26 @@ version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a"
dependencies = [
- "gethostname",
+ "gethostname 0.3.0",
"nix 0.26.4",
- "winapi 0.3.9",
+ "winapi",
"winapi-wsapoll",
- "x11rb-protocol",
+ "x11rb-protocol 0.12.0",
+]
+
+[[package]]
+name = "x11rb"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a"
+dependencies = [
+ "as-raw-xcb-connection",
+ "gethostname 0.4.3",
+ "libc",
+ "libloading 0.8.1",
+ "once_cell",
+ "rustix 0.38.30",
+ "x11rb-protocol 0.13.0",
]
[[package]]
@@ -6074,6 +6529,12 @@ dependencies = [
"nix 0.26.4",
]
+[[package]]
+name = "x11rb-protocol"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34"
+
[[package]]
name = "xattr"
version = "1.3.1"
@@ -6085,6 +6546,12 @@ dependencies = [
"rustix 0.38.30",
]
+[[package]]
+name = "xcursor"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911"
+
[[package]]
name = "xdg-home"
version = "1.0.0"
@@ -6092,9 +6559,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd"
dependencies = [
"nix 0.26.4",
- "winapi 0.3.9",
+ "winapi",
]
+[[package]]
+name = "xkbcommon-dl"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5"
+dependencies = [
+ "bitflags 2.4.2",
+ "dlib",
+ "log",
+ "once_cell",
+ "xkeysym",
+]
+
+[[package]]
+name = "xkeysym"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621"
+
[[package]]
name = "zbus"
version = "3.14.1"
@@ -6129,7 +6615,7 @@ dependencies = [
"static_assertions",
"tracing",
"uds_windows",
- "winapi 0.3.9",
+ "winapi",
"xdg-home",
"zbus_macros",
"zbus_names",
@@ -6161,6 +6647,26 @@ dependencies = [
"zvariant",
]
+[[package]]
+name = "zerocopy"
+version = "0.7.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
+dependencies = [
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.7.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.48",
+]
+
[[package]]
name = "zune-inflate"
version = "0.2.54"
diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml
index 35ebaa626..9f98613d6 100644
--- a/apps/desktop/src-tauri/Cargo.toml
+++ b/apps/desktop/src-tauri/Cargo.toml
@@ -39,6 +39,8 @@ capture = { path = "./src/capture" }
image = "0.24.9"
sentry = "0.32.2"
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs" }
+winit = "0.29.15"
+jpeg-encoder = "0.6.0"
[features]
# this feature is used for production builds or when `devPath` points to the filesystem
diff --git a/apps/desktop/src-tauri/src/capture/Cargo.lock b/apps/desktop/src-tauri/src/capture/Cargo.lock
index 794c627da..d3259735c 100644
--- a/apps/desktop/src-tauri/src/capture/Cargo.lock
+++ b/apps/desktop/src-tauri/src/capture/Cargo.lock
@@ -20,9 +20,9 @@ dependencies = [
[[package]]
name = "cfg-if"
-version = "0.1.10"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "libc"
@@ -32,6 +32,22 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "winapi"
-version = "0.2.8"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/apps/desktop/src-tauri/src/capture/Cargo.toml b/apps/desktop/src-tauri/src/capture/Cargo.toml
index da873ddea..3aa768672 100644
--- a/apps/desktop/src-tauri/src/capture/Cargo.toml
+++ b/apps/desktop/src-tauri/src/capture/Cargo.toml
@@ -4,7 +4,7 @@ description = "Bindings for cross-platform screen capture."
version = "0.0.1"
[dependencies]
-block = "0.1"
-cfg-if = "0.1"
-libc = "0.2"
-winapi = "0.2"
\ No newline at end of file
+block = "0.1.6"
+cfg-if = "1.0.0"
+libc = "0.2.153"
+winapi = "0.3.9"
\ No newline at end of file
diff --git a/apps/desktop/src-tauri/src/capture/src/common/dxgi.rs b/apps/desktop/src-tauri/src/capture/src/common/dxgi.rs
index 55194a3a6..ec86cce12 100644
--- a/apps/desktop/src-tauri/src/capture/src/common/dxgi.rs
+++ b/apps/desktop/src-tauri/src/capture/src/common/dxgi.rs
@@ -11,9 +11,7 @@ pub struct Capturer {
unsafe impl Send for Capturer {}
impl Capturer {
- pub fn new(display: Display) -> io::Result<Capturer> {
- let width = display.width();
- let height = display.height();
+ pub fn new(display: Display, width: usize, height: usize) -> io::Result<Capturer> {
let inner = dxgi::Capturer::new(&display.0)?;
Ok(Capturer { inner, width, height })
}
diff --git a/apps/desktop/src-tauri/src/capture/src/common/quartz.rs b/apps/desktop/src-tauri/src/capture/src/common/quartz.rs
index 3004aeb69..3cb9a2ffa 100644
--- a/apps/desktop/src-tauri/src/capture/src/common/quartz.rs
+++ b/apps/desktop/src-tauri/src/capture/src/common/quartz.rs
@@ -11,14 +11,14 @@ pub struct Capturer {
unsafe impl Send for Capturer {}
impl Capturer {
- pub fn new(display: Display) -> io::Result<Capturer> {
+ pub fn new(display: Display, width: usize, height: usize) -> io::Result<Capturer> {
let frame = Arc::new(Mutex::new(None));
let f = frame.clone();
let inner = quartz::Capturer::new(
display.0,
- display.width(),
- display.height(),
+ width,
+ height,
quartz::PixelFormat::Argb8888,
Default::default(),
move |inner| {
diff --git a/apps/desktop/src-tauri/src/capture/src/common/x11.rs b/apps/desktop/src-tauri/src/capture/src/common/x11.rs
index fb8cbae93..401e3e306 100644
--- a/apps/desktop/src-tauri/src/capture/src/common/x11.rs
+++ b/apps/desktop/src-tauri/src/capture/src/common/x11.rs
@@ -7,7 +7,7 @@ pub struct Capturer(x11::Capturer);
unsafe impl Send for Capturer {}
impl Capturer {
- pub fn new(display: Display) -> io::Result<Capturer> {
+ pub fn new(display: Display, width: usize, height: usize) -> io::Result<Capturer> {
x11::Capturer::new(display.0).map(Capturer)
}
diff --git a/apps/desktop/src-tauri/src/capture/src/quartz/config.rs b/apps/desktop/src-tauri/src/capture/src/quartz/config.rs
index 76f1192dc..843a8e835 100644
--- a/apps/desktop/src-tauri/src/capture/src/quartz/config.rs
+++ b/apps/desktop/src-tauri/src/capture/src/quartz/config.rs
@@ -66,7 +66,7 @@ impl Default for Config {
Config {
cursor: true,
letterbox: true,
- throttle: 0.0166,
+ throttle: 0.001,
queue_length: 1
}
}
diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs
index e48bf64d6..141c93aaf 100644
--- a/apps/desktop/src-tauri/src/main.rs
+++ b/apps/desktop/src-tauri/src/main.rs
@@ -29,6 +29,8 @@ use ffmpeg_sidecar::{
version::ffmpeg_version,
};
+use winit::monitor::{MonitorHandle, VideoMode};
+
fn main() {
let _ = fix_path_env::fix();
@@ -117,6 +119,20 @@ fn main() {
..Default::default()
}));
+ let event_loop = winit::event_loop::EventLoop::new().expect("Failed to create event loop");
+ let monitor: MonitorHandle = event_loop.primary_monitor().expect("No primary monitor found");
+ let video_modes: Vec<VideoMode> = monitor.video_modes().collect();
+
+ let max_mode = video_modes.iter().max_by_key(|mode| mode.size().width * mode.size().height);
+
+ let (max_width, max_height) = if let Some(max_mode) = max_mode {
+ println!("Maximum resolution: {:?}", max_mode.size());
+ (max_mode.size().width, max_mode.size().height)
+ } else {
+ println!("Failed to determine maximum resolution.");
+ (0, 0)
+ };
+
tauri::Builder::default()
.plugin(tauri_plugin_oauth::init())
.plugin(tauri_plugin_positioner::init())
@@ -143,6 +159,8 @@ fn main() {
video_uploading_finished: Arc::new(AtomicBool::new(false)),
audio_uploading_finished: Arc::new(AtomicBool::new(false)),
data_dir: Some(data_directory),
+ max_screen_width: max_width as usize,
+ max_screen_height: max_height as usize,
};
app.manage(Arc::new(Mutex::new(recording_state)));
diff --git a/apps/desktop/src-tauri/src/media.rs b/apps/desktop/src-tauri/src/media.rs
index 0decde840..9a1324448 100644
--- a/apps/desktop/src-tauri/src/media.rs
+++ b/apps/desktop/src-tauri/src/media.rs
@@ -6,7 +6,8 @@ use std::sync::{Arc, atomic::{AtomicBool, Ordering}};
use std::io::{ErrorKind::WouldBlock, Error};
use std::time::{Instant, Duration};
use std::path::Path;
-use image::{ImageBuffer, Rgba};
+use image::{ImageBuffer, Rgba, ImageFormat};
+use image::codecs::jpeg::JpegEncoder;
use tokio::io::{AsyncWriteExt};
use tokio::process::{Command, Child, ChildStdin};
@@ -53,15 +54,25 @@ impl MediaRecorder {
}
}
- pub async fn start_media_recording(&mut self, options: RecordingOptions, audio_file_path: &str, video_file_path: &str, screenshot_file_path: &str, custom_device: Option<&str>) -> Result<(), String> {
+ pub async fn start_media_recording(&mut self, options: RecordingOptions, audio_file_path: &str, video_file_path: &str, screenshot_file_path: &str, custom_device: Option<&str>, max_screen_width: usize, max_screen_height: usize) -> Result<(), String> {
self.options = Some(options.clone());
println!("Custom device: {:?}", custom_device);
let host = cpal::default_host();
let devices = host.devices().expect("Failed to get devices");
- let display = Display::primary().map_err(|_| "Failed to find primary display".to_string())?;
- let (w, h) = (display.width(), display.height());
+
+ let mut w = max_screen_width;
+ let mut h = max_screen_height;
+
+ if max_screen_width > 4000 {
+ w = max_screen_width / 3;
+ h = max_screen_height / 3;
+ } else if max_screen_width > 2000 {
+ w = max_screen_width / 2;
+ h = max_screen_height / 2;
+ }
+
let adjusted_height = h & !1;
let capture_size = w * adjusted_height * 4;
let (audio_tx, audio_rx) = tokio::sync::mpsc::channel::<Vec<u8>>(2048);
@@ -273,7 +284,7 @@ impl MediaRecorder {
std::thread::spawn(move || {
println!("Starting video recording capture thread...");
- let mut capturer = Capturer::new(Display::primary().expect("Failed to find primary display")).expect("Failed to start capture");
+ let mut capturer = Capturer::new(Display::primary().expect("Failed to find primary display"), w.try_into().unwrap(), h.try_into().unwrap()).expect("Failed to start capture");
let fps = FRAME_RATE;
let spf = Duration::from_nanos(1_000_000_000 / fps);
@@ -297,60 +308,63 @@ impl MediaRecorder {
let frame_clone = frame.to_vec();
std::thread::spawn(move || {
- let mut frame_data = Vec::with_capacity(capture_size);
+ let mut frame_data = Vec::with_capacity(capture_size.try_into().unwrap());
let stride = w_cloned * 4;
println!("Frame length: {}", frame_clone.len());
println!("Stride: {}", stride);
let rt = tokio::runtime::Runtime::new().unwrap();
for row in 0..h {
- let start = row * stride;
- let end = start + stride;
+ let start: usize = row as usize * stride as usize;
+ let end: usize = start + stride as usize;
let mut row_data = frame_clone[start..end].to_vec();
for chunk in row_data.chunks_mut(4) {
chunk.swap(0, 2);
}
- //print the row data length
println!("Row data length: {}", row_data.len());
frame_data.extend_from_slice(&row_data);
}
let path = Path::new(&screenshot_file_path_owned_cloned);
let image: ImageBuffer<Rgba<u8>, Vec<u8>> = ImageBuffer::from_raw(
- w_cloned.try_into().unwrap(),
- h.try_into().unwrap(),
+ w_cloned.try_into().unwrap(),
+ h.try_into().unwrap(),
frame_data
).expect("Failed to create image buffer");
- match image.save_with_format(&path, image::ImageFormat::Jpeg) {
- Ok(_) => {
- rt.block_on(async {
- let upload_task = tokio::spawn(upload_file(Some(options_clone), screenshot_file_path_owned_cloned.clone(), "screenshot".to_string()));
- match upload_task.await {
- Ok(result) => {
- match result {
- Ok(_) => println!("Screenshot captured and saved to {:?}", path),
- Err(e) => eprintln!("Failed to upload file: {}", e),
- }
- },
- Err(e) => eprintln!("Failed to join task: {}", e),
- }
- });
- println!("Screenshot captured and saved to {:?}", path);
- },
- Err(e) => eprintln!("Failed to save screenshot: {}", e),
+
+ let mut output_file = std::fs::File::create(&path).expect("Failed to create output file");
+ let mut encoder = JpegEncoder::new_with_quality(&mut output_file, 20);
+
+ if let Err(e) = encoder.encode_image(&image) {
+ eprintln!("Failed to save screenshot: {}", e);
+ } else {
+ let screenshot_file_path_owned_cloned_copy = screenshot_file_path_owned_cloned.clone();
+ rt.block_on(async {
+ let upload_task = tokio::spawn(upload_file(Some(options_clone), screenshot_file_path_owned_cloned_copy.clone(), "screenshot".to_string()));
+ match upload_task.await {
+ Ok(result) => {
+ match result {
+ Ok(_) => println!("Screenshot captured and saved to {:?}", path),
+ Err(e) => eprintln!("Failed to upload file: {}", e),
+ }
+ },
+ Err(e) => eprintln!("Failed to join task: {}", e),
+ }
+ });
+ println!("Screenshot captured and saved to {:?}", path);
}
});
}
}
- let mut frame_data = Vec::with_capacity(capture_size);
+ let mut frame_data = Vec::with_capacity(capture_size.try_into().unwrap());
match capturer.frame() {
Ok(frame) => {
let stride = w * 4;
for row in 0..adjusted_height {
- let start = row * stride;
- let end = start + stride;
+ let start: usize = row as usize * stride as usize;
+ let end: usize = start + stride as usize;
frame_data.extend_from_slice(&frame[start..end]);
}
if let Some(sender) = &video_channel_sender {
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index bd6e272e5..30dd0a95a 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -21,7 +21,9 @@ pub struct RecordingState {
pub shutdown_flag: Arc<AtomicBool>,
pub video_uploading_finished: Arc<AtomicBool>,
pub audio_uploading_finished: Arc<AtomicBool>,
- pub data_dir: Option<PathBuf>
+ pub data_dir: Option<PathBuf>,
+ pub max_screen_width: usize,
+ pub max_screen_height: usize,
}
unsafe impl Send for RecordingState {}
@@ -69,7 +71,7 @@ pub async fn start_dual_recording(
Some(options.audio_name.clone())
};
- let media_recording_preparation = prepare_media_recording(&options, &audio_chunks_dir, &video_chunks_dir, &screenshot_dir, audio_name);
+ let media_recording_preparation = prepare_media_recording(&options, &audio_chunks_dir, &video_chunks_dir, &screenshot_dir, audio_name, state_guard.max_screen_width, state_guard.max_screen_height);
let media_recording_result = media_recording_preparation.await.map_err(|e| e.to_string())?;
state_guard.media_process = Some(media_recording_result);
@@ -216,11 +218,13 @@ async fn prepare_media_recording(
screenshot_dir: &Path,
video_chunks_dir: &Path,
audio_name: Option<String>,
+ max_screen_width: usize,
+ max_screen_height: usize,
) -> Result<MediaRecorder, String> {
let mut media_recorder = MediaRecorder::new();
let audio_file_path = audio_chunks_dir.to_str().unwrap();
let video_file_path = video_chunks_dir.to_str().unwrap();
let screenshot_dir_path = screenshot_dir.to_str().unwrap();
- media_recorder.start_media_recording(options.clone(), audio_file_path, screenshot_dir_path, video_file_path, audio_name.as_ref().map(String::as_str)).await?;
+ media_recorder.start_media_recording(options.clone(), audio_file_path, screenshot_dir_path, video_file_path, audio_name.as_ref().map(String::as_str), max_screen_width, max_screen_height).await?;
Ok(media_recorder)
}
\ No newline at end of file
diff --git a/apps/desktop/src-tauri/src/utils.rs b/apps/desktop/src-tauri/src/utils.rs
index 30ec5b10e..50a1875be 100644
--- a/apps/desktop/src-tauri/src/utils.rs
+++ b/apps/desktop/src-tauri/src/utils.rs
@@ -1,4 +1,3 @@
-use tokio::process::{ChildStderr};
use std::process::{Command};
use ffmpeg_sidecar::{
paths::sidecar_dir,
@@ -14,8 +13,11 @@ pub fn has_screen_capture_access() -> bool {
Err(_) => return false,
};
+ let width = display.width();
+ let height = display.height();
+
let result = panic::catch_unwind(|| {
- let mut capturer = match Capturer::new(display) {
+ let mut capturer = match Capturer::new(display, width, height) {
Ok(capturer) => capturer,
Err(_) => return false,
};
diff --git a/apps/desktop/src/app/camera/page.tsx b/apps/desktop/src/app/camera/page.tsx
index 79c99cdaf..b959107c1 100644
--- a/apps/desktop/src/app/camera/page.tsx
+++ b/apps/desktop/src/app/camera/page.tsx
@@ -4,7 +4,16 @@ import { Camera } from "@/components/windows/Camera";
export default function CameraPage() {
return (
- <div id="app" data-tauri-drag-region style={{ borderRadius: "50%" }}>
+ <div
+ id="app"
+ data-tauri-drag-region
+ style={{
+ borderRadius: "50%",
+ background: "none !important",
+ outline: "none",
+ boxShadow: "none",
+ }}
+ >
<Camera />
</div>
);
diff --git a/apps/desktop/src/components/windows/Camera.tsx b/apps/desktop/src/components/windows/Camera.tsx
index 2b0d02298..a3d44c861 100644
--- a/apps/desktop/src/components/windows/Camera.tsx
+++ b/apps/desktop/src/components/windows/Camera.tsx
@@ -86,7 +86,7 @@ export const Camera = () => {
return (
<div
data-tauri-drag-region
- className="group w-full h-full bg-gray-200 rounded-full m-0 p-0 relative overflow-hidden flex items-center justify-center border-none outline-none focus:outline-none rounded-full"
+ className="cursor-move group w-full h-full bg-gray-200 rounded-full m-0 p-0 relative overflow-hidden flex items-center justify-center border-none outline-none focus:outline-none rounded-full"
>
{isLoading && (
<div className="w-full h-full absolute top-0 left-0 bg-gray-200 z-10 flex items-center justify-center">
diff --git a/apps/desktop/src/utils/helpers.ts b/apps/desktop/src/utils/helpers.ts
index 8377df453..4996ee1c4 100644
--- a/apps/desktop/src/utils/helpers.ts
+++ b/apps/desktop/src/utils/helpers.ts
@@ -33,21 +33,6 @@ export function concatenateTypedArrays(
return result;
}
-export const requestMediaDevicesPermission = async () => {
- try {
- if (typeof navigator !== "undefined" && typeof window !== "undefined") {
- await navigator.mediaDevices.getUserMedia({
- video: true,
- audio: true,
- });
-
- console.log("Permissions to access media devices have been granted.");
- }
- } catch (error) {
- console.error("Permissions to access media devices were denied.", error);
- }
-};
-
export const getPermissions = () => {
try {
if (typeof window !== "undefined") {
diff --git a/apps/desktop/src/utils/recording/MediaDeviceContext.tsx b/apps/desktop/src/utils/recording/MediaDeviceContext.tsx
index b986d1125..8c721899f 100644
--- a/apps/desktop/src/utils/recording/MediaDeviceContext.tsx
+++ b/apps/desktop/src/utils/recording/MediaDeviceContext.tsx
@@ -37,7 +37,6 @@ export interface MediaDeviceContextData {
setIsRecording: React.Dispatch<React.SetStateAction<boolean>>;
startingRecording: boolean;
setStartingRecording: React.Dispatch<React.SetStateAction<boolean>>;
- updateTrigger: number;
}
export const MediaDeviceContext = createContext<
@@ -57,13 +56,7 @@ export const MediaDeviceProvider: React.FC<React.PropsWithChildren<{}>> = ({
const [devices, setDevices] = useState<Devices[]>([]);
const [isRecording, setIsRecording] = useState(false);
const [startingRecording, setStartingRecording] = useState(false);
- const sharedStream = useRef<MediaStream | null>(null);
- const [updateTrigger, setUpdateTrigger] = useState(0);
-
- const updateSharedStream = useCallback((newStream: MediaStream | null) => {
- sharedStream.current = newStream;
- setUpdateTrigger((prev) => prev + 1);
- }, []);
+ const getDevicesCalled = useRef(false);
const getDevices = useCallback(async () => {
await enumerateAndStoreDevices();
@@ -107,7 +100,10 @@ export const MediaDeviceProvider: React.FC<React.PropsWithChildren<{}>> = ({
}, [selectedVideoDevice, selectedAudioDevice]);
useEffect(() => {
- getDevices();
+ if (!getDevicesCalled.current) {
+ getDevices();
+ getDevicesCalled.current = true;
+ }
}, []);
useEffect(() => {
@@ -176,10 +172,6 @@ export const MediaDeviceProvider: React.FC<React.PropsWithChildren<{}>> = ({
setIsRecording,
startingRecording,
setStartingRecording,
- // sharedStream: sharedStream.current,
- // startSharedStream,
- // stopSharedStream,
- updateTrigger,
}}
>
{children}