From 22e5890a7c2f7a5f0d95d13a2080b9b9f59e0478 Mon Sep 17 00:00:00 2001 From: leyoda Date: Mon, 18 May 2026 12:22:47 +0200 Subject: [PATCH 01/19] local: integrate yoda libcosmic and fix thumbnail hang --- .gitignore | 4 + Cargo.lock | 401 +++-------- Cargo.toml | 18 +- README.md | 32 + src/main.rs | 12 +- vendor/iced_video_player/.gitignore | 2 + vendor/iced_video_player/Cargo.toml | 88 +++ vendor/iced_video_player/LICENSE-APACHE | 176 +++++ vendor/iced_video_player/LICENSE-MIT | 23 + vendor/iced_video_player/README.md | 64 ++ vendor/iced_video_player/examples/minimal.rs | 154 +++++ vendor/iced_video_player/src/lib.rs | 79 +++ vendor/iced_video_player/src/pipeline.rs | 447 +++++++++++++ vendor/iced_video_player/src/shader.wgsl | 58 ++ vendor/iced_video_player/src/video.rs | 664 +++++++++++++++++++ vendor/iced_video_player/src/video_player.rs | 476 +++++++++++++ 16 files changed, 2388 insertions(+), 310 deletions(-) create mode 100644 vendor/iced_video_player/.gitignore create mode 100644 vendor/iced_video_player/Cargo.toml create mode 100644 vendor/iced_video_player/LICENSE-APACHE create mode 100644 vendor/iced_video_player/LICENSE-MIT create mode 100644 vendor/iced_video_player/README.md create mode 100644 vendor/iced_video_player/examples/minimal.rs create mode 100644 vendor/iced_video_player/src/lib.rs create mode 100644 vendor/iced_video_player/src/pipeline.rs create mode 100644 vendor/iced_video_player/src/shader.wgsl create mode 100644 vendor/iced_video_player/src/video.rs create mode 100644 vendor/iced_video_player/src/video_player.rs diff --git a/.gitignore b/.gitignore index 10de4bd..2c25f66 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,8 @@ /debian/files /target/ /vendor/ +!/vendor/ +/vendor/* +!/vendor/iced_video_player/ +!/vendor/iced_video_player/** /vendor.tar diff --git a/Cargo.lock b/Cargo.lock index 82cd5ad..61b931e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,12 +153,6 @@ dependencies = [ "equator", ] -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "almost" version = "0.2.0" @@ -308,12 +302,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "as-raw-xcb-connection" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" - [[package]] name = "as-slice" version = "0.2.1" @@ -884,7 +872,7 @@ dependencies = [ [[package]] name = "clipboard_macos" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" +source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "objc", "objc-foundation", @@ -894,22 +882,13 @@ dependencies = [ [[package]] name = "clipboard_wayland" version = "0.2.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" +source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "dnd", "mime", "smithay-clipboard", ] -[[package]] -name = "clipboard_x11" -version = "0.4.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" -dependencies = [ - "thiserror 1.0.69", - "x11rb", -] - [[package]] name = "cocoa" version = "0.25.0" @@ -1074,7 +1053,6 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1095,7 +1073,6 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "quote", "syn", @@ -1130,7 +1107,7 @@ dependencies = [ "icu_collator", "icu_locale", "image", - "libcosmic", + "libcosmic-yoda", "log", "mpris-server", "rust-embed", @@ -1167,8 +1144,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be17b688510d934ce13f48a2beba700e11583e281e0fda99c22bb256a14eda73" +source = "git+https://github.com/pop-os/cosmic-text.git#c24886c2471e5606587c46090cd25dbbf209186b" dependencies = [ "bitflags 2.11.1", "fontdb", @@ -1191,7 +1167,6 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "almost", "configparser", @@ -1257,7 +1232,7 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "cryoglyph" version = "0.1.0" -source = "git+https://github.com/iced-rs/cryoglyph.git?rev=e429a025df36ab8145708acb309080ae3deec17a#e429a025df36ab8145708acb309080ae3deec17a" +source = "git+https://github.com/pop-os/glyphon.git?tag=cosmic-0.14#c49de15bce4d8254ac136d1be9911960cc85ce12" dependencies = [ "cosmic-text", "etagere", @@ -1294,15 +1269,6 @@ dependencies = [ "uncased", ] -[[package]] -name = "ctor" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cf0d42651b16c6dfe68685716d18480d18a9c39c62d76e8cf3eb6ed5d8bcbf" -dependencies = [ - "dtor", -] - [[package]] name = "cursor-icon" version = "1.2.0" @@ -1448,7 +1414,7 @@ dependencies = [ [[package]] name = "dnd" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" +source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "bitflags 2.11.1", "mime", @@ -1477,51 +1443,6 @@ name = "dpi" version = "0.1.2" source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" -[[package]] -name = "drm" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" -dependencies = [ - "bitflags 2.11.1", - "bytemuck", - "drm-ffi", - "drm-fourcc", - "rustix 0.38.44", -] - -[[package]] -name = "drm-ffi" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" -dependencies = [ - "drm-sys", - "rustix 0.38.44", -] - -[[package]] -name = "drm-fourcc" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" - -[[package]] -name = "drm-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" -dependencies = [ - "libc", - "linux-raw-sys 0.6.5", -] - -[[package]] -name = "dtor" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edf234dd1594d6dd434a8fb8cada51ddbbc593e40e4a01556a0b31c62da2775b" - [[package]] name = "either" version = "1.15.0" @@ -2018,16 +1939,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "gethostname" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" -dependencies = [ - "rustix 1.1.4", - "windows-link 0.2.1", -] - [[package]] name = "getrandom" version = "0.2.17" @@ -2190,17 +2101,34 @@ dependencies = [ ] [[package]] -name = "gpu-allocator" -version = "0.28.0" +name = "gpu-alloc" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.11.1", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.11.1", +] + +[[package]] +name = "gpu-allocator" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" dependencies = [ - "ash", - "hashbrown 0.16.1", "log", "presser", - "thiserror 2.0.18", - "windows 0.62.2", + "thiserror 1.0.69", + "windows 0.58.0", ] [[package]] @@ -2486,8 +2414,6 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ - "allocator-api2", - "equivalent", "foldhash 0.2.0", ] @@ -2600,7 +2526,6 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "dnd", "iced_accessibility", @@ -2621,7 +2546,6 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "accesskit", "accesskit_winit", @@ -2630,7 +2554,6 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "bitflags 2.11.1", "bytes", @@ -2654,7 +2577,6 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "iced_core", "iced_futures", @@ -2664,7 +2586,6 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "futures", "iced_core", @@ -2678,7 +2599,6 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "bitflags 2.11.1", "bytemuck", @@ -2699,7 +2619,6 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "iced_graphics", "iced_runtime", @@ -2708,7 +2627,6 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2720,7 +2638,6 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "bytes", "cosmic-client-toolkit", @@ -2735,7 +2652,6 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "bytemuck", "cosmic-text", @@ -2752,7 +2668,6 @@ dependencies = [ [[package]] name = "iced_video_player" version = "0.6.0" -source = "git+https://github.com/wash2/iced_video_player.git?branch=iced-rebase#cb3635192f3dec37619855c904a168ca37a3dac3" dependencies = [ "glib", "gstreamer", @@ -2761,7 +2676,7 @@ dependencies = [ "gstreamer-pbutils", "html-escape", "iced_wgpu", - "libcosmic", + "libcosmic-yoda", "log", "thiserror 2.0.18", "url", @@ -2770,9 +2685,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ - "as-raw-xcb-connection", "bitflags 2.11.1", "bytemuck", "cosmic-client-toolkit", @@ -2789,19 +2702,16 @@ dependencies = [ "rustc-hash 2.1.2", "rustix 0.38.44", "thiserror 2.0.18", - "tiny-xlib", "wayland-backend", "wayland-client", "wayland-protocols", "wayland-sys", "wgpu", - "x11rb", ] [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "cosmic-client-toolkit", "dnd", @@ -2819,7 +2729,6 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "cosmic-client-toolkit", "cursor-icon", @@ -3379,9 +3288,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] -name = "libcosmic" -version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" +name = "libcosmic-yoda" +version = "0.1.0-yoda.2" dependencies = [ "apply", "ashpd 0.12.3", @@ -3483,12 +3391,6 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" -[[package]] -name = "linux-raw-sys" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -3643,9 +3545,9 @@ dependencies = [ [[package]] name = "metal" -version = "0.33.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15" +checksum = "00c15a6f673ff72ddcc22394663290f870fb224c1bfce55734a75c414150e605" dependencies = [ "bitflags 2.11.1", "block", @@ -3659,7 +3561,7 @@ dependencies = [ [[package]] name = "mime" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" +source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "smithay-clipboard", ] @@ -3723,9 +3625,9 @@ checksum = "13d2233c9842d08cfe13f9eac96e207ca6a2ea10b80259ebe8ad0268be27d2af" [[package]] name = "naga" -version = "28.0.0" +version = "27.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "618f667225063219ddfc61251087db8a9aec3c3f0950c916b614e403486f1135" +checksum = "066cf25f0e8b11ee0df221219010f213ad429855f57c494f995590c861a9a7d8" dependencies = [ "arrayvec", "bit-set", @@ -5334,12 +5236,10 @@ name = "softbuffer" version = "0.4.1" source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-4.0#c2b2c19ddb38ff17495643699f97cb1f2064a1be" dependencies = [ - "as-raw-xcb-connection", "bytemuck", "cfg_aliases", "cocoa", "core-graphics", - "drm", "fastrand", "foreign-types", "js-sys", @@ -5349,14 +5249,12 @@ dependencies = [ "raw-window-handle", "redox_syscall 0.5.18", "rustix 0.38.44", - "tiny-xlib", "wasm-bindgen", "wayland-backend", "wayland-client", "wayland-sys", "web-sys", "windows-sys 0.52.0", - "x11rb", ] [[package]] @@ -5619,19 +5517,6 @@ dependencies = [ "strict-num", ] -[[package]] -name = "tiny-xlib" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90a0ca3ee6a69f2ad28fd11621a4c3f03b371f366be500b64df260c4ffbafb4" -dependencies = [ - "as-raw-xcb-connection", - "ctor", - "libloading", - "pkg-config", - "tracing", -] - [[package]] name = "tinystr" version = "0.8.3" @@ -6366,13 +6251,12 @@ checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" [[package]] name = "wgpu" -version = "28.0.0" +version = "27.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cb534d5ffd109c7d1135f34cdae29e60eab94855a625dcfe1705f8bc7ad79f" +checksum = "bfe68bac7cde125de7a731c3400723cadaaf1703795ad3f4805f187459cd7a77" dependencies = [ "arrayvec", "bitflags 2.11.1", - "bytemuck", "cfg-if", "cfg_aliases", "document-features", @@ -6396,9 +6280,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "28.0.1" +version = "27.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23f4642f53f666adcfd2d3218ab174d1e6681101aef18696b90cbe64d1c10f9" +checksum = "27a75de515543b1897b26119f93731b385a19aea165a1ec5f0e3acecc229cae7" dependencies = [ "arrayvec", "bit-set", @@ -6428,36 +6312,36 @@ dependencies = [ [[package]] name = "wgpu-core-deps-apple" -version = "28.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87b7b696b918f337c486bf93142454080a32a37832ba8a31e4f48221890047da" +checksum = "0772ae958e9be0c729561d5e3fd9a19679bcdfb945b8b1a1969d9bfe8056d233" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-core-deps-emscripten" -version = "28.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b251c331f84feac147de3c4aa3aa45112622a95dd7ee1b74384fa0458dbd79" +checksum = "b06ac3444a95b0813ecfd81ddb2774b66220b264b3e2031152a4a29fda4da6b5" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-core-deps-windows-linux-android" -version = "28.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca976e72b2c9964eb243e281f6ce7f14a514e409920920dcda12ae40febaae" +checksum = "71197027d61a71748e4120f05a9242b2ad142e3c01f8c1b47707945a879a03c3" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-hal" -version = "28.0.1" +version = "27.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d6cb474beb218824dcc9e1ce679d973f719262789bfb27407da560cac20eeb" +checksum = "5b21cb61c57ee198bc4aff71aeadff4cbb80b927beb912506af9c780d64313ce" dependencies = [ "android_system_properties", "arrayvec", @@ -6471,6 +6355,7 @@ dependencies = [ "core-graphics-types 0.2.0", "glow", "glutin_wgl_sys", + "gpu-alloc", "gpu-allocator", "gpu-descriptor", "hashbrown 0.16.1", @@ -6497,20 +6382,21 @@ dependencies = [ "wasm-bindgen", "web-sys", "wgpu-types", - "windows 0.62.2", - "windows-core 0.62.2", + "windows 0.58.0", + "windows-core 0.58.0", ] [[package]] name = "wgpu-types" -version = "28.0.0" +version = "27.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e18308757e594ed2cd27dddbb16a139c42a683819d32a2e0b1b0167552f5840c" +checksum = "afdcf84c395990db737f2dd91628706cb31e86d72e53482320d368e52b5da5eb" dependencies = [ "bitflags 2.11.1", "bytemuck", "js-sys", "log", + "thiserror 2.0.18", "web-sys", ] @@ -6548,12 +6434,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" version = "0.4.1" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" +source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "clipboard-win", "clipboard_macos", "clipboard_wayland", - "clipboard_x11", "dnd", "mime", "raw-window-handle", @@ -6562,27 +6447,25 @@ dependencies = [ [[package]] name = "windows" -version = "0.61.3" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-collections 0.2.0", - "windows-core 0.61.2", - "windows-future 0.2.1", - "windows-link 0.1.3", - "windows-numerics 0.2.0", + "windows-core 0.58.0", + "windows-targets 0.52.6", ] [[package]] name = "windows" -version = "0.62.2" +version = "0.61.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ - "windows-collections 0.3.2", - "windows-core 0.62.2", - "windows-future 0.3.2", - "windows-numerics 0.3.1", + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", ] [[package]] @@ -6595,12 +6478,16 @@ dependencies = [ ] [[package]] -name = "windows-collections" -version = "0.3.2" +name = "windows-core" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ - "windows-core 0.62.2", + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", ] [[package]] @@ -6609,26 +6496,13 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement", - "windows-interface", + "windows-implement 0.60.2", + "windows-interface 0.59.3", "windows-link 0.1.3", "windows-result 0.3.4", "windows-strings 0.4.2", ] -[[package]] -name = "windows-core" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - [[package]] name = "windows-future" version = "0.2.1" @@ -6637,18 +6511,18 @@ checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ "windows-core 0.61.2", "windows-link 0.1.3", - "windows-threading 0.1.0", + "windows-threading", ] [[package]] -name = "windows-future" -version = "0.3.2" +name = "windows-implement" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ - "windows-core 0.62.2", - "windows-link 0.2.1", - "windows-threading 0.2.1", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -6662,6 +6536,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-interface" version = "0.59.3" @@ -6696,13 +6581,12 @@ dependencies = [ ] [[package]] -name = "windows-numerics" -version = "0.3.1" +name = "windows-result" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ - "windows-core 0.62.2", - "windows-link 0.2.1", + "windows-targets 0.52.6", ] [[package]] @@ -6715,12 +6599,13 @@ dependencies = [ ] [[package]] -name = "windows-result" -version = "0.4.1" +name = "windows-strings" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-link 0.2.1", + "windows-result 0.2.0", + "windows-targets 0.52.6", ] [[package]] @@ -6732,15 +6617,6 @@ dependencies = [ "windows-link 0.1.3", ] -[[package]] -name = "windows-strings" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" -dependencies = [ - "windows-link 0.2.1", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -6843,15 +6719,6 @@ dependencies = [ "windows-link 0.1.3", ] -[[package]] -name = "windows-threading" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" -dependencies = [ - "windows-link 0.2.1", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -7013,7 +6880,6 @@ dependencies = [ "winit-wayland", "winit-web", "winit-win32", - "winit-x11", ] [[package]] @@ -7064,7 +6930,6 @@ dependencies = [ "smol_str", "tracing", "winit-core", - "x11-dl", "xkbcommon-dl", ] @@ -7182,29 +7047,6 @@ dependencies = [ "winit-core", ] -[[package]] -name = "winit-x11" -version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" -dependencies = [ - "bitflags 2.11.1", - "bytemuck", - "calloop", - "cursor-icon", - "dpi", - "libc", - "percent-encoding", - "raw-window-handle", - "rustix 1.1.4", - "smol_str", - "tracing", - "winit-common", - "winit-core", - "x11-dl", - "x11rb", - "xkbcommon-dl", -] - [[package]] name = "winnow" version = "1.0.2" @@ -7320,39 +7162,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" -[[package]] -name = "x11-dl" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" -dependencies = [ - "libc", - "once_cell", - "pkg-config", -] - -[[package]] -name = "x11rb" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" -dependencies = [ - "as-raw-xcb-connection", - "gethostname", - "libc", - "libloading", - "once_cell", - "rustix 1.1.4", - "x11rb-protocol", - "xcursor", -] - -[[package]] -name = "x11rb-protocol" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" - [[package]] name = "xcursor" version = "0.3.10" diff --git a/Cargo.toml b/Cargo.toml index 5e770d9..d55a60a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.11" log = "0.4" [dependencies.iced_video_player] -git = "https://github.com/wash2/iced_video_player.git" -branch = "iced-rebase" +path = "vendor/iced_video_player" default-features = false -[dependencies.libcosmic] -git = "https://github.com/pop-os/libcosmic.git" +[dependencies.cosmic] +package = "libcosmic-yoda" +path = "../libcosmic" default-features = false features = ["advanced-shaping", "tokio", "winit", "multi-window"] @@ -51,9 +51,9 @@ fork = "0.7" [features] default = ["mpris-server", "xdg-portal", "wgpu", "wayland"] -xdg-portal = ["ashpd", "libcosmic/xdg-portal"] -wgpu = ["iced_video_player/wgpu", "libcosmic/wgpu"] -wayland = ["libcosmic/wayland"] +xdg-portal = ["ashpd", "cosmic/xdg-portal"] +wgpu = ["iced_video_player/wgpu", "cosmic/wgpu"] +wayland = ["cosmic/wayland"] [profile.release-with-debug] inherits = "release" @@ -62,10 +62,6 @@ debug = true # [patch.'https://github.com/wash2/iced_video_player'] # iced_video_player = { path = "../iced_video_player" } -# [patch.'https://github.com/pop-os/libcosmic'] -# libcosmic = { path = "../libcosmic" } -# cosmic-config = { path = "../libcosmic/cosmic-config" } -# cosmic-theme = { path = "../libcosmic/cosmic-theme" } # libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } # cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } # cosmic-theme = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } diff --git a/README.md b/README.md index 0c2c300..f145524 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ # cosmic-player WIP COSMIC media player + +## Yoda local fork notes + +This fork is used for the local COSMIC desktop build. + +Local integration changes: + +- `cosmic-player` depends on the local `libcosmic-yoda` crate from `../libcosmic` + instead of upstream `pop-os/libcosmic`. +- `iced_video_player` is vendored in `vendor/iced_video_player` so it uses the + same local `libcosmic-yoda` and `iced_wgpu` stack. This avoids mixing upstream + and local Iced/libcosmic types. +- The app now runs `App::close()` before application exit and before the Quit + menu action exits the runtime. This lets the GStreamer pipeline be dropped + normally instead of short-circuiting through `process::exit(0)`. +- Thumbnail generation has a bounded wait for video frames. Some files/codecs can + fail to produce a frame; the thumbnailer now returns an error instead of + spinning forever as a background `cosmic-player --thumbnail ...` process. + +Validation commands: + +```bash +cargo +1.93.0 check +cargo +1.93.0 tree -i libcosmic-yoda --depth 2 +cargo +1.93.0 tree -i libcosmic --depth 2 || true +``` + +Local redeploy: + +```bash +COSMIC_PLAYER_REPO=/home/lionel/Projets/COSMIC/cosmic-player ./redeploy.sh +``` diff --git a/src/main.rs b/src/main.rs index 2c11f3d..d9c2233 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,10 +7,10 @@ use cosmic::cosmic_config::{self, CosmicConfigEntry}; use cosmic::iced::event::{self, Event}; use cosmic::iced::keyboard::{Event as KeyEvent, Key, Modifiers}; use cosmic::iced::mouse::{Event as MouseEvent, ScrollDelta}; -use cosmic::iced::window::{self, set_mode}; use cosmic::iced::{ - Alignment, Background, Border, Color, ContentFit, Length, Limits, Subscription, + Alignment, Background, Border, Color, ContentFit, Length, Limits, Subscription, exit, window, }; +use cosmic::iced::window::set_mode; use cosmic::widget::menu::action::MenuAction; use cosmic::widget::{self, Slider, nav_bar, segmented_button}; use cosmic::{Application, ApplicationExt, Element, action, cosmic_theme, executor, font, theme}; @@ -951,6 +951,11 @@ impl Application for App { } } + fn on_app_exit(&mut self) -> Option { + self.close(); + None + } + fn on_nav_select(&mut self, id: nav_bar::Id) -> Task { // Toggle open state and get clone of node data let node_opt = match self.nav_model.data_mut::(id) { @@ -1606,7 +1611,8 @@ impl Application for App { return self.update_config(); } Message::WindowClose => { - process::exit(0); + self.close(); + return exit(); } } Task::none() diff --git a/vendor/iced_video_player/.gitignore b/vendor/iced_video_player/.gitignore new file mode 100644 index 0000000..cb8c9e0 --- /dev/null +++ b/vendor/iced_video_player/.gitignore @@ -0,0 +1,2 @@ +/target +.direnv \ No newline at end of file diff --git a/vendor/iced_video_player/Cargo.toml b/vendor/iced_video_player/Cargo.toml new file mode 100644 index 0000000..9bcea9c --- /dev/null +++ b/vendor/iced_video_player/Cargo.toml @@ -0,0 +1,88 @@ +[package] +name = "iced_video_player" +description = "A convenient video player widget for Iced" +homepage = "https://github.com/jazzfool/iced_video_player" +repository = "https://github.com/jazzfool/iced_video_player" +readme = "README.md" +keywords = ["gui", "iced", "video"] +categories = ["gui", "multimedia"] +version = "0.6.0" +authors = ["jazzfool"] +edition = "2021" +resolver = "2" +license = "MIT OR Apache-2.0" +exclude = [".media/test.mp4"] + +[dependencies] +gstreamer = "0.25" +gstreamer-app = "0.25" # appsink +gstreamer-base = "0.25" # basesrc +gstreamer-pbutils = "0.25" +glib = "0.22" # gobject traits and error type +log = "0.4" +thiserror = "2" +url = "2" # media uri +html-escape = "0.2.13" +iced_wgpu = { path = "../../../libcosmic/iced/wgpu", default-features = false, optional = true } + +[dependencies.cosmic] +package = "libcosmic-yoda" +path = "../../../libcosmic" +default-features = false +features = ["tokio", "winit"] + +[dev-dependencies] +env_logger = "0.11" + +[features] +default = ["wgpu"] +wgpu = ["cosmic/wgpu", "iced_wgpu"] + +[package.metadata.nix] +systems = ["x86_64-linux"] +app = true +build = true +runtimeLibs = [ + "vulkan-loader", + "wayland", + "wayland-protocols", + "libxkbcommon", + "xorg.libX11", + "xorg.libXrandr", + "xorg.libXi", + "gst_all_1.gstreamer", + "gst_all_1.gstreamermm", + "gst_all_1.gst-plugins-bad", + "gst_all_1.gst-plugins-ugly", + "gst_all_1.gst-plugins-good", + "gst_all_1.gst-plugins-base", +] +buildInputs = [ + "libxkbcommon", + "gst_all_1.gstreamer", + "gst_all_1.gstreamermm", + "gst_all_1.gst-plugins-bad", + "gst_all_1.gst-plugins-ugly", + "gst_all_1.gst-plugins-good", + "gst_all_1.gst-plugins-base", +] + +[package.metadata.docs.rs] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["wasm32-unknown-unknown"] + + +# [patch.'https://github.com/pop-os/libcosmic'] +# libcosmic = { path = "../libcosmic" } +# cosmic-config = { path = "../libcosmic/cosmic-config" } +# cosmic-theme = { path = "../libcosmic/cosmic-theme" } +# libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } +# cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } +# cosmic-theme = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } + +[dev_dependencies] +libcosmic = { git = "https://github.com/pop-os/libcosmic", features = [ + "wgpu", + "wayland", +] } diff --git a/vendor/iced_video_player/LICENSE-APACHE b/vendor/iced_video_player/LICENSE-APACHE new file mode 100644 index 0000000..a7e77cb --- /dev/null +++ b/vendor/iced_video_player/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/vendor/iced_video_player/LICENSE-MIT b/vendor/iced_video_player/LICENSE-MIT new file mode 100644 index 0000000..468cd79 --- /dev/null +++ b/vendor/iced_video_player/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/iced_video_player/README.md b/vendor/iced_video_player/README.md new file mode 100644 index 0000000..3c17b23 --- /dev/null +++ b/vendor/iced_video_player/README.md @@ -0,0 +1,64 @@ +# Iced Video Player Widget + +Composable component to play videos in any Iced application built on the excellent GStreamer library. + + + +## Overview + +In general, this supports anything that [`gstreamer/playbin`](https://gstreamer.freedesktop.org/documentation/playback/playbin.html?gi-language=c) supports. + +Features: +- Load video files from any file path **or URL** (support for streaming over network). +- Video buffering when streaming on a network. +- Audio support. +- Programmatic control. +- Can capture thumbnails from a set of timestamps. +- Good performance (i.e., comparable to other video players). GStreamer (with the right plugins) will perform hardware-accelerated decoding, and the color space (YUV to RGB) is converted on the GPU whilst rendering the frame. + +Limitations (hopefully to be fixed): +- GStreamer is a bit annoying to set up on Windows. + +The player **does not** come with any surrounding GUI controls, but they should be quite easy to implement should you need them. +See the "minimal" example for a demonstration on how you could implement pausing, looping, and seeking. + +## Example Usage + +```rust +use iced_video_player::{Video, VideoPlayer}; + +fn main() -> iced::Result { + iced::run("Video Player", (), App::view) +} + +struct App { + video: Video, +} + +impl Default for App { + fn default() -> Self { + App { + video: Video::new(&url::Url::parse("file:///C:/my_video.mp4").unwrap()).unwrap(), + } + } +} + +impl App { + fn view(&self) -> iced::Element<()> { + VideoPlayer::new(&self.video).into() + } +} +``` + +## Building + +Follow the [GStreamer build instructions](https://github.com/sdroege/gstreamer-rs#installation). This should be able to compile on MSVC, MinGW, Linux, and MacOS. + +## License + +Licensed under either + +- [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) +- [MIT](http://opensource.org/licenses/MIT) + +at your option. diff --git a/vendor/iced_video_player/examples/minimal.rs b/vendor/iced_video_player/examples/minimal.rs new file mode 100644 index 0000000..0eb76c1 --- /dev/null +++ b/vendor/iced_video_player/examples/minimal.rs @@ -0,0 +1,154 @@ +use std::time::Duration; + +use cosmic::iced::{self, Program, Task, Theme}; + +use iced::{ + application::Application, + widget::{Button, Column, Container, Row, Slider, Text}, +}; +use iced_video_player::{Video, VideoPlayer}; + +pub fn main() -> iced::Result { + application().run() +} + +fn application() -> Application> { + iced::application(App::default, App::update, App::view).window_size((500.0, 800.0)) +} + +#[derive(Clone, Debug)] +enum Message { + TogglePause, + ToggleLoop, + Seek(f64), + SeekRelease, + EndOfStream, + NewFrame, +} + +struct App { + video: Video, + position: f64, + dragging: bool, +} + +impl Default for App { + fn default() -> Self { + App { + video: Video::new( + &url::Url::from_file_path( + std::path::PathBuf::from(file!()) + .parent() + .unwrap() + .join("../.media/test.mp4") + .canonicalize() + .unwrap(), + ) + .unwrap(), + ) + .unwrap(), + position: 0.0, + dragging: false, + } + } +} + +impl App { + fn update(&mut self, message: Message) -> Task { + match message { + Message::TogglePause => { + self.video.set_paused(!self.video.paused()); + } + Message::ToggleLoop => { + self.video.set_looping(!self.video.looping()); + } + Message::Seek(secs) => { + self.dragging = true; + self.video.set_paused(true); + self.position = secs; + } + Message::SeekRelease => { + self.dragging = false; + self.video + .seek(Duration::from_secs_f64(self.position), false) + .expect("seek"); + self.video.set_paused(false); + } + Message::EndOfStream => { + println!("end of stream"); + } + Message::NewFrame => { + if !self.dragging { + self.position = self.video.position().as_secs_f64(); + } + } + } + Task::none() + } + + fn view(&self) -> iced::Element<'_, Message> { + Column::new() + .push( + Container::new( + VideoPlayer::new(&self.video) + .width(iced::Length::Fill) + .height(iced::Length::Fill) + .content_fit(iced::ContentFit::Contain) + .on_end_of_stream(Message::EndOfStream) + .on_new_frame(Message::NewFrame), + ) + .align_x(iced::Alignment::Center) + .align_y(iced::Alignment::Center) + .width(iced::Length::Fill) + .height(iced::Length::Fill), + ) + .push( + Container::new( + Slider::new( + 0.0..=self.video.duration().as_secs_f64(), + self.position, + Message::Seek, + ) + .step(0.1) + .on_release(Message::SeekRelease), + ) + .padding(iced::Padding::new(5.0).left(10.0).right(10.0)), + ) + .push( + Row::new() + .spacing(5) + .align_y(iced::alignment::Vertical::Center) + .padding(iced::Padding::new(10.0).top(0.0)) + .push( + Button::new(Text::new(if self.video.paused() { + "Play" + } else { + "Pause" + })) + .width(80.0) + .on_press(Message::TogglePause), + ) + .push( + Button::new(Text::new(if self.video.looping() { + "Disable Loop" + } else { + "Enable Loop" + })) + .width(120.0) + .on_press(Message::ToggleLoop), + ) + .push( + Text::new(format!( + "{}:{:02}s / {}:{:02}s", + self.position as u64 / 60, + self.position as u64 % 60, + self.video.duration().as_secs() / 60, + self.video.duration().as_secs() % 60, + )) + .width(iced::Length::Fill) + .align_x(iced::alignment::Horizontal::Right), + ), + ) + .into() + } +} diff --git a/vendor/iced_video_player/src/lib.rs b/vendor/iced_video_player/src/lib.rs new file mode 100644 index 0000000..f0c8584 --- /dev/null +++ b/vendor/iced_video_player/src/lib.rs @@ -0,0 +1,79 @@ +//! # Iced Video Player +//! +//! A convenient video player widget for Iced. +//! +//! To get started, load a video from a URI (e.g., a file path prefixed with `file:///`) using [`Video::new`](crate::Video::new), +//! then use it like any other Iced widget in your `view` function by creating a [`VideoPlayer`]. +//! +//! Example: +//! ```rust +//! use iced_video_player::{Video, VideoPlayer}; +//! +//! fn main() -> iced::Result { +//! iced::run("Video Player", (), App::view) +//! } +//! +//! struct App { +//! video: Video, +//! } +//! +//! impl Default for App { +//! fn default() -> Self { +//! App { +//! video: Video::new(&url::Url::parse("file:///C:/my_video.mp4").unwrap()).unwrap(), +//! } +//! } +//! } +//! +//! impl App { +//! fn view(&self) -> iced::Element<()> { +//! VideoPlayer::new(&self.video).into() +//! } +//! } +//! ``` +//! +//! You can programmatically control the video (e.g., seek, pause, loop, grab thumbnails) by accessing various methods on [`Video`]. + +#[cfg(feature = "wgpu")] +mod pipeline; +mod video; +mod video_player; + +pub use gstreamer as gst; +pub use gstreamer_app as gst_app; +pub use gstreamer_pbutils as gst_pbutils; +use thiserror::Error; + +pub use video::Position; +pub use video::Video; +pub use video_player::VideoPlayer; + +#[derive(Debug, Error)] +pub enum Error { + #[error("{0}")] + Glib(#[from] glib::Error), + #[error("{0}")] + Bool(#[from] glib::BoolError), + #[error("failed to get the gstreamer bus")] + Bus, + #[error("failed to get AppSink element with name='{0}' from gstreamer pipeline")] + AppSink(String), + #[error("{0}")] + StateChange(#[from] gst::StateChangeError), + #[error("failed to cast gstreamer element")] + Cast, + #[error("{0}")] + Io(#[from] std::io::Error), + #[error("invalid URI")] + Uri, + #[error("failed to get media capabilities")] + Caps, + #[error("failed to query media duration or position")] + Duration, + #[error("failed to sync with playback")] + Sync, + #[error("failed to lock internal sync primitive")] + Lock, + #[error("invalid framerate: {0}")] + Framerate(f64), +} diff --git a/vendor/iced_video_player/src/pipeline.rs b/vendor/iced_video_player/src/pipeline.rs new file mode 100644 index 0000000..2d9d3e7 --- /dev/null +++ b/vendor/iced_video_player/src/pipeline.rs @@ -0,0 +1,447 @@ +use cosmic::iced::wgpu; +use cosmic::iced::widget::shader::{Pipeline, Primitive, Viewport}; +use cosmic::iced::{self, Rectangle}; +use std::{ + collections::{btree_map::Entry, BTreeMap}, + sync::{ + atomic::{AtomicBool, Ordering}, + Arc, Mutex, + }, +}; + +use crate::video::Frame; + +#[repr(C)] +struct Uniforms { + rect: [f32; 4], +} + +struct VideoEntry { + texture_y: wgpu::Texture, + texture_uv: wgpu::Texture, + uniforms: wgpu::Buffer, + bg0: wgpu::BindGroup, + alive: Arc, +} + +pub struct VideoPipeline { + pipeline: wgpu::RenderPipeline, + bg0_layout: wgpu::BindGroupLayout, + sampler: wgpu::Sampler, + videos: BTreeMap, +} + +impl VideoPipeline { + fn new(device: &wgpu::Device, format: wgpu::TextureFormat, queue: &wgpu::Queue) -> Self { + let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { + label: Some("iced_video_player shader"), + source: wgpu::ShaderSource::Wgsl(include_str!("shader.wgsl").into()), + }); + + let bg0_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { + label: Some("iced_video_player bind group 0 layout"), + entries: &[ + wgpu::BindGroupLayoutEntry { + binding: 0, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, + multisampled: false, + }, + count: None, + }, + wgpu::BindGroupLayoutEntry { + binding: 1, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, + multisampled: false, + }, + count: None, + }, + wgpu::BindGroupLayoutEntry { + binding: 2, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering), + count: None, + }, + wgpu::BindGroupLayoutEntry { + binding: 3, + visibility: wgpu::ShaderStages::VERTEX, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, + min_binding_size: None, + }, + count: None, + }, + ], + }); + + let layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { + label: Some("iced_video_player pipeline layout"), + bind_group_layouts: &[&bg0_layout], + push_constant_ranges: &[], + }); + + let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { + label: Some("iced_video_player pipeline"), + layout: Some(&layout), + vertex: wgpu::VertexState { + module: &shader, + entry_point: Some("vs_main"), + buffers: &[], + compilation_options: wgpu::PipelineCompilationOptions::default(), + }, + primitive: wgpu::PrimitiveState::default(), + depth_stencil: None, + multisample: wgpu::MultisampleState { + count: 1, + mask: !0, + alpha_to_coverage_enabled: false, + }, + fragment: Some(wgpu::FragmentState { + module: &shader, + entry_point: Some("fs_main"), + targets: &[Some(wgpu::ColorTargetState { + format, + blend: None, + write_mask: wgpu::ColorWrites::ALL, + })], + compilation_options: wgpu::PipelineCompilationOptions::default(), + }), + multiview: None, + cache: None, + }); + + let sampler = device.create_sampler(&wgpu::SamplerDescriptor { + label: Some("iced_video_player sampler"), + address_mode_u: wgpu::AddressMode::ClampToEdge, + address_mode_v: wgpu::AddressMode::ClampToEdge, + address_mode_w: wgpu::AddressMode::ClampToEdge, + mag_filter: wgpu::FilterMode::Linear, + min_filter: wgpu::FilterMode::Linear, + mipmap_filter: wgpu::FilterMode::Nearest, + lod_min_clamp: 0.0, + lod_max_clamp: 1.0, + compare: None, + anisotropy_clamp: 1, + border_color: None, + }); + + VideoPipeline { + pipeline, + bg0_layout, + sampler, + videos: BTreeMap::new(), + } + } + + fn upload( + &mut self, + device: &wgpu::Device, + queue: &wgpu::Queue, + video_id: u64, + alive: &Arc, + (width, height): (u32, u32), + frame: &[u8], + ) { + if width == 0 || height == 0 { + return; + } + + if let Entry::Vacant(entry) = self.videos.entry(video_id) { + let texture_y = device.create_texture(&wgpu::TextureDescriptor { + label: Some("iced_video_player texture"), + size: wgpu::Extent3d { + width, + height, + depth_or_array_layers: 1, + }, + mip_level_count: 1, + sample_count: 1, + dimension: wgpu::TextureDimension::D2, + format: wgpu::TextureFormat::R8Unorm, + usage: wgpu::TextureUsages::COPY_DST | wgpu::TextureUsages::TEXTURE_BINDING, + view_formats: &[], + }); + + let texture_uv = device.create_texture(&wgpu::TextureDescriptor { + label: Some("iced_video_player texture"), + size: wgpu::Extent3d { + width: width / 2, + height: height / 2, + depth_or_array_layers: 1, + }, + mip_level_count: 1, + sample_count: 1, + dimension: wgpu::TextureDimension::D2, + format: wgpu::TextureFormat::Rg8Unorm, + usage: wgpu::TextureUsages::COPY_DST | wgpu::TextureUsages::TEXTURE_BINDING, + view_formats: &[], + }); + + let view_y = texture_y.create_view(&wgpu::TextureViewDescriptor { + label: Some("iced_video_player texture view"), + format: None, + dimension: None, + aspect: wgpu::TextureAspect::All, + base_mip_level: 0, + mip_level_count: None, + base_array_layer: 0, + array_layer_count: None, + usage: None, + }); + + let view_uv = texture_uv.create_view(&wgpu::TextureViewDescriptor { + label: Some("iced_video_player texture view"), + format: None, + dimension: None, + aspect: wgpu::TextureAspect::All, + base_mip_level: 0, + mip_level_count: None, + base_array_layer: 0, + array_layer_count: None, + usage: None, + }); + + let buffer = device.create_buffer(&wgpu::BufferDescriptor { + label: Some("iced_video_player uniform buffer"), + size: std::mem::size_of::() as _, + usage: wgpu::BufferUsages::COPY_DST | wgpu::BufferUsages::UNIFORM, + mapped_at_creation: false, + }); + + let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { + label: Some("iced_video_player bind group"), + layout: &self.bg0_layout, + entries: &[ + wgpu::BindGroupEntry { + binding: 0, + resource: wgpu::BindingResource::TextureView(&view_y), + }, + wgpu::BindGroupEntry { + binding: 1, + resource: wgpu::BindingResource::TextureView(&view_uv), + }, + wgpu::BindGroupEntry { + binding: 2, + resource: wgpu::BindingResource::Sampler(&self.sampler), + }, + wgpu::BindGroupEntry { + binding: 3, + resource: wgpu::BindingResource::Buffer(wgpu::BufferBinding { + buffer: &buffer, + offset: 0, + size: None, + }), + }, + ], + }); + + entry.insert(VideoEntry { + texture_y, + texture_uv, + uniforms: buffer, + bg0: bind_group, + alive: Arc::clone(alive), + }); + } + + let VideoEntry { + texture_y, + texture_uv, + .. + } = self.videos.get(&video_id).unwrap(); + + queue.write_texture( + wgpu::TexelCopyTextureInfo { + texture: texture_y, + mip_level: 0, + origin: wgpu::Origin3d::ZERO, + aspect: wgpu::TextureAspect::All, + }, + &frame[..(width * height) as usize], + wgpu::TexelCopyBufferLayout { + offset: 0, + bytes_per_row: Some(width), + rows_per_image: Some(height), + }, + wgpu::Extent3d { + width, + height, + depth_or_array_layers: 1, + }, + ); + + queue.write_texture( + wgpu::TexelCopyTextureInfo { + texture: texture_uv, + mip_level: 0, + origin: wgpu::Origin3d::ZERO, + aspect: wgpu::TextureAspect::All, + }, + &frame[(width * height) as usize..], + wgpu::TexelCopyBufferLayout { + offset: 0, + bytes_per_row: Some(width), + rows_per_image: Some(height / 2), + }, + wgpu::Extent3d { + width: width / 2, + height: height / 2, + depth_or_array_layers: 1, + }, + ); + } + + fn cleanup(&mut self) { + let ids: Vec<_> = self + .videos + .iter() + .filter_map(|(id, entry)| (!entry.alive.load(Ordering::SeqCst)).then_some(*id)) + .collect(); + for id in ids { + if let Some(video) = self.videos.remove(&id) { + video.texture_y.destroy(); + video.texture_uv.destroy(); + video.uniforms.destroy(); + } + } + } + + fn prepare(&mut self, queue: &wgpu::Queue, video_id: u64, bounds: &iced::Rectangle) { + if let Some(video) = self.videos.get(&video_id) { + let uniforms = Uniforms { + rect: [ + bounds.x, + bounds.y, + bounds.x + bounds.width, + bounds.y + bounds.height, + ], + }; + queue.write_buffer(&video.uniforms, 0, unsafe { + std::slice::from_raw_parts( + &uniforms as *const _ as *const u8, + std::mem::size_of::(), + ) + }); + } + + self.cleanup(); + } + + fn draw( + &self, + target: &wgpu::TextureView, + encoder: &mut wgpu::CommandEncoder, + viewport: &iced::Rectangle, + video_id: u64, + ) { + if let Some(video) = self.videos.get(&video_id) { + let mut pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + label: Some("iced_video_player render pass"), + color_attachments: &[Some(wgpu::RenderPassColorAttachment { + view: target, + resolve_target: None, + ops: wgpu::Operations { + load: wgpu::LoadOp::Load, + store: wgpu::StoreOp::Store, + }, + depth_slice: None, + })], + depth_stencil_attachment: None, + timestamp_writes: None, + occlusion_query_set: None, + }); + + pass.set_pipeline(&self.pipeline); + pass.set_bind_group(0, &video.bg0, &[]); + pass.set_viewport( + viewport.x as _, + viewport.y as _, + viewport.width as _, + viewport.height as _, + 0.0, + 1.0, + ); + pass.draw(0..4, 0..1); + } + } +} + +impl Pipeline for VideoPipeline { + fn new(device: &wgpu::Device, queue: &wgpu::Queue, format: wgpu::TextureFormat) -> Self + where + Self: Sized, + { + VideoPipeline::new(device, format, queue) + } +} + +#[derive(Debug, Clone)] +pub(crate) struct VideoPrimitive { + video_id: u64, + alive: Arc, + frame: Arc>, + size: (u32, u32), + upload_frame: bool, +} + +impl VideoPrimitive { + pub fn new( + video_id: u64, + alive: Arc, + frame: Arc>, + size: (u32, u32), + upload_frame: bool, + ) -> Self { + VideoPrimitive { + video_id, + alive, + frame, + size, + upload_frame, + } + } +} + +impl Primitive for VideoPrimitive { + type Pipeline = VideoPipeline; + + fn prepare( + &self, + pipeline: &mut Self::Pipeline, + device: &wgpu::Device, + queue: &wgpu::Queue, + bounds: &Rectangle, + viewport: &Viewport, + ) { + if self.upload_frame { + if let Some(readable) = self.frame.lock().expect("lock frame mutex").readable() { + pipeline.upload( + device, + queue, + self.video_id, + &self.alive, + self.size, + readable.as_slice(), + ); + } + } + + pipeline.prepare(queue, self.video_id, &bounds); + } + + fn render( + &self, + pipeline: &Self::Pipeline, + encoder: &mut wgpu::CommandEncoder, + target: &wgpu::TextureView, + clip_bounds: &Rectangle, + ) { + pipeline.draw(target, encoder, &clip_bounds, self.video_id); + } +} diff --git a/vendor/iced_video_player/src/shader.wgsl b/vendor/iced_video_player/src/shader.wgsl new file mode 100644 index 0000000..f1d85f5 --- /dev/null +++ b/vendor/iced_video_player/src/shader.wgsl @@ -0,0 +1,58 @@ +struct VertexOutput { + @builtin(position) position: vec4, + @location(0) uv: vec2, +} + +struct Uniforms { + rect: vec4, +} + +@group(0) @binding(0) +var tex_y: texture_2d; + +@group(0) @binding(1) +var tex_uv: texture_2d; + +@group(0) @binding(2) +var s: sampler; + +@group(0) @binding(3) +var uniforms: Uniforms; + +@vertex +fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> VertexOutput { + let quad = array, 6>( + uniforms.rect.xy, + uniforms.rect.zy, + uniforms.rect.xw, + uniforms.rect.zy, + uniforms.rect.zw, + uniforms.rect.xw, + ); + + var out: VertexOutput; + out.uv = vec2(0.0); + out.uv.x = select(0.0, 2.0, in_vertex_index == 1u); + out.uv.y = select(0.0, 2.0, in_vertex_index == 2u); + out.position = vec4(out.uv * vec2(2.0, -2.0) + vec2(-1.0, 1.0), 1.0, 1.0); + return out; +} + +@fragment +fn fs_main(in: VertexOutput) -> @location(0) vec4 { + let yuv2r = vec3(1.164, 0.0, 1.596); + let yuv2g = vec3(1.164, -0.391, -0.813); + let yuv2b = vec3(1.164, 2.018, 0.0); + + var yuv = vec3(0.0); + yuv.x = textureSample(tex_y, s, in.uv).r - 0.0625; + yuv.y = textureSample(tex_uv, s, in.uv).r - 0.5; + yuv.z = textureSample(tex_uv, s, in.uv).g - 0.5; + + var rgb = vec3(0.0); + rgb.x = dot(yuv, yuv2r); + rgb.y = dot(yuv, yuv2g); + rgb.z = dot(yuv, yuv2b); + + return vec4(rgb, 1.0); +} diff --git a/vendor/iced_video_player/src/video.rs b/vendor/iced_video_player/src/video.rs new file mode 100644 index 0000000..48e521c --- /dev/null +++ b/vendor/iced_video_player/src/video.rs @@ -0,0 +1,664 @@ +use crate::Error; +use cosmic::iced::widget::image as img; +use gstreamer as gst; +use gstreamer_app as gst_app; +use gstreamer_app::prelude::*; +use std::num::NonZeroU8; +use std::ops::{Deref, DerefMut}; +use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; +use std::sync::{Arc, Mutex, RwLock}; +use std::time::{Duration, Instant}; + +const THUMBNAIL_FRAME_TIMEOUT: Duration = Duration::from_secs(10); + +/// Position in the media. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub enum Position { + /// Position based on time. + /// + /// Not the most accurate format for videos. + Time(Duration), + /// Position based on nth frame. + Frame(u64), +} + +impl From for gst::GenericFormattedValue { + fn from(pos: Position) -> Self { + match pos { + Position::Time(t) => gst::ClockTime::from_nseconds(t.as_nanos() as _).into(), + Position::Frame(f) => gst::format::Default::from_u64(f).into(), + } + } +} + +impl From for Position { + fn from(t: Duration) -> Self { + Position::Time(t) + } +} + +impl From for Position { + fn from(f: u64) -> Self { + Position::Frame(f) + } +} + +#[derive(Debug)] +pub(crate) struct Frame(gst::Sample); + +impl Frame { + pub fn new() -> Self { + Self(gst::Sample::builder().build()) + } + pub fn store(&mut self, sample: gst::Sample) -> Option<()> { + if sample.buffer().is_some() { + self.0 = sample; + Some(()) + } else { + None + } + } + pub fn readable(&self) -> Option> { + self.0.buffer().map(|x| x.map_readable().ok()).flatten() + } +} + +#[derive(Debug)] +pub(crate) struct Internal { + pub(crate) id: u64, + + pub(crate) bus: gst::Bus, + pub(crate) source: gst::Pipeline, + pub(crate) alive: Arc, + pub(crate) worker: Option>, + + pub(crate) has_video: bool, + pub(crate) width: i32, + pub(crate) height: i32, + pub(crate) framerate: f64, + pub(crate) duration: Duration, + pub(crate) speed: f64, + pub(crate) sync_av: bool, + + pub(crate) frame: Arc>, + pub(crate) upload_frame: Arc, + pub(crate) redrawing: Arc, + pub(crate) last_frame_time: Arc>, + pub(crate) looping: bool, + pub(crate) is_eos: bool, + pub(crate) restart_stream: bool, + pub(crate) sync_av_avg: u64, + pub(crate) sync_av_counter: u64, + + pub(crate) subtitle_text: Arc>>, + pub(crate) upload_text: Arc, + + #[cfg(not(feature = "wgpu"))] + pub(crate) handle_opt: Option, +} + +impl Internal { + pub(crate) fn seek(&self, position: impl Into, accurate: bool) -> Result<(), Error> { + let position = position.into(); + + // gstreamer complains if the start & end value types aren't the same + match &position { + Position::Time(_) => self.source.seek( + self.speed, + gst::SeekFlags::FLUSH + | if accurate { + gst::SeekFlags::ACCURATE + } else { + gst::SeekFlags::empty() + }, + gst::SeekType::Set, + gst::GenericFormattedValue::from(position), + gst::SeekType::Set, + gst::ClockTime::NONE, + )?, + Position::Frame(_) => self.source.seek( + self.speed, + gst::SeekFlags::FLUSH + | if accurate { + gst::SeekFlags::ACCURATE + } else { + gst::SeekFlags::empty() + }, + gst::SeekType::Set, + gst::GenericFormattedValue::from(position), + gst::SeekType::Set, + gst::format::Default::NONE, + )?, + }; + + Ok(()) + } + + pub(crate) fn set_speed(&mut self, speed: f64) -> Result<(), Error> { + let Some(position) = self.source.query_position::() else { + return Err(Error::Caps); + }; + if speed > 0.0 { + self.source.seek( + speed, + gst::SeekFlags::FLUSH | gst::SeekFlags::ACCURATE, + gst::SeekType::Set, + position, + gst::SeekType::End, + gst::ClockTime::from_seconds(0), + )?; + } else { + self.source.seek( + speed, + gst::SeekFlags::FLUSH | gst::SeekFlags::ACCURATE, + gst::SeekType::Set, + gst::ClockTime::from_seconds(0), + gst::SeekType::Set, + position, + )?; + } + self.speed = speed; + Ok(()) + } + + pub(crate) fn restart_stream(&mut self) -> Result<(), Error> { + self.is_eos = false; + self.set_paused(false); + self.seek(0, false)?; + Ok(()) + } + + pub(crate) fn set_paused(&mut self, paused: bool) { + self.source + .set_state(if paused { + gst::State::Paused + } else { + gst::State::Playing + }) + .unwrap(/* state was changed in ctor; state errors caught there */); + + // Set restart_stream flag to make the stream restart on the next Message::NextFrame + if self.is_eos && !paused { + self.restart_stream = true; + } + } + + pub(crate) fn paused(&self) -> bool { + self.source.state(gst::ClockTime::ZERO).1 == gst::State::Paused + } + + /// Syncs audio with video when there is (inevitably) latency presenting the frame. + pub(crate) fn set_av_offset(&mut self, offset: Duration) { + if self.sync_av { + self.sync_av_counter += 1; + self.sync_av_avg = self.sync_av_avg * (self.sync_av_counter - 1) / self.sync_av_counter + + offset.as_nanos() as u64 / self.sync_av_counter; + if self.sync_av_counter % 128 == 0 { + self.source + .set_property("av-offset", -(self.sync_av_avg as i64)); + } + } + } +} + +/// A multimedia video loaded from a URI (e.g., a local file path or HTTP stream). +#[derive(Debug)] +pub struct Video(pub(crate) RwLock); + +impl Drop for Video { + fn drop(&mut self) { + let inner = self.0.get_mut().expect("failed to lock"); + + inner + .source + .set_state(gst::State::Null) + .expect("failed to set state"); + + inner.alive.store(false, Ordering::SeqCst); + if let Some(worker) = inner.worker.take() { + worker.join().expect("failed to stop video thread"); + } + } +} + +impl Video { + /// Create a new video player from a given video which loads from `uri`. + /// Note that live sources will report the duration to be zero. + pub fn new(uri: &url::Url) -> Result { + gst::init()?; + + let pipeline = format!( + "playbin uri=\"{}\" text-sink=\"appsink name=iced_text sync=true caps=text/x-raw\" video-sink=\"videoscale ! videoconvert ! appsink name=iced_video drop=true caps=video/x-raw,format=NV12,pixel-aspect-ratio=1/1\"", + uri.as_str() + ); + let pipeline = gst::parse::launch(pipeline.as_ref())? + .downcast::() + .map_err(|_| Error::Cast)?; + + let video_sink: gst::Element = pipeline.property("video-sink"); + let pad = video_sink.pads().first().cloned().unwrap(); + let pad = pad.dynamic_cast::().unwrap(); + let bin = pad + .parent_element() + .unwrap() + .downcast::() + .unwrap(); + let video_sink = bin.by_name("iced_video").unwrap(); + let video_sink = video_sink.downcast::().unwrap(); + + let text_sink: gst::Element = pipeline.property("text-sink"); + let text_sink = text_sink.downcast::().unwrap(); + + Self::from_gst_pipeline(pipeline, video_sink, Some(text_sink)) + } + + /// Creates a new video based on an existing GStreamer pipeline and appsink. + /// Expects an `appsink` plugin with `caps=video/x-raw,format=NV12`. + /// + /// An optional `text_sink` can be provided, which enables subtitle messages + /// to be emitted. + /// + /// **Note:** Many functions of [`Video`] assume a `playbin` pipeline. + /// Non-`playbin` pipelines given here may not have full functionality. + pub fn from_gst_pipeline( + pipeline: gst::Pipeline, + video_sink: gst_app::AppSink, + text_sink: Option, + ) -> Result { + gst::init()?; + static NEXT_ID: AtomicU64 = AtomicU64::new(0); + let id = NEXT_ID.fetch_add(1, Ordering::SeqCst); + + let pad = video_sink.pads().first().cloned().unwrap(); + + pipeline.set_state(gst::State::Playing)?; + + // wait for up to 5 seconds until the decoder gets the source capabilities + pipeline.state(gst::ClockTime::from_seconds(5)).0?; + + // extract resolution and framerate + // TODO(jazzfool): maybe we want to extract some other information too? + let (width, height, framerate, has_video) = if let Some(caps) = pad.current_caps() { + let s = caps.structure(0).ok_or(Error::Caps)?; + let width = s.get::("width").map_err(|_| Error::Caps)?; + let height = s.get::("height").map_err(|_| Error::Caps)?; + // resolution should be mod4 + let width = ((width + 4 - 1) / 4) * 4; + let framerate = s + .get::("framerate") + .map_err(|_| Error::Caps)?; + let framerate = framerate.numer() as f64 / framerate.denom() as f64; + (width, height, framerate, true) + } else { + log::warn!("Video caps not found, falling back to audio only"); + (0, 0, 4.0, false) + }; + + if framerate.is_nan() + || framerate.is_infinite() + || framerate < 0.0 + || framerate.abs() < f64::EPSILON + { + return Err(Error::Framerate(framerate)); + } + + let duration = Duration::from_nanos( + pipeline + .query_duration::() + .map(|duration| duration.nseconds()) + .unwrap_or(0), + ); + + let sync_av = pipeline.has_property("av-offset"); + + // NV12 = 12bpp + let frame = Arc::new(Mutex::new(Frame::new())); + let upload_frame = Arc::new(AtomicBool::new(false)); + let alive = Arc::new(AtomicBool::new(true)); + let last_frame_time = Arc::new(Mutex::new(Instant::now())); + + let frame_ref = Arc::clone(&frame); + let upload_frame_ref = Arc::clone(&upload_frame); + let alive_ref = Arc::clone(&alive); + let last_frame_time_ref = Arc::clone(&last_frame_time); + + let subtitle_text = Arc::new(Mutex::new(None)); + let upload_text = Arc::new(AtomicBool::new(false)); + let subtitle_text_ref = Arc::clone(&subtitle_text); + let upload_text_ref = Arc::clone(&upload_text); + + let pipeline_ref = pipeline.clone(); + + let worker = std::thread::spawn(move || { + let mut clear_subtitles_at = None; + + while alive_ref.load(Ordering::Acquire) { + match (|| -> Result<(), gst::FlowError> { + let sample = + if pipeline_ref.state(gst::ClockTime::ZERO).1 != gst::State::Playing { + video_sink + .try_pull_preroll(gst::ClockTime::from_mseconds(16)) + .ok_or(gst::FlowError::Eos)? + } else { + video_sink + .try_pull_sample(gst::ClockTime::from_mseconds(16)) + .ok_or(gst::FlowError::Eos)? + }; + + *last_frame_time_ref + .lock() + .map_err(|_| gst::FlowError::Error)? = Instant::now(); + + let buffer = sample.buffer().ok_or(gst::FlowError::Error)?; + let pts = buffer.pts().unwrap_or_default(); + { + let mut frame_guard = + frame_ref.lock().map_err(|_| gst::FlowError::Error)?; + *frame_guard = Frame(sample); + } + + upload_frame_ref.swap(true, Ordering::SeqCst); + + if let Some(at) = clear_subtitles_at { + if pts >= at { + *subtitle_text_ref + .lock() + .map_err(|_| gst::FlowError::Error)? = None; + upload_text_ref.store(true, Ordering::SeqCst); + clear_subtitles_at = None; + } + } + + let text = text_sink + .as_ref() + .and_then(|sink| sink.try_pull_sample(gst::ClockTime::from_seconds(0))); + if let Some(text) = text { + let text = text.buffer().ok_or(gst::FlowError::Error)?; + let pts = text.pts().unwrap_or_default(); + let duration = text.duration().unwrap_or(gst::ClockTime::ZERO); + let map = text.map_readable().map_err(|_| gst::FlowError::Error)?; + + let text = html_escape::decode_html_entities( + std::str::from_utf8(map.as_slice()) + .map_err(|_| gst::FlowError::Error)?, + ) + .to_string(); + *subtitle_text_ref + .lock() + .map_err(|_| gst::FlowError::Error)? = Some(text); + upload_text_ref.store(true, Ordering::SeqCst); + + clear_subtitles_at = Some(pts + duration); + } + + Ok(()) + })() { + Ok(()) => {} + Err(gst::FlowError::Eos) => { + if !has_video { + // Simulate frame upload when there is no video stream + upload_frame_ref.swap(true, Ordering::SeqCst); + std::thread::sleep(Duration::from_secs_f64(1.0 / framerate)); + } + } + Err(err) => { + log::error!("error pulling frame: {err}"); + } + } + } + }); + + Ok(Video(RwLock::new(Internal { + id, + + bus: pipeline.bus().unwrap(), + source: pipeline, + alive, + worker: Some(worker), + + has_video, + width, + height, + framerate, + duration, + speed: 1.0, + sync_av, + + frame, + upload_frame, + redrawing: Arc::new(AtomicBool::new(false)), + last_frame_time, + looping: false, + is_eos: false, + restart_stream: false, + sync_av_avg: 0, + sync_av_counter: 0, + + subtitle_text, + upload_text, + + #[cfg(not(feature = "wgpu"))] + handle_opt: None, + }))) + } + + pub(crate) fn read(&self) -> impl Deref + '_ { + self.0.read().expect("lock") + } + + pub(crate) fn write(&self) -> impl DerefMut + '_ { + self.0.write().expect("lock") + } + + pub(crate) fn get_mut(&mut self) -> impl DerefMut + '_ { + self.0.get_mut().expect("lock") + } + + pub fn has_video(&self) -> bool { + self.read().has_video + } + + /// Get the size/resolution of the video as `(width, height)`. + pub fn size(&self) -> (i32, i32) { + (self.read().width, self.read().height) + } + + /// Get the framerate of the video as frames per second. + pub fn framerate(&self) -> f64 { + self.read().framerate + } + + /// Set the volume multiplier of the audio. + /// `0.0` = 0% volume, `1.0` = 100% volume. + /// + /// This uses a linear scale, for example `0.5` is perceived as half as loud. + pub fn set_volume(&mut self, volume: f64) { + self.get_mut().source.set_property("volume", volume); + self.set_muted(self.muted()); // for some reason gstreamer unmutes when changing volume? + } + + /// Get the volume multiplier of the audio. + pub fn volume(&self) -> f64 { + self.read().source.property("volume") + } + + /// Set if the audio is muted or not, without changing the volume. + pub fn set_muted(&mut self, muted: bool) { + self.get_mut().source.set_property("mute", muted); + } + + /// Get if the audio is muted or not. + pub fn muted(&self) -> bool { + self.read().source.property("mute") + } + + /// Get if the stream ended or not. + pub fn eos(&self) -> bool { + self.read().is_eos + } + + /// Get if the media will loop or not. + pub fn looping(&self) -> bool { + self.read().looping + } + + /// Set if the media will loop or not. + pub fn set_looping(&mut self, looping: bool) { + self.get_mut().looping = looping; + } + + /// Set if the media is paused or not. + pub fn set_paused(&mut self, paused: bool) { + self.get_mut().set_paused(paused) + } + + /// Get if the media is paused or not. + pub fn paused(&self) -> bool { + self.read().paused() + } + + /// Jumps to a specific position in the media. + /// Passing `true` to the `accurate` parameter will result in more accurate seeking, + /// however, it is also slower. For most seeks (e.g., scrubbing) this is not needed. + pub fn seek(&mut self, position: impl Into, accurate: bool) -> Result<(), Error> { + self.get_mut().seek(position, accurate) + } + + /// Set the playback speed of the media. + /// The default speed is `1.0`. + pub fn set_speed(&mut self, speed: f64) -> Result<(), Error> { + self.get_mut().set_speed(speed) + } + + /// Get the current playback speed. + pub fn speed(&self) -> f64 { + self.read().speed + } + + /// Get the current playback position in time. + pub fn position(&self) -> Duration { + Duration::from_nanos( + self.read() + .source + .query_position::() + .map_or(0, |pos| pos.nseconds()), + ) + } + + /// Get the media duration. + pub fn duration(&self) -> Duration { + self.read().duration + } + + /// Restarts a stream; seeks to the first frame and unpauses, sets the `eos` flag to false. + pub fn restart_stream(&mut self) -> Result<(), Error> { + self.get_mut().restart_stream() + } + + /// Set the subtitle URL to display. + pub fn set_subtitle_url(&mut self, url: &url::Url) -> Result<(), Error> { + let paused = self.paused(); + let mut inner = self.get_mut(); + inner.source.set_state(gst::State::Ready)?; + inner.source.set_property("suburi", url.as_str()); + inner.set_paused(paused); + Ok(()) + } + + /// Get the current subtitle URL. + pub fn subtitle_url(&self) -> Option { + url::Url::parse(&self.read().source.property::("suburi")).ok() + } + + /// Get the underlying GStreamer pipeline. + pub fn pipeline(&self) -> gst::Pipeline { + self.read().source.clone() + } + + /// Generates a list of thumbnails based on a set of positions in the media, downscaled by a given factor. + /// + /// Slow; only needs to be called once for each instance. + /// It's best to call this at the very start of playback, otherwise the position may shift. + pub fn thumbnails( + &mut self, + positions: I, + downscale: NonZeroU8, + ) -> Result, Error> + where + I: IntoIterator, + { + let downscale = u8::from(downscale) as u32; + + let paused = self.paused(); + let muted = self.muted(); + let pos = self.position(); + + self.set_paused(false); + self.set_muted(true); + + let out = { + let inner = self.read(); + let width = inner.width; + let height = inner.height; + positions + .into_iter() + .map(|pos| { + inner.seek(pos, true)?; + + inner.upload_frame.store(false, Ordering::SeqCst); + + let started = Instant::now(); + while !inner.upload_frame.load(Ordering::SeqCst) { + if started.elapsed() >= THUMBNAIL_FRAME_TIMEOUT { + return Err(Error::Sync); + } + std::thread::sleep(Duration::from_millis(5)); + } + let frame_guard = inner.frame.lock().map_err(|_| Error::Lock)?; + let frame = frame_guard.readable().ok_or(Error::Lock)?; + + Ok(img::Handle::from_rgba( + inner.width as u32 / downscale, + inner.height as u32 / downscale, + yuv_to_rgba(frame.as_slice(), width as _, height as _, downscale), + )) + }) + .collect() + }; + + self.set_paused(paused); + self.set_muted(muted); + self.seek(pos, true)?; + + out + } +} + +pub(crate) fn yuv_to_rgba(yuv: &[u8], width: u32, height: u32, downscale: u32) -> Vec { + let uv_start = width * height; + let mut rgba = vec![]; + + for y in 0..height / downscale { + for x in 0..width / downscale { + let x_src = x * downscale; + let y_src = y * downscale; + + let uv_i = uv_start + width * (y_src / 2) + x_src / 2 * 2; + + let y = yuv[(y_src * width + x_src) as usize] as f32; + let u = yuv[uv_i as usize] as f32; + let v = yuv[(uv_i + 1) as usize] as f32; + + let r = 1.164 * (y - 16.0) + 1.596 * (v - 128.0); + let g = 1.164 * (y - 16.0) - 0.813 * (v - 128.0) - 0.391 * (u - 128.0); + let b = 1.164 * (y - 16.0) + 2.018 * (u - 128.0); + + rgba.push(r as u8); + rgba.push(g as u8); + rgba.push(b as u8); + rgba.push(0xFF); + } + } + + rgba +} diff --git a/vendor/iced_video_player/src/video_player.rs b/vendor/iced_video_player/src/video_player.rs new file mode 100644 index 0000000..7e0be6e --- /dev/null +++ b/vendor/iced_video_player/src/video_player.rs @@ -0,0 +1,476 @@ +use crate::{gst, gst_pbutils, video::Video}; +use cosmic::iced::{ + self, + advanced::{self, layout, widget, Widget}, + mouse, Element, +}; +use gstreamer_app::prelude::*; +use log::error; +use std::{marker::PhantomData, sync::atomic::Ordering, time::Duration}; +use std::{sync::Arc, time::Instant}; + +#[cfg(feature = "wgpu")] +use crate::pipeline::VideoPrimitive; +#[cfg(feature = "wgpu")] +use iced_wgpu::primitive::Renderer as PrimitiveRenderer; + +#[cfg(not(feature = "wgpu"))] +use crate::video::yuv_to_rgba; +#[cfg(not(feature = "wgpu"))] +use cosmic::iced::advanced::image::Renderer as ImageRenderer; +#[cfg(not(feature = "wgpu"))] +trait PrimitiveRenderer: ImageRenderer {} +#[cfg(not(feature = "wgpu"))] +impl PrimitiveRenderer for iced::Renderer {} + +/// Video player widget which displays the current frame of a [`Video`](crate::Video). +pub struct VideoPlayer<'a, Message, Theme = iced::Theme, Renderer = iced::Renderer> +where + Renderer: PrimitiveRenderer, +{ + video: &'a Video, + content_fit: iced::ContentFit, + width: iced::Length, + height: iced::Length, + mouse_hidden: bool, + on_duration_changed: Option Message + 'a>>, + on_end_of_stream: Option, + on_new_frame: Option, + on_subtitle_text: Option) -> Message + 'a>>, + on_error: Option Message + 'a>>, + on_missing_plugin: Option Message + 'a>>, + on_tags: Option Message + 'a>>, + on_warning: Option Message + 'a>>, + id: Option, + _phantom: PhantomData<(Theme, Renderer)>, +} + +impl<'a, Message, Theme, Renderer> VideoPlayer<'a, Message, Theme, Renderer> +where + Renderer: PrimitiveRenderer, +{ + /// Creates a new video player widget for a given video. + pub fn new(video: &'a Video) -> Self { + VideoPlayer { + video, + content_fit: iced::ContentFit::Contain, + width: iced::Length::Shrink, + height: iced::Length::Shrink, + mouse_hidden: false, + on_duration_changed: None, + on_end_of_stream: None, + on_new_frame: None, + on_subtitle_text: None, + on_error: None, + on_missing_plugin: None, + on_tags: None, + on_warning: None, + _phantom: Default::default(), + id: None, + } + } + + /// Sets the ID of the `VideoPlayer`. + pub fn id(mut self, id: cosmic::widget::Id) -> Self { + self.id = Some(id); + self + } + + /// Sets the width of the `VideoPlayer` boundaries. + pub fn width(self, width: impl Into) -> Self { + VideoPlayer { + width: width.into(), + ..self + } + } + + /// Sets the height of the `VideoPlayer` boundaries. + pub fn height(self, height: impl Into) -> Self { + VideoPlayer { + height: height.into(), + ..self + } + } + + /// Sets the `ContentFit` of the `VideoPlayer`. + pub fn content_fit(self, content_fit: iced::ContentFit) -> Self { + VideoPlayer { + content_fit, + ..self + } + } + + pub fn mouse_hidden(self, mouse_hidden: bool) -> Self { + VideoPlayer { + mouse_hidden, + ..self + } + } + + pub fn on_duration_changed(self, on_duration_changed: F) -> Self + where + F: 'a + Fn(Duration) -> Message, + { + VideoPlayer { + on_duration_changed: Some(Box::new(on_duration_changed)), + ..self + } + } + + /// Message to send when the video reaches the end of stream (i.e., the video ends). + pub fn on_end_of_stream(self, on_end_of_stream: Message) -> Self { + VideoPlayer { + on_end_of_stream: Some(on_end_of_stream), + ..self + } + } + + /// Message to send when the video receives a new frame. + pub fn on_new_frame(self, on_new_frame: Message) -> Self { + VideoPlayer { + on_new_frame: Some(on_new_frame), + ..self + } + } + + /// Message to send when the video receives a new frame. + pub fn on_subtitle_text(self, on_subtitle_text: F) -> Self + where + F: 'a + Fn(Option) -> Message, + { + VideoPlayer { + on_subtitle_text: Some(Box::new(on_subtitle_text)), + ..self + } + } + + /// Message to send when the video playback encounters an error. + pub fn on_error(self, on_error: F) -> Self + where + F: 'a + Fn(glib::Error) -> Message, + { + VideoPlayer { + on_error: Some(Box::new(on_error)), + ..self + } + } + + pub fn on_missing_plugin(self, on_missing_plugin: F) -> Self + where + F: 'a + Fn(gst::Message) -> Message, + { + VideoPlayer { + on_missing_plugin: Some(Box::new(on_missing_plugin)), + ..self + } + } + + pub fn on_tags(self, on_tags: F) -> Self + where + F: 'a + Fn(gst::TagList) -> Message, + { + VideoPlayer { + on_tags: Some(Box::new(on_tags)), + ..self + } + } + + pub fn on_warning(self, on_warning: F) -> Self + where + F: 'a + Fn(glib::Error) -> Message, + { + VideoPlayer { + on_warning: Some(Box::new(on_warning)), + ..self + } + } +} + +impl<'a, Message, Theme, Renderer> Widget + for VideoPlayer<'a, Message, Theme, Renderer> +where + Message: Clone, + Renderer: PrimitiveRenderer, +{ + fn size(&self) -> iced::Size { + iced::Size { + width: iced::Length::Shrink, + height: iced::Length::Shrink, + } + } + + fn layout( + &mut self, + _tree: &mut widget::Tree, + _renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + let (video_width, video_height) = self.video.size(); + + // based on `Image::layout` + let image_size = iced::Size::new(video_width as f32, video_height as f32); + let raw_size = limits.resolve(self.width, self.height, image_size); + let full_size = self.content_fit.fit(image_size, raw_size); + let final_size = iced::Size { + width: match self.width { + iced::Length::Shrink => f32::min(raw_size.width, full_size.width), + _ => raw_size.width, + }, + height: match self.height { + iced::Length::Shrink => f32::min(raw_size.height, full_size.height), + _ => raw_size.height, + }, + }; + + layout::Node::new(final_size) + } + + fn draw( + &self, + _tree: &widget::Tree, + renderer: &mut Renderer, + _theme: &Theme, + _style: &advanced::renderer::Style, + layout: advanced::Layout<'_>, + _cursor: advanced::mouse::Cursor, + _viewport: &iced::Rectangle, + ) { + let mut inner = self.video.write(); + + // bounds based on `Image::draw` + let image_size = iced::Size::new(inner.width as f32, inner.height as f32); + let bounds = layout.bounds(); + let adjusted_fit = self.content_fit.fit(image_size, bounds.size()); + let scale = iced::Vector::new( + adjusted_fit.width / image_size.width, + adjusted_fit.height / image_size.height, + ); + let final_size = iced::Size::new(image_size.width * scale.x, image_size.height * scale.y); + + let position = match self.content_fit { + iced::ContentFit::None => iced::Point::new( + bounds.x + (image_size.width - adjusted_fit.width) / 2.0, + bounds.y + (image_size.height - adjusted_fit.height) / 2.0, + ), + _ => iced::Point::new( + bounds.center_x() - final_size.width / 2.0, + bounds.center_y() - final_size.height / 2.0, + ), + }; + + let drawing_bounds = iced::Rectangle::new(position, final_size); + + let upload_frame = inner.upload_frame.swap(false, Ordering::SeqCst); + inner.redrawing.store(false, Ordering::SeqCst); + + if upload_frame { + let last_frame_time = inner + .last_frame_time + .lock() + .map(|time| *time) + .unwrap_or_else(|_| Instant::now()); + inner.set_av_offset(Instant::now() - last_frame_time); + } + + #[cfg(feature = "wgpu")] + renderer.draw_primitive( + drawing_bounds, + VideoPrimitive::new( + inner.id, + Arc::clone(&inner.alive), + Arc::clone(&inner.frame), + (inner.width as _, inner.height as _), + upload_frame, + ), + ); + + #[cfg(not(feature = "wgpu"))] + { + if upload_frame { + let mut opt = None; + { + let yuv_data_opt = match inner.frame.lock() { + Ok(frame) => Some(frame), + Err(_err) => None, + }; + if let Some(yuv_data) = yuv_data_opt.as_ref().and_then(|d| d.readable()) { + //TODO: convert on worker thread? + let rgba_data = + yuv_to_rgba(&yuv_data, inner.width as _, inner.height as _, 1); + opt = Some(advanced::image::Handle::from_rgba( + inner.width as _, + inner.height as _, + rgba_data, + )) + }; + } + inner.handle_opt = opt; + } + if let Some(handle) = &inner.handle_opt { + use cosmic::iced::Radians; + + renderer.draw_image( + handle.clone(), + advanced::image::FilterMethod::Nearest, + drawing_bounds, + Radians(0.), + 1.0, + [0.0; 4], + ); + } + } + } + + fn update( + &mut self, + _state: &mut widget::Tree, + event: &iced::Event, + _layout: advanced::Layout<'_>, + _cursor: advanced::mouse::Cursor, + _renderer: &Renderer, + _clipboard: &mut dyn advanced::Clipboard, + shell: &mut advanced::Shell<'_, Message>, + _viewport: &iced::Rectangle, + ) { + let mut inner = self.video.write(); + + if let iced::Event::Window(iced::window::Event::RedrawRequested(_)) = event { + if inner.restart_stream || (!inner.is_eos && !inner.paused()) { + let mut restart_stream = false; + if inner.restart_stream { + restart_stream = true; + // Set flag to false to avoid potentially multiple seeks + inner.restart_stream = false; + } + let mut eos_pause = false; + + while let Some(msg) = inner.bus.pop_filtered(&[ + gst::MessageType::DurationChanged, + gst::MessageType::Error, + gst::MessageType::Element, + gst::MessageType::Eos, + gst::MessageType::Tag, + gst::MessageType::Warning, + ]) { + match msg.view() { + gst::MessageView::DurationChanged(_) => { + inner.duration = Duration::from_nanos( + inner + .source + .query_duration::() + .map(|duration| duration.nseconds()) + .unwrap_or(0), + ); + if let Some(ref on_duration_changed) = self.on_duration_changed { + shell.publish(on_duration_changed(inner.duration)); + } + } + gst::MessageView::Error(err) => { + error!("bus returned an error: {err}"); + if let Some(ref on_error) = self.on_error { + shell.publish(on_error(err.error())) + }; + } + gst::MessageView::Element(element) => { + if gst_pbutils::MissingPluginMessage::is(&element) { + if let Some(ref on_missing_plugin) = self.on_missing_plugin { + shell.publish(on_missing_plugin(element.copy())); + } + } + } + gst::MessageView::Eos(_eos) => { + if let Some(on_end_of_stream) = self.on_end_of_stream.clone() { + shell.publish(on_end_of_stream); + } + if inner.looping { + restart_stream = true; + } else { + eos_pause = true; + } + } + gst::MessageView::Tag(tag_msg) => { + if let Some(ref on_tags) = self.on_tags { + shell.publish(on_tags(tag_msg.tags())); + } + } + gst::MessageView::Warning(warn) => { + log::warn!("bus returned a warning: {warn}"); + if let Some(ref on_warning) = self.on_warning { + shell.publish(on_warning(warn.error())); + } + } + _ => {} + } + } + + // Don't run eos_pause if restart_stream is true; fixes "pausing" after restarting a stream + if restart_stream { + if let Err(err) = inner.restart_stream() { + error!("cannot restart stream (can't seek): {err:#?}"); + } + } else if eos_pause { + inner.is_eos = true; + inner.set_paused(true); + } + + if !inner.redrawing.load(Ordering::SeqCst) + && inner.upload_frame.load(Ordering::SeqCst) + { + if let Some(on_new_frame) = self.on_new_frame.clone() { + inner.redrawing.store(true, Ordering::SeqCst); + shell.publish(on_new_frame); + } + } + + if let Some(on_subtitle_text) = &self.on_subtitle_text { + if inner.upload_text.swap(false, Ordering::SeqCst) { + if let Ok(text) = inner.subtitle_text.try_lock() { + shell.publish(on_subtitle_text(text.clone())); + } + } + } + + shell.request_redraw(); + } else { + shell.request_redraw_at(iced::window::RedrawRequest::At( + Instant::now() + Duration::from_millis(32), + )); + } + } + } + + fn mouse_interaction( + &self, + _tree: &widget::Tree, + _layout: advanced::Layout<'_>, + _cursor_position: mouse::Cursor, + _viewport: &iced::Rectangle, + _renderer: &Renderer, + ) -> mouse::Interaction { + if self.mouse_hidden { + mouse::Interaction::Hidden + } else { + mouse::Interaction::default() + } + } + + fn set_id(&mut self, id: widget::Id) { + self.id = Some(id); + } + + fn id(&self) -> Option { + self.id.clone() + } +} + +impl<'a, Message, Theme, Renderer> From> + for Element<'a, Message, Theme, Renderer> +where + Message: 'a + Clone, + Theme: 'a, + Renderer: 'a + PrimitiveRenderer, +{ + fn from(video_player: VideoPlayer<'a, Message, Theme, Renderer>) -> Self { + Self::new(video_player) + } +} From 1e0a8add0f580e4a8f77cd06ff4bf0ce66765b45 Mon Sep 17 00:00:00 2001 From: leyoda Date: Mon, 18 May 2026 16:16:36 +0200 Subject: [PATCH 02/19] local: add cosmic-player redeploy helper --- redeploy.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 redeploy.sh diff --git a/redeploy.sh b/redeploy.sh new file mode 100755 index 0000000..5f61724 --- /dev/null +++ b/redeploy.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Rebuild and deploy the local COSMIC Media Player fork. +# +# Keep this binary in /usr/local/bin so it intentionally overrides the packaged +# /usr/bin/cosmic-player, but only after rebuilding from the current local +# source tree. + +set -euo pipefail + +REPO="${COSMIC_PLAYER_REPO:-/home/lionel/Projets/COSMIC/cosmic-player}" +TOOLCHAIN="${COSMIC_RUST_TOOLCHAIN:-1.93.0}" +PREFIX="${COSMIC_LOCAL_PREFIX:-/usr/local}" +APPID="com.system76.CosmicPlayer" +BIN_NAME="cosmic-player" + +cd "$REPO" + +echo "==> Repository: $REPO" +echo "==> Branch: $(git branch --show-current 2>/dev/null || echo unknown)" +echo "==> Build release with Rust $TOOLCHAIN" +cargo "+$TOOLCHAIN" build --release + +bin_built="$REPO/target/release/$BIN_NAME" +bin_target="$PREFIX/bin/$BIN_NAME" + +if [[ -e "$bin_target" ]]; then + backup="${bin_target}.bak.$(date +%Y%m%d-%H%M%S)" + echo "==> Backup $bin_target -> $backup" + sudo cp -a "$bin_target" "$backup" +fi + +echo "==> Install binary" +sudo install -Dm0755 "$bin_built" "$bin_target" + +echo "==> Install desktop integration" +sudo install -Dm0644 "target/xdgen/$APPID.desktop" "$PREFIX/share/applications/$APPID.desktop" +sudo install -Dm0644 "target/xdgen/$APPID.metainfo.xml" "$PREFIX/share/metainfo/$APPID.metainfo.xml" +sudo install -Dm0644 "res/$APPID.thumbnailer" "$PREFIX/share/thumbnailers/$APPID.thumbnailer" + +while IFS= read -r icon; do + rel="${icon#res/icons/hicolor/}" + sudo install -Dm0644 "$icon" "$PREFIX/share/icons/hicolor/$rel" +done < <(find "res/icons/hicolor" -type f -name "$APPID.svg" | sort) + +echo "==> Installed version" +"$bin_target" --version + +echo "OK - COSMIC Media Player rebuilt and redeployed." From fd03f98738d4fa359afcb8fffedbdfb113711389 Mon Sep 17 00:00:00 2001 From: leyoda Date: Mon, 18 May 2026 16:16:39 +0200 Subject: [PATCH 03/19] iced_video_player: silence local check warnings --- vendor/iced_video_player/src/pipeline.rs | 4 ++-- vendor/iced_video_player/src/video.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vendor/iced_video_player/src/pipeline.rs b/vendor/iced_video_player/src/pipeline.rs index 2d9d3e7..792c1ee 100644 --- a/vendor/iced_video_player/src/pipeline.rs +++ b/vendor/iced_video_player/src/pipeline.rs @@ -32,7 +32,7 @@ pub struct VideoPipeline { } impl VideoPipeline { - fn new(device: &wgpu::Device, format: wgpu::TextureFormat, queue: &wgpu::Queue) -> Self { + fn new(device: &wgpu::Device, format: wgpu::TextureFormat, _queue: &wgpu::Queue) -> Self { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { label: Some("iced_video_player shader"), source: wgpu::ShaderSource::Wgsl(include_str!("shader.wgsl").into()), @@ -417,7 +417,7 @@ impl Primitive for VideoPrimitive { device: &wgpu::Device, queue: &wgpu::Queue, bounds: &Rectangle, - viewport: &Viewport, + _viewport: &Viewport, ) { if self.upload_frame { if let Some(readable) = self.frame.lock().expect("lock frame mutex").readable() { diff --git a/vendor/iced_video_player/src/video.rs b/vendor/iced_video_player/src/video.rs index 48e521c..6d174e5 100644 --- a/vendor/iced_video_player/src/video.rs +++ b/vendor/iced_video_player/src/video.rs @@ -50,6 +50,7 @@ impl Frame { pub fn new() -> Self { Self(gst::Sample::builder().build()) } + #[allow(dead_code)] pub fn store(&mut self, sample: gst::Sample) -> Option<()> { if sample.buffer().is_some() { self.0 = sample; @@ -58,7 +59,7 @@ impl Frame { None } } - pub fn readable(&self) -> Option> { + pub fn readable(&self) -> Option> { self.0.buffer().map(|x| x.map_readable().ok()).flatten() } } From a670d2afd79f68c9945b7976826ff0c82a7ca934 Mon Sep 17 00:00:00 2001 From: leyoda Date: Mon, 18 May 2026 17:26:13 +0200 Subject: [PATCH 04/19] player: register MPEG and WMV support cleanly --- redeploy.sh | 22 ++++++++++++++++++++++ src/main.rs | 1 + src/mime.rs | 27 +++++++++++++++++++++++++++ src/mpris.rs | 4 ++-- 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 src/mime.rs diff --git a/redeploy.sh b/redeploy.sh index 5f61724..553579e 100755 --- a/redeploy.sh +++ b/redeploy.sh @@ -42,6 +42,28 @@ while IFS= read -r icon; do sudo install -Dm0644 "$icon" "$PREFIX/share/icons/hicolor/$rel" done < <(find "res/icons/hicolor" -type f -name "$APPID.svg" | sort) +if command -v update-desktop-database >/dev/null 2>&1; then + echo "==> Refresh desktop database" + if [[ -w "$PREFIX/share/applications" ]]; then + update-desktop-database "$PREFIX/share/applications" || true + else + sudo -n update-desktop-database "$PREFIX/share/applications" 2>/dev/null || \ + echo " skipped: sudo authentication required" + fi +fi + +if command -v xdg-mime >/dev/null 2>&1; then + echo "==> Register common legacy video defaults" + xdg-mime default "$APPID.desktop" \ + video/mpeg \ + video/x-mpeg \ + video/x-mpeg2 \ + video/x-ms-wmv \ + video/x-ms-wm \ + video/x-ms-asf \ + application/vnd.ms-asf +fi + echo "==> Installed version" "$bin_target" --version diff --git a/src/main.rs b/src/main.rs index d9c2233..836fc31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,6 +33,7 @@ mod config; mod key_bind; mod localize; mod menu; +mod mime; #[cfg(feature = "mpris-server")] mod mpris; mod project; diff --git a/src/mime.rs b/src/mime.rs new file mode 100644 index 0000000..dd37736 --- /dev/null +++ b/src/mime.rs @@ -0,0 +1,27 @@ +const DESKTOP_ENTRY: &str = include_str!("../res/com.system76.CosmicPlayer.desktop"); + +pub fn supported_mime_types() -> Vec { + DESKTOP_ENTRY + .lines() + .find_map(|line| line.strip_prefix("MimeType=")) + .map(|mime_types| { + mime_types + .split(';') + .filter(|mime_type| !mime_type.is_empty()) + .map(ToOwned::to_owned) + .collect() + }) + .unwrap_or_default() +} + +pub fn supported_uri_schemes() -> Vec { + supported_mime_types() + .into_iter() + .filter_map(|mime_type| { + mime_type + .strip_prefix("x-scheme-handler/") + .map(ToOwned::to_owned) + }) + .chain(["file".to_string(), "http".to_string(), "https".to_string()]) + .collect() +} diff --git a/src/mpris.rs b/src/mpris.rs index 8c87244..92dfcef 100644 --- a/src/mpris.rs +++ b/src/mpris.rs @@ -138,12 +138,12 @@ impl RootInterface for Player { async fn supported_uri_schemes(&self) -> fdo::Result> { log::info!("SupportedUriSchemes"); - Ok(vec![]) + Ok(crate::mime::supported_uri_schemes()) } async fn supported_mime_types(&self) -> fdo::Result> { log::info!("SupportedMimeTypes"); - Ok(vec![]) + Ok(crate::mime::supported_mime_types()) } } From a1a1c07932d6403ca495a403f51191489395313a Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Mon, 25 May 2026 09:55:32 +0200 Subject: [PATCH 05/19] yoda: refresh local dbus binding lock --- Cargo.lock | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61b931e..5b4bc9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1135,8 +1135,7 @@ dependencies = [ [[package]] name = "cosmic-settings-daemon" -version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +version = "0.1.1-yoda.1" dependencies = [ "zbus", ] From bee543258aa362ad403c8c30e95eb72b89d2de06 Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Mon, 25 May 2026 11:34:55 +0200 Subject: [PATCH 06/19] chore: use local cosmic-text checkout --- Cargo.lock | 2 +- Cargo.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 5b4bc9d..b711e4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1143,7 +1143,6 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.19.0" -source = "git+https://github.com/pop-os/cosmic-text.git#c24886c2471e5606587c46090cd25dbbf209186b" dependencies = [ "bitflags 2.11.1", "fontdb", @@ -1161,6 +1160,7 @@ dependencies = [ "unicode-linebreak", "unicode-script", "unicode-segmentation", + "unicode-width", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d55a60a..d0aff17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,9 @@ debug = true # [patch.'https://github.com/wash2/iced_video_player'] # iced_video_player = { path = "../iced_video_player" } +[patch.'https://github.com/pop-os/cosmic-text.git'] +cosmic-text = { path = "../cosmic-text" } + # libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } # cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } # cosmic-theme = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } From 91b1ad874d9f80267c590bcad2f5afd5cc60da8b Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Mon, 25 May 2026 12:11:14 +0200 Subject: [PATCH 07/19] feat: add about drawer --- Cargo.lock | 37 ++++++++++++++++++++++++++++++ Cargo.toml | 3 ++- i18n/en/cosmic_player.ftl | 4 ++++ i18n/fr/cosmic_player.ftl | 4 ++++ src/main.rs | 48 +++++++++++++++++++++++++++++++++++++-- src/menu.rs | 7 ++++++ 6 files changed, 100 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b711e4d..166ba56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1110,6 +1110,7 @@ dependencies = [ "libcosmic-yoda", "log", "mpris-server", + "open", "rust-embed", "serde", "tempfile", @@ -3031,6 +3032,25 @@ dependencies = [ "unic-langid", ] +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -4043,6 +4063,17 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" +[[package]] +name = "open" +version = "5.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fbaa89d2ddc8473c78a3adf69eea8cffa28c483b8e02a971ef31527cd0fc92c" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -4192,6 +4223,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5a797f0e07bdf071d15742978fc3128ec6c22891c31a3a931513263904c982a" +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + [[package]] name = "percent-encoding" version = "2.3.2" diff --git a/Cargo.toml b/Cargo.toml index d0aff17..2de6309 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ rust-embed = "8" # Logging env_logger = "0.11" log = "0.4" +open = "5.3.2" [dependencies.iced_video_player] path = "vendor/iced_video_player" @@ -39,7 +40,7 @@ default-features = false package = "libcosmic-yoda" path = "../libcosmic" default-features = false -features = ["advanced-shaping", "tokio", "winit", "multi-window"] +features = ["about", "advanced-shaping", "tokio", "winit", "multi-window"] [dependencies.mpris-server] version = "0.10" diff --git a/i18n/en/cosmic_player.ftl b/i18n/en/cosmic_player.ftl index 36cb2b2..2938403 100644 --- a/i18n/en/cosmic_player.ftl +++ b/i18n/en/cosmic_player.ftl @@ -39,6 +39,10 @@ repeat-disabled = Repeat disabled repeat-track = Repeat track playback = Playback +help = Help +menu-about = About COSMIC Media Player... +repository = Repository +support = Support next-frame = Next Frame previous-frame = Previous Frame ab-repeat = A-B Repeat diff --git a/i18n/fr/cosmic_player.ftl b/i18n/fr/cosmic_player.ftl index cb796bb..4517bbe 100644 --- a/i18n/fr/cosmic_player.ftl +++ b/i18n/fr/cosmic_player.ftl @@ -40,6 +40,10 @@ clear-recent = Effacer la liste récente repeat-disabled = Répétition désactivée repeat-track = Répéter la piste playback = Lecture +help = Aide +menu-about = À propos du lecteur multimédia COSMIC... +repository = Dépôt +support = Support next-frame = Prochaine image previous-frame = Image précédente ab-repeat = Répétition A-B diff --git a/src/main.rs b/src/main.rs index 836fc31..bb74ab4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use cosmic::app::{Core, Settings, Task}; +use cosmic::app::{Core, Settings, Task, context_drawer}; use cosmic::command::set_theme; use cosmic::cosmic_config::{self, CosmicConfigEntry}; use cosmic::iced::event::{self, Event}; @@ -12,7 +12,7 @@ use cosmic::iced::{ }; use cosmic::iced::window::set_mode; use cosmic::widget::menu::action::MenuAction; -use cosmic::widget::{self, Slider, nav_bar, segmented_button}; +use cosmic::widget::{self, Slider, about::About, nav_bar, segmented_button}; use cosmic::{Application, ApplicationExt, Element, action, cosmic_theme, executor, font, theme}; use iced_video_player::gst::prelude::*; use iced_video_player::{Video, VideoPlayer, gst, gst_pbutils}; @@ -167,6 +167,7 @@ fn main() -> Result<(), Box> { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Action { + About, FileClose, FileOpen, FileClearRecents, @@ -192,6 +193,7 @@ impl MenuAction for Action { fn message(&self) -> Message { match self { + Self::About => Message::ToggleAbout, Self::FileClose => Message::FileClose, Self::FileOpen => Message::FileOpen, Self::FileClearRecents => Message::FileClearRecents, @@ -289,6 +291,7 @@ pub enum Message { FolderOpenRecent(usize), MultipleLoad(Vec), Fullscreen, + LaunchUrl(String), Key(Modifiers, Key), AudioCode(usize), AudioToggle, @@ -314,12 +317,14 @@ pub enum Message { AbRepeat, ShowControls, SystemThemeModeChange(cosmic_theme::ThemeMode), + ToggleAbout, WindowClose, } /// The [`App`] stores application-specific state. pub struct App { core: Core, + about: About, flags: Flags, album_art_opt: Option, controls: bool, @@ -883,8 +888,26 @@ impl Application for App { tx }; + let about = About::default() + .name(fl!("xdg-name")) + .icon(widget::icon::from_name(Self::APP_ID)) + .version(env!("CARGO_PKG_VERSION")) + .author("System76") + .comments(fl!("xdg-comment")) + .license("GPL-3.0-only") + .license_url("https://spdx.org/licenses/GPL-3.0-only") + .developers([("Jeremy Soller", "jeremy@system76.com")]) + .links([ + (fl!("repository"), "https://github.com/pop-os/cosmic-player"), + ( + fl!("support"), + "https://github.com/pop-os/cosmic-player/issues", + ), + ]); + let mut app = App { core, + about, flags, album_art_opt: None, controls: true, @@ -1202,6 +1225,12 @@ impl Application for App { ); } } + Message::LaunchUrl(url) => match open::that_detached(&url) { + Ok(()) => {} + Err(err) => { + log::warn!("failed to open URL {:?}: {}", url, err); + } + }, Message::Key(modifiers, key) => { for (key_bind, action) in self.key_binds.iter() { if key_bind.matches(modifiers, &key) { @@ -1611,6 +1640,9 @@ impl Application for App { Message::SystemThemeModeChange(_theme_mode) => { return self.update_config(); } + Message::ToggleAbout => { + self.core.set_show_context(!self.core.window.show_context); + } Message::WindowClose => { self.close(); return exit(); @@ -1630,6 +1662,18 @@ impl Application for App { )] } + fn context_drawer(&self) -> Option> { + if !self.core.window.show_context { + return None; + } + + Some(context_drawer::about( + &self.about, + |url| Message::LaunchUrl(url.to_string()), + Message::ToggleAbout, + )) + } + /// Creates a view after each update. fn view(&self) -> Element<'_, Self::Message> { let theme = theme::active(); diff --git a/src/menu.rs b/src/menu.rs index 0f21053..fd99206 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -132,6 +132,13 @@ pub fn menu_bar<'a>( RcElementWrapper::new(Element::from(menu::root(fl!("playback")))), menu::items(key_binds, playback), ), + menu::Tree::with_children( + RcElementWrapper::new(Element::from(menu::root(fl!("help")))), + menu::items( + key_binds, + vec![menu::Item::Button(fl!("menu-about"), None, Action::About)], + ), + ), ]) .item_height(ItemHeight::Dynamic(40)) .item_width(ItemWidth::Uniform(320)) From b989d63c2ed7b984a88bebde2c257ee70b44c1bb Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Mon, 25 May 2026 14:27:37 +0200 Subject: [PATCH 08/19] fix(keybinds): adapt key_bind.matches to new 3-arg signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream libcosmic added an Option<&Physical> third parameter to KeyBind::matches for physical-key matching. We pass None at every call site since these paths only have the logical key available. Also refresh Cargo.lock to satisfy the libcosmic-yoda squash rebase absorbed on 2026-05-25. Leyoda 2026 – GPLv3 --- Cargo.lock | 43 +++++++++++++++++++++++++++++++++++-------- src/main.rs | 2 +- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 166ba56..36a5175 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1043,7 +1043,20 @@ version = "0.2.0" source = "git+https://github.com/pop-os/cosmic-protocols?rev=160b086#160b086abe03cd34a8a375d7fbe47b24308d1f38" dependencies = [ "bitflags 2.11.1", - "cosmic-protocols", + "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "libc", + "smithay-client-toolkit", + "wayland-client", + "wayland-protocols", +] + +[[package]] +name = "cosmic-client-toolkit" +version = "0.2.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" +dependencies = [ + "bitflags 2.11.1", + "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", "libc", "smithay-client-toolkit", "wayland-client", @@ -1081,7 +1094,7 @@ dependencies = [ [[package]] name = "cosmic-freedesktop-icons" version = "0.4.0" -source = "git+https://github.com/pop-os/freedesktop-icons#9c562fe3ecf03241a46a60c0078cd6ea10bd75ce" +source = "git+https://github.com/pop-os/freedesktop-icons#739e266210d471c09af61d529d8f41dccd815b90" dependencies = [ "bstr", "btoi", @@ -1134,6 +1147,20 @@ dependencies = [ "wayland-server", ] +[[package]] +name = "cosmic-protocols" +version = "0.2.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" +dependencies = [ + "bitflags 2.11.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "wayland-server", +] + [[package]] name = "cosmic-settings-daemon" version = "0.1.1-yoda.1" @@ -2557,7 +2584,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytes", - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "dnd", "glam", "lilt", @@ -2640,7 +2667,7 @@ name = "iced_runtime" version = "0.14.0" dependencies = [ "bytes", - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "dnd", "iced_core", "iced_futures", @@ -2688,7 +2715,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytemuck", - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "cryoglyph", "futures", "glam", @@ -2713,7 +2740,7 @@ dependencies = [ name = "iced_widget" version = "0.14.2" dependencies = [ - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "dnd", "iced_renderer", "iced_runtime", @@ -2730,7 +2757,7 @@ dependencies = [ name = "iced_winit" version = "0.14.0" dependencies = [ - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "cursor-icon", "dnd", "iced_debug", @@ -3313,7 +3340,7 @@ dependencies = [ "apply", "ashpd 0.12.3", "auto_enums", - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", "cosmic-config", "cosmic-freedesktop-icons", "cosmic-settings-daemon", diff --git a/src/main.rs b/src/main.rs index bb74ab4..22fd8e7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1233,7 +1233,7 @@ impl Application for App { }, Message::Key(modifiers, key) => { for (key_bind, action) in self.key_binds.iter() { - if key_bind.matches(modifiers, &key) { + if key_bind.matches(modifiers, &key, None) { return self.update(action.message()); } } From 86ae7d1b37a79fcc22f1eeaace0a4762147f4a80 Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Mon, 25 May 2026 18:10:22 +0200 Subject: [PATCH 09/19] chore: refresh local dependency lockfile --- Cargo.lock | 48 +++++++----------------------------------------- 1 file changed, 7 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36a5175..765c003 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -872,7 +872,6 @@ dependencies = [ [[package]] name = "clipboard_macos" version = "0.1.0" -source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "objc", "objc-foundation", @@ -882,7 +881,6 @@ dependencies = [ [[package]] name = "clipboard_wayland" version = "0.2.2" -source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "dnd", "mime", @@ -1040,23 +1038,9 @@ dependencies = [ [[package]] name = "cosmic-client-toolkit" version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=160b086#160b086abe03cd34a8a375d7fbe47b24308d1f38" dependencies = [ "bitflags 2.11.1", - "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", - "libc", - "smithay-client-toolkit", - "wayland-client", - "wayland-protocols", -] - -[[package]] -name = "cosmic-client-toolkit" -version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" -dependencies = [ - "bitflags 2.11.1", - "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-protocols", "libc", "smithay-client-toolkit", "wayland-client", @@ -1136,21 +1120,6 @@ dependencies = [ [[package]] name = "cosmic-protocols" version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=160b086#160b086abe03cd34a8a375d7fbe47b24308d1f38" -dependencies = [ - "bitflags 2.11.1", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-protocols-wlr", - "wayland-scanner", - "wayland-server", -] - -[[package]] -name = "cosmic-protocols" -version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" dependencies = [ "bitflags 2.11.1", "wayland-backend", @@ -1441,7 +1410,6 @@ dependencies = [ [[package]] name = "dnd" version = "0.1.0" -source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "bitflags 2.11.1", "mime", @@ -2584,7 +2552,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytes", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "dnd", "glam", "lilt", @@ -2667,7 +2635,7 @@ name = "iced_runtime" version = "0.14.0" dependencies = [ "bytes", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "dnd", "iced_core", "iced_futures", @@ -2715,7 +2683,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytemuck", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "cryoglyph", "futures", "glam", @@ -2740,7 +2708,7 @@ dependencies = [ name = "iced_widget" version = "0.14.2" dependencies = [ - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "dnd", "iced_renderer", "iced_runtime", @@ -2757,7 +2725,7 @@ dependencies = [ name = "iced_winit" version = "0.14.0" dependencies = [ - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "cursor-icon", "dnd", "iced_debug", @@ -3340,7 +3308,7 @@ dependencies = [ "apply", "ashpd 0.12.3", "auto_enums", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-client-toolkit", "cosmic-config", "cosmic-freedesktop-icons", "cosmic-settings-daemon", @@ -3607,7 +3575,6 @@ dependencies = [ [[package]] name = "mime" version = "0.1.0" -source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "smithay-clipboard", ] @@ -6497,7 +6464,6 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" version = "0.4.1" -source = "git+https://forge.aditua.com/leyoda/window_clipboard.git?branch=yoda-x11-optional#319db02e5219c557c8f03b0e33a8eb4075cabb85" dependencies = [ "clipboard-win", "clipboard_macos", From 076c84012071cdf3532cfd805da445b5e4f21991 Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Mon, 25 May 2026 18:28:56 +0200 Subject: [PATCH 10/19] chore: use local glyphon lockfile --- Cargo.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 765c003..3af376e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1228,7 +1228,6 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "cryoglyph" version = "0.1.0" -source = "git+https://github.com/pop-os/glyphon.git?tag=cosmic-0.14#c49de15bce4d8254ac136d1be9911960cc85ce12" dependencies = [ "cosmic-text", "etagere", From a43ff8463b5ed208486e704ddc7feba98bf469f0 Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Mon, 25 May 2026 19:37:22 +0200 Subject: [PATCH 11/19] chore: resolve local graphics dependencies --- Cargo.lock | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3af376e..dd2ef1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1078,7 +1078,6 @@ dependencies = [ [[package]] name = "cosmic-freedesktop-icons" version = "0.4.0" -source = "git+https://github.com/pop-os/freedesktop-icons#739e266210d471c09af61d529d8f41dccd815b90" dependencies = [ "bstr", "btoi", @@ -1435,7 +1434,6 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dpi" version = "0.1.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" [[package]] name = "either" @@ -5232,7 +5230,6 @@ dependencies = [ [[package]] name = "smithay-clipboard" version = "0.8.0" -source = "git+https://github.com/pop-os/smithay-clipboard?tag=sctk-0.20#859b02c88f45c554049a67c6ddeec1692ce0e20b" dependencies = [ "libc", "raw-window-handle", @@ -5263,7 +5260,6 @@ dependencies = [ [[package]] name = "softbuffer" version = "0.4.1" -source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-4.0#c2b2c19ddb38ff17495643699f97cb1f2064a1be" dependencies = [ "bytemuck", "cfg_aliases", @@ -6888,7 +6884,6 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winit" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "bitflags 2.11.1", "cfg_aliases", @@ -6913,7 +6908,6 @@ dependencies = [ [[package]] name = "winit-android" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "android-activity", "bitflags 2.11.1", @@ -6928,7 +6922,6 @@ dependencies = [ [[package]] name = "winit-appkit" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "bitflags 2.11.1", "block2 0.6.2", @@ -6950,7 +6943,6 @@ dependencies = [ [[package]] name = "winit-common" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "memmap2 0.9.10", "objc2 0.6.4", @@ -6964,7 +6956,6 @@ dependencies = [ [[package]] name = "winit-core" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "bitflags 2.11.1", "cursor-icon", @@ -6978,7 +6969,6 @@ dependencies = [ [[package]] name = "winit-orbital" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "bitflags 2.11.1", "dpi", @@ -6994,7 +6984,6 @@ dependencies = [ [[package]] name = "winit-uikit" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "bitflags 2.11.1", "block2 0.6.2", @@ -7014,7 +7003,6 @@ dependencies = [ [[package]] name = "winit-wayland" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "ahash", "bitflags 2.11.1", @@ -7040,7 +7028,6 @@ dependencies = [ [[package]] name = "winit-web" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "atomic-waker", "bitflags 2.11.1", @@ -7062,7 +7049,6 @@ dependencies = [ [[package]] name = "winit-win32" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "bitflags 2.11.1", "cursor-icon", @@ -7591,3 +7577,7 @@ dependencies = [ "syn", "winnow", ] + +[[patch.unused]] +name = "winit-x11" +version = "0.31.0-beta.2" From 7591a5dbb6254f98944aab479d5b281dde387a75 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 26 May 2026 00:11:34 +0200 Subject: [PATCH 12/19] i18n: translation updates from weblate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aindriú Mac Giolla Eoin Co-authored-by: Hosted Weblate Co-authored-by: Walter William Beckerleg Bruckman Co-authored-by: therealmate Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-player/ga/ Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-player/hu/ Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-player/zh_Hant/ Translation: Pop OS/COSMIC Player --- i18n/ga/cosmic_player.ftl | 3 +++ i18n/hu/cosmic_player.ftl | 2 +- i18n/zh-TW/cosmic_player.ftl | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/i18n/ga/cosmic_player.ftl b/i18n/ga/cosmic_player.ftl index e98e2a9..002c492 100644 --- a/i18n/ga/cosmic_player.ftl +++ b/i18n/ga/cosmic_player.ftl @@ -46,3 +46,6 @@ ab-repeat = Athsheinm A-B ab-repeat-set-a = Athsheinm A-B (A) ab-repeat-set-b = Athsheinm A-B (B) ab-repeat-clear = Glan Athsheinm A-B +xdg-name = Imreoir Meán COSMIC +xdg-comment = Seinnteoir meán don deasc COSMIC +xdg-keywords = Fuaim;Scannán;Scannán;Ceol;Fuaim;Físeán; diff --git a/i18n/hu/cosmic_player.ftl b/i18n/hu/cosmic_player.ftl index 46d70ad..0e916f8 100644 --- a/i18n/hu/cosmic_player.ftl +++ b/i18n/hu/cosmic_player.ftl @@ -1,6 +1,6 @@ album = Album: { $album } audio = Hang -no-video-or-audio-file-open = Nincs videó- vagy hangfájl megnyitva +no-video-or-audio-file-open = Nincs megnyitva videó- vagy hangfájl open-file = Fájl megnyitása open-folder = Mappa megnyitása subtitles = Feliratok diff --git a/i18n/zh-TW/cosmic_player.ftl b/i18n/zh-TW/cosmic_player.ftl index 036ed4f..a9e810b 100644 --- a/i18n/zh-TW/cosmic_player.ftl +++ b/i18n/zh-TW/cosmic_player.ftl @@ -47,5 +47,5 @@ playback = 回放 next-frame = 下一幀 previous-frame = 上一幀 xdg-name = COSMIC 媒體播放器 -xdg-comment = 媒體播放器 用於 COSMIC 桌面 +xdg-comment = COSMIC 桌面媒體播放器 xdg-keywords = 音訊;影片;電影;音樂;聲音;影像; From e56a3a49363f0419f83bde1ca645c4ce9958969b Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 26 May 2026 08:31:21 -0600 Subject: [PATCH 13/19] Epoch 1.0.14 version update Generated by cosmic-epoch scripts/version-update.sh --- Cargo.lock | 97 ++++++++++++++++++++++++------------------------ Cargo.toml | 2 +- debian/changelog | 6 +++ 3 files changed, 56 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd2ef1e..279ab40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,9 +562,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "av-scenechange" @@ -747,15 +747,15 @@ dependencies = [ [[package]] name = "built" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "by_address" @@ -1090,7 +1090,7 @@ dependencies = [ [[package]] name = "cosmic-player" -version = "1.0.13" +version = "1.0.14" dependencies = [ "ashpd 0.12.3", "clap_lex", @@ -1437,9 +1437,9 @@ version = "0.1.2" [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "endi" @@ -2168,7 +2168,7 @@ dependencies = [ "num-integer", "num-rational", "option-operations", - "pastey 0.2.2", + "pastey 0.2.3", "pin-project-lite", "smallvec", "thiserror 2.0.18", @@ -2562,6 +2562,7 @@ dependencies = [ "serde", "smol_str", "thiserror 2.0.18", + "unicode-segmentation", "web-time", "window_clipboard", ] @@ -3066,9 +3067,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jiff" -version = "0.2.24" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00b5dbd620d61dfdcb6007c9c1f6054ebd75319f163d886a9055cec1155073d" +checksum = "392c70591e8749fe235ddaf513e6f58b26bce3dcc16524cecc8936f75afa161e" dependencies = [ "jiff-static", "jiff-tzdb-platform", @@ -3076,14 +3077,14 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "serde_core", - "windows-sys 0.61.2", + "windows-link 0.2.1", ] [[package]] name = "jiff-static" -version = "0.2.24" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e000de030ff8022ea1da3f466fbb0f3a809f5e51ed31f6dd931c35181ad8e6d7" +checksum = "47b605b0c050d845fc355bb11eb3f9a8deddc218ea60c76e61aa1f2adfb2c96a" dependencies = [ "proc-macro2", "quote", @@ -3175,9 +3176,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.98" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" +checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" dependencies = [ "cfg-if", "futures-util", @@ -3242,9 +3243,9 @@ dependencies = [ [[package]] name = "kqueue-sys" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "285efcf12ef41bec907b3000d5ffaeb54191d4d9d83c0d6157e6cbc2db255e64" +checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087" dependencies = [ "bitflags 2.11.1", "libc", @@ -3431,9 +3432,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5" [[package]] name = "loop9" @@ -3758,9 +3759,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-derive" @@ -4077,14 +4078,14 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aca39cf52b03268400c16eeb9b56382ea3c3353409309b63f5c8f0b1faf42754" dependencies = [ - "pastey 0.2.2", + "pastey 0.2.3", ] [[package]] name = "orbclient" -version = "0.3.54" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a570f6bca41d29acb2139229a7c873ec99bc9a313bd10804081d89bfac8ff329" +checksum = "5df339f526ea9a60e371768d50efc2f2508c7203290731565d1f7a6f71d21747" dependencies = [ "libc", "libredox", @@ -4210,9 +4211,9 @@ checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" [[package]] name = "pastey" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a797f0e07bdf071d15742978fc3128ec6c22891c31a3a931513263904c982a" +checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" [[package]] name = "pathdiff" @@ -4321,18 +4322,18 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.12" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf0d9e68100b3a7989b4901972f265cd542e560a3a8a724e1e20322f4d06ce9" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.12" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990e22f43e84855daf260dded30524ef4a9021cc7541c26540500a50b624389" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", @@ -5061,9 +5062,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "indexmap", "itoa", @@ -5997,9 +5998,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.121" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" +checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" dependencies = [ "cfg-if", "once_cell", @@ -6010,9 +6011,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.71" +version = "0.4.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8" +checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f" dependencies = [ "js-sys", "wasm-bindgen", @@ -6020,9 +6021,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.121" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" +checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6030,9 +6031,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.121" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" +checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" dependencies = [ "bumpalo", "proc-macro2", @@ -6043,9 +6044,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.121" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" +checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" dependencies = [ "unicode-ident", ] @@ -6250,9 +6251,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.98" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" +checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436" dependencies = [ "js-sys", "wasm-bindgen", @@ -7063,9 +7064,9 @@ dependencies = [ [[package]] name = "winnow" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 2de6309..67474e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmic-player" -version = "1.0.13" +version = "1.0.14" edition = "2024" rust-version = "1.93" diff --git a/debian/changelog b/debian/changelog index 281fb04..a962725 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cosmic-player (1.0.14) noble; urgency=medium + + * Epoch 1.0.14 version update + + -- Jeremy Soller Tue, 26 May 2026 08:31:17 -0600 + cosmic-player (1.0.13) noble; urgency=medium * Epoch 1.0.13 version update From 3035ae3565872a2912aa53eedf639565c1b2bf7f Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 26 May 2026 13:14:56 -0600 Subject: [PATCH 14/19] Fixes for new libcosmic --- src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 22fd8e7..9883691 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ use cosmic::app::{Core, Settings, Task, context_drawer}; use cosmic::command::set_theme; use cosmic::cosmic_config::{self, CosmicConfigEntry}; use cosmic::iced::event::{self, Event}; +use cosmic::iced::keyboard::key::Physical; use cosmic::iced::keyboard::{Event as KeyEvent, Key, Modifiers}; use cosmic::iced::mouse::{Event as MouseEvent, ScrollDelta}; use cosmic::iced::{ @@ -2061,9 +2062,12 @@ impl Application for App { let mut subscriptions = vec![ event::listen_with(|event, _status, _window_id| match event { - Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => { - Some(Message::Key(modifiers, key)) - } + Event::Keyboard(KeyEvent::KeyPressed { + modifiers, + physical_key, + key, + .. + }) => Some(Message::Key(modifiers, physical_key, key)), Event::Mouse(MouseEvent::CursorMoved { .. }) => Some(Message::ShowControls), Event::Mouse(MouseEvent::WheelScrolled { delta }) => Some(Message::Scrolled(delta)), _ => None, From 3217824a5f55a73c0c49c5dae9f55c1f66b81147 Mon Sep 17 00:00:00 2001 From: jklgrasso Date: Wed, 6 May 2026 12:17:17 -0600 Subject: [PATCH 15/19] Add TESTING.md doc --- TESTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 TESTING.md diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 0000000..42c3b32 --- /dev/null +++ b/TESTING.md @@ -0,0 +1,16 @@ +# Testing + +This document provides a regression testing checklist for COSMIC Files. The checklist provides a starting point for Quality Assurance reviews. + +## Checklist + +### File Operations + + - [ ] Selecting a folder with Open media folder opens the directory in the folder pane + - [ ] Selecting media from the folder pane works + - [ ] Open recent media contains a list of recently opened media + +### Navigation + - [ ] A-B repeat works with video and audio files + - [ ] A-B frame stepping works in video files + - [ ] General media navigation keybinds work and correctly update the timestamp where applicable From f19ac9d797b2f29828eedbbf83ad1121626528ff Mon Sep 17 00:00:00 2001 From: leyoda Date: Mon, 18 May 2026 12:22:47 +0200 Subject: [PATCH 16/19] local: integrate yoda libcosmic and fix thumbnail hang --- Cargo.lock | 97 +++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 279ab40..dd2ef1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,9 +562,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.5.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "av-scenechange" @@ -747,15 +747,15 @@ dependencies = [ [[package]] name = "built" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" +checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" [[package]] name = "bumpalo" -version = "3.20.3" +version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] name = "by_address" @@ -1090,7 +1090,7 @@ dependencies = [ [[package]] name = "cosmic-player" -version = "1.0.14" +version = "1.0.13" dependencies = [ "ashpd 0.12.3", "clap_lex", @@ -1437,9 +1437,9 @@ version = "0.1.2" [[package]] name = "either" -version = "1.16.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "endi" @@ -2168,7 +2168,7 @@ dependencies = [ "num-integer", "num-rational", "option-operations", - "pastey 0.2.3", + "pastey 0.2.2", "pin-project-lite", "smallvec", "thiserror 2.0.18", @@ -2562,7 +2562,6 @@ dependencies = [ "serde", "smol_str", "thiserror 2.0.18", - "unicode-segmentation", "web-time", "window_clipboard", ] @@ -3067,9 +3066,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jiff" -version = "0.2.27" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392c70591e8749fe235ddaf513e6f58b26bce3dcc16524cecc8936f75afa161e" +checksum = "f00b5dbd620d61dfdcb6007c9c1f6054ebd75319f163d886a9055cec1155073d" dependencies = [ "jiff-static", "jiff-tzdb-platform", @@ -3077,14 +3076,14 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "serde_core", - "windows-link 0.2.1", + "windows-sys 0.61.2", ] [[package]] name = "jiff-static" -version = "0.2.27" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b605b0c050d845fc355bb11eb3f9a8deddc218ea60c76e61aa1f2adfb2c96a" +checksum = "e000de030ff8022ea1da3f466fbb0f3a809f5e51ed31f6dd931c35181ad8e6d7" dependencies = [ "proc-macro2", "quote", @@ -3176,9 +3175,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.99" +version = "0.3.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" +checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" dependencies = [ "cfg-if", "futures-util", @@ -3243,9 +3242,9 @@ dependencies = [ [[package]] name = "kqueue-sys" -version = "1.1.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087" +checksum = "285efcf12ef41bec907b3000d5ffaeb54191d4d9d83c0d6157e6cbc2db255e64" dependencies = [ "bitflags 2.11.1", "libc", @@ -3432,9 +3431,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.30" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "loop9" @@ -3759,9 +3758,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" [[package]] name = "num-derive" @@ -4078,14 +4077,14 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aca39cf52b03268400c16eeb9b56382ea3c3353409309b63f5c8f0b1faf42754" dependencies = [ - "pastey 0.2.3", + "pastey 0.2.2", ] [[package]] name = "orbclient" -version = "0.3.55" +version = "0.3.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5df339f526ea9a60e371768d50efc2f2508c7203290731565d1f7a6f71d21747" +checksum = "a570f6bca41d29acb2139229a7c873ec99bc9a313bd10804081d89bfac8ff329" dependencies = [ "libc", "libredox", @@ -4211,9 +4210,9 @@ checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" [[package]] name = "pastey" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" +checksum = "c5a797f0e07bdf071d15742978fc3128ec6c22891c31a3a931513263904c982a" [[package]] name = "pathdiff" @@ -4322,18 +4321,18 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.13" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" +checksum = "cbf0d9e68100b3a7989b4901972f265cd542e560a3a8a724e1e20322f4d06ce9" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.13" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" +checksum = "a990e22f43e84855daf260dded30524ef4a9021cc7541c26540500a50b624389" dependencies = [ "proc-macro2", "quote", @@ -5062,9 +5061,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.150" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "indexmap", "itoa", @@ -5998,9 +5997,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.122" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" +checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" dependencies = [ "cfg-if", "once_cell", @@ -6011,9 +6010,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.72" +version = "0.4.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f" +checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8" dependencies = [ "js-sys", "wasm-bindgen", @@ -6021,9 +6020,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.122" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6031,9 +6030,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.122" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" dependencies = [ "bumpalo", "proc-macro2", @@ -6044,9 +6043,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.122" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" dependencies = [ "unicode-ident", ] @@ -6251,9 +6250,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.99" +version = "0.3.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436" +checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" dependencies = [ "js-sys", "wasm-bindgen", @@ -7064,9 +7063,9 @@ dependencies = [ [[package]] name = "winnow" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" +checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" dependencies = [ "memchr", ] From 9d84952c817576dc9f0bb129bb8fbb96a91422fd Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Mon, 25 May 2026 14:27:37 +0200 Subject: [PATCH 17/19] fix(keybinds): adapt key_bind.matches to new 3-arg signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream libcosmic added an Option<&Physical> third parameter to KeyBind::matches for physical-key matching. We pass None at every call site since these paths only have the logical key available. Also refresh Cargo.lock to satisfy the libcosmic-yoda squash rebase absorbed on 2026-05-25. Leyoda 2026 – GPLv3 --- Cargo.lock | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd2ef1e..9eb9c44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1040,7 +1040,20 @@ name = "cosmic-client-toolkit" version = "0.2.0" dependencies = [ "bitflags 2.11.1", - "cosmic-protocols", + "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "libc", + "smithay-client-toolkit", + "wayland-client", + "wayland-protocols", +] + +[[package]] +name = "cosmic-client-toolkit" +version = "0.2.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" +dependencies = [ + "bitflags 2.11.1", + "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", "libc", "smithay-client-toolkit", "wayland-client", @@ -1129,6 +1142,20 @@ dependencies = [ "wayland-server", ] +[[package]] +name = "cosmic-protocols" +version = "0.2.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" +dependencies = [ + "bitflags 2.11.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "wayland-server", +] + [[package]] name = "cosmic-settings-daemon" version = "0.1.1-yoda.1" @@ -2549,7 +2576,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytes", - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "dnd", "glam", "lilt", @@ -2632,7 +2659,7 @@ name = "iced_runtime" version = "0.14.0" dependencies = [ "bytes", - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "dnd", "iced_core", "iced_futures", @@ -2680,7 +2707,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytemuck", - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "cryoglyph", "futures", "glam", @@ -2705,7 +2732,7 @@ dependencies = [ name = "iced_widget" version = "0.14.2" dependencies = [ - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "dnd", "iced_renderer", "iced_runtime", @@ -2722,7 +2749,7 @@ dependencies = [ name = "iced_winit" version = "0.14.0" dependencies = [ - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", "cursor-icon", "dnd", "iced_debug", @@ -3305,7 +3332,7 @@ dependencies = [ "apply", "ashpd 0.12.3", "auto_enums", - "cosmic-client-toolkit", + "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", "cosmic-config", "cosmic-freedesktop-icons", "cosmic-settings-daemon", From d3e1c26a487a386da7061694cb556ec8a407f048 Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Wed, 27 May 2026 08:49:08 +0200 Subject: [PATCH 18/19] Refresh Cargo lockfile after upstream rebase --- Cargo.lock | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9eb9c44..91230c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1103,7 +1103,7 @@ dependencies = [ [[package]] name = "cosmic-player" -version = "1.0.13" +version = "1.0.14" dependencies = [ "ashpd 0.12.3", "clap_lex", @@ -4771,6 +4771,16 @@ dependencies = [ "font-types", ] +[[package]] +name = "redox_event" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea3e412d205440c7b0218af26247226f979ed1201674cda7a33cc70609084b5" +dependencies = [ + "bitflags 2.11.1", + "libredox", +] + [[package]] name = "redox_syscall" version = "0.5.18" @@ -7002,7 +7012,7 @@ dependencies = [ "libredox", "orbclient", "raw-window-handle", - "redox_syscall 0.7.5", + "redox_event", "smol_str", "tracing", "winit-core", From d13c21206ebd1848eee2401e23fd4c1c841c5c4a Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Fri, 3 Jul 2026 14:01:56 +0200 Subject: [PATCH 19/19] fix: port vendored iced_video_player to wgpu 28 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Leyoda 2026 – GPLv3 --- Cargo.lock | 272 ++++++++++++----------- src/main.rs | 4 +- vendor/iced_video_player/src/pipeline.rs | 7 +- 3 files changed, 147 insertions(+), 136 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 91230c6..e960624 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,6 +153,12 @@ dependencies = [ "equator", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "almost" version = "0.2.0" @@ -1040,20 +1046,7 @@ name = "cosmic-client-toolkit" version = "0.2.0" dependencies = [ "bitflags 2.11.1", - "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", - "libc", - "smithay-client-toolkit", - "wayland-client", - "wayland-protocols", -] - -[[package]] -name = "cosmic-client-toolkit" -version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" -dependencies = [ - "bitflags 2.11.1", - "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-protocols", "libc", "smithay-client-toolkit", "wayland-client", @@ -1142,20 +1135,6 @@ dependencies = [ "wayland-server", ] -[[package]] -name = "cosmic-protocols" -version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" -dependencies = [ - "bitflags 2.11.1", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-protocols-wlr", - "wayland-scanner", - "wayland-server", -] - [[package]] name = "cosmic-settings-daemon" version = "0.1.1-yoda.1" @@ -1195,6 +1174,7 @@ dependencies = [ "cosmic-config", "csscolorparser", "dirs", + "hex_color", "palette", "ron", "serde", @@ -2119,35 +2099,18 @@ dependencies = [ "system-deps", ] -[[package]] -name = "gpu-alloc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" -dependencies = [ - "bitflags 2.11.1", - "gpu-alloc-types", -] - -[[package]] -name = "gpu-alloc-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" -dependencies = [ - "bitflags 2.11.1", -] - [[package]] name = "gpu-allocator" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795" dependencies = [ + "ash", + "hashbrown 0.16.1", "log", "presser", - "thiserror 1.0.69", - "windows 0.58.0", + "thiserror 2.0.18", + "windows 0.61.3", ] [[package]] @@ -2433,6 +2396,8 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ + "allocator-api2", + "equivalent", "foldhash 0.2.0", ] @@ -2460,6 +2425,17 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex_color" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37f101bf4c633f7ca2e4b5e136050314503dd198e78e325ea602c327c484ef0" +dependencies = [ + "arrayvec", + "rand 0.8.6", + "serde", +] + [[package]] name = "hexf-parse" version = "0.2.1" @@ -2576,7 +2552,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytes", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "dnd", "glam", "lilt", @@ -2589,6 +2565,7 @@ dependencies = [ "serde", "smol_str", "thiserror 2.0.18", + "unicode-segmentation", "web-time", "window_clipboard", ] @@ -2659,7 +2636,7 @@ name = "iced_runtime" version = "0.14.0" dependencies = [ "bytes", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "dnd", "iced_core", "iced_futures", @@ -2707,7 +2684,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytemuck", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "cryoglyph", "futures", "glam", @@ -2732,7 +2709,7 @@ dependencies = [ name = "iced_widget" version = "0.14.2" dependencies = [ - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "dnd", "iced_renderer", "iced_runtime", @@ -2749,7 +2726,7 @@ dependencies = [ name = "iced_winit" version = "0.14.0" dependencies = [ - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "cursor-icon", "dnd", "iced_debug", @@ -3332,13 +3309,14 @@ dependencies = [ "apply", "ashpd 0.12.3", "auto_enums", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-client-toolkit", "cosmic-config", "cosmic-freedesktop-icons", "cosmic-settings-daemon", "cosmic-theme", "css-color", "derive_setters", + "enumflags2", "float-cmp 0.10.0", "futures", "i18n-embed", @@ -3583,9 +3561,9 @@ dependencies = [ [[package]] name = "metal" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c15a6f673ff72ddcc22394663290f870fb224c1bfce55734a75c414150e605" +checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15" dependencies = [ "bitflags 2.11.1", "block", @@ -3662,9 +3640,9 @@ checksum = "13d2233c9842d08cfe13f9eac96e207ca6a2ea10b80259ebe8ad0268be27d2af" [[package]] name = "naga" -version = "27.0.3" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "066cf25f0e8b11ee0df221219010f213ad429855f57c494f995590c861a9a7d8" +checksum = "618f667225063219ddfc61251087db8a9aec3c3f0950c916b614e403486f1135" dependencies = [ "arrayvec", "bit-set", @@ -4634,6 +4612,8 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ + "libc", + "rand_chacha 0.3.1", "rand_core 0.6.4", ] @@ -4643,10 +4623,20 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ - "rand_chacha", + "rand_chacha 0.9.0", "rand_core 0.9.5", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + [[package]] name = "rand_chacha" version = "0.9.0" @@ -4662,6 +4652,9 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] [[package]] name = "rand_core" @@ -4712,7 +4705,7 @@ dependencies = [ "paste", "profiling", "rand 0.9.4", - "rand_chacha", + "rand_chacha 0.9.0", "simd_helpers", "thiserror 2.0.18", "v_frame", @@ -6313,12 +6306,13 @@ checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" [[package]] name = "wgpu" -version = "27.0.1" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe68bac7cde125de7a731c3400723cadaaf1703795ad3f4805f187459cd7a77" +checksum = "f9cb534d5ffd109c7d1135f34cdae29e60eab94855a625dcfe1705f8bc7ad79f" dependencies = [ "arrayvec", "bitflags 2.11.1", + "bytemuck", "cfg-if", "cfg_aliases", "document-features", @@ -6342,9 +6336,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "27.0.3" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27a75de515543b1897b26119f93731b385a19aea165a1ec5f0e3acecc229cae7" +checksum = "d23f4642f53f666adcfd2d3218ab174d1e6681101aef18696b90cbe64d1c10f9" dependencies = [ "arrayvec", "bit-set", @@ -6374,36 +6368,36 @@ dependencies = [ [[package]] name = "wgpu-core-deps-apple" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0772ae958e9be0c729561d5e3fd9a19679bcdfb945b8b1a1969d9bfe8056d233" +checksum = "87b7b696b918f337c486bf93142454080a32a37832ba8a31e4f48221890047da" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-core-deps-emscripten" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06ac3444a95b0813ecfd81ddb2774b66220b264b3e2031152a4a29fda4da6b5" +checksum = "34b251c331f84feac147de3c4aa3aa45112622a95dd7ee1b74384fa0458dbd79" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-core-deps-windows-linux-android" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71197027d61a71748e4120f05a9242b2ad142e3c01f8c1b47707945a879a03c3" +checksum = "68ca976e72b2c9964eb243e281f6ce7f14a514e409920920dcda12ae40febaae" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-hal" -version = "27.0.4" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b21cb61c57ee198bc4aff71aeadff4cbb80b927beb912506af9c780d64313ce" +checksum = "44d6cb474beb218824dcc9e1ce679d973f719262789bfb27407da560cac20eeb" dependencies = [ "android_system_properties", "arrayvec", @@ -6417,7 +6411,6 @@ dependencies = [ "core-graphics-types 0.2.0", "glow", "glutin_wgl_sys", - "gpu-alloc", "gpu-allocator", "gpu-descriptor", "hashbrown 0.16.1", @@ -6444,21 +6437,20 @@ dependencies = [ "wasm-bindgen", "web-sys", "wgpu-types", - "windows 0.58.0", - "windows-core 0.58.0", + "windows 0.62.2", + "windows-core 0.62.2", ] [[package]] name = "wgpu-types" -version = "27.0.1" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afdcf84c395990db737f2dd91628706cb31e86d72e53482320d368e52b5da5eb" +checksum = "e18308757e594ed2cd27dddbb16a139c42a683819d32a2e0b1b0167552f5840c" dependencies = [ "bitflags 2.11.1", "bytemuck", "js-sys", "log", - "thiserror 2.0.18", "web-sys", ] @@ -6506,27 +6498,29 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "windows" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" -dependencies = [ - "windows-core 0.58.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.61.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ - "windows-collections", + "windows-collections 0.2.0", "windows-core 0.61.2", - "windows-future", + "windows-future 0.2.1", "windows-link 0.1.3", - "windows-numerics", + "windows-numerics 0.2.0", +] + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections 0.3.2", + "windows-core 0.62.2", + "windows-future 0.3.2", + "windows-numerics 0.3.1", ] [[package]] @@ -6539,16 +6533,12 @@ dependencies = [ ] [[package]] -name = "windows-core" -version = "0.58.0" +name = "windows-collections" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", + "windows-core 0.62.2", ] [[package]] @@ -6557,13 +6547,26 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.60.2", - "windows-interface 0.59.3", + "windows-implement", + "windows-interface", "windows-link 0.1.3", "windows-result 0.3.4", "windows-strings 0.4.2", ] +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + [[package]] name = "windows-future" version = "0.2.1" @@ -6572,18 +6575,18 @@ checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ "windows-core 0.61.2", "windows-link 0.1.3", - "windows-threading", + "windows-threading 0.1.0", ] [[package]] -name = "windows-implement" -version = "0.58.0" +name = "windows-future" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" dependencies = [ - "proc-macro2", - "quote", - "syn", + "windows-core 0.62.2", + "windows-link 0.2.1", + "windows-threading 0.2.1", ] [[package]] @@ -6597,17 +6600,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-interface" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-interface" version = "0.59.3" @@ -6642,12 +6634,13 @@ dependencies = [ ] [[package]] -name = "windows-result" -version = "0.2.0" +name = "windows-numerics" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" dependencies = [ - "windows-targets 0.52.6", + "windows-core 0.62.2", + "windows-link 0.2.1", ] [[package]] @@ -6660,13 +6653,12 @@ dependencies = [ ] [[package]] -name = "windows-strings" -version = "0.1.0" +name = "windows-result" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", + "windows-link 0.2.1", ] [[package]] @@ -6678,6 +6670,15 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -6780,6 +6781,15 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link 0.2.1", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" diff --git a/src/main.rs b/src/main.rs index 9883691..c824e64 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1871,7 +1871,7 @@ impl Application for App { //TODO: move style to libcosmic .class(theme::Container::custom(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background.component; + let component = &cosmic.background(false).component; widget::container::Style { icon_color: Some(component.on.into()), text_color: Some(component.on.into()), @@ -2067,7 +2067,7 @@ impl Application for App { physical_key, key, .. - }) => Some(Message::Key(modifiers, physical_key, key)), + }) => Some(Message::Key(modifiers, key)), Event::Mouse(MouseEvent::CursorMoved { .. }) => Some(Message::ShowControls), Event::Mouse(MouseEvent::WheelScrolled { delta }) => Some(Message::Scrolled(delta)), _ => None, diff --git a/vendor/iced_video_player/src/pipeline.rs b/vendor/iced_video_player/src/pipeline.rs index 792c1ee..b703312 100644 --- a/vendor/iced_video_player/src/pipeline.rs +++ b/vendor/iced_video_player/src/pipeline.rs @@ -83,7 +83,7 @@ impl VideoPipeline { let layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("iced_video_player pipeline layout"), bind_group_layouts: &[&bg0_layout], - push_constant_ranges: &[], + immediate_size: 0, }); let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { @@ -112,7 +112,7 @@ impl VideoPipeline { })], compilation_options: wgpu::PipelineCompilationOptions::default(), }), - multiview: None, + multiview_mask: None, cache: None, }); @@ -123,7 +123,7 @@ impl VideoPipeline { address_mode_w: wgpu::AddressMode::ClampToEdge, mag_filter: wgpu::FilterMode::Linear, min_filter: wgpu::FilterMode::Linear, - mipmap_filter: wgpu::FilterMode::Nearest, + mipmap_filter: wgpu::MipmapFilterMode::Nearest, lod_min_clamp: 0.0, lod_max_clamp: 1.0, compare: None, @@ -355,6 +355,7 @@ impl VideoPipeline { depth_stencil_attachment: None, timestamp_writes: None, occlusion_query_set: None, + multiview_mask: None, }); pass.set_pipeline(&self.pipeline);