diff --git a/.gitignore b/.gitignore index 10de4bd..c8a2095 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,9 @@ /debian/files /target/ /vendor/ +!/vendor/ +/vendor/* +!/vendor/iced_video_player/ +!/vendor/iced_video_player/** /vendor.tar +.idea/ diff --git a/Cargo.lock b/Cargo.lock index 82cd5ad..8383f7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -172,7 +172,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f2a1bb052857d5dd49572219344a7332b31b76405648eabac5bc68978251bcd" dependencies = [ "android-properties", - "bitflags 2.11.1", + "bitflags 2.13.0", "cc", "jni", "libc", @@ -251,9 +251,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "apply" @@ -278,9 +278,9 @@ checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" [[package]] name = "arc-swap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207" +checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b" dependencies = [ "rustversion", ] @@ -304,15 +304,9 @@ checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.7" 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" +checksum = "f02882884d3e1bc524fb12c79f107f6ad0e1cfd498c536ffb494301740995dfe" [[package]] name = "as-slice" @@ -562,9 +556,9 @@ dependencies = [ [[package]] name = "auto_enums" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65398a2893f41bce5c9259f6e1a4f03fbae40637c1bdc755b4f387f48c613b03" +checksum = "2e4487600931c9a89f8db7ffbdf3fbdd45bb7bd85e26861f659a463cd0dff966" dependencies = [ "derive_utils", "proc-macro2", @@ -574,9 +568,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" @@ -665,9 +659,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" dependencies = [ "serde_core", ] @@ -729,9 +723,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" +checksum = "2f3f6da4992df95bbcd9af42a6c7dcb994498fc9048230405f3b36ff7cd3f145" dependencies = [ "bytes", "cfg_aliases", @@ -739,13 +733,13 @@ dependencies = [ [[package]] name = "bstr" -version = "1.12.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +checksum = "5cee35f73844aa3014bb606320a6c1f010249dbdf43342fe54b5a4f6a8ed4b79" dependencies = [ "memchr", "regex-automata", - "serde", + "serde_core", ] [[package]] @@ -759,15 +753,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" @@ -803,9 +797,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" [[package]] name = "calloop" @@ -813,7 +807,7 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dbf9978365bac10f54d1d4b04f7ce4427e51f71d61f2fe15e3fed5166474df7" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "polling", "rustix 1.1.4", "slab", @@ -834,9 +828,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.62" +version = "1.2.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +checksum = "e228eec9be7c17ccb640b59b36a5cd805ea2a564a4c5e162c2f659fea30d3b96" dependencies = [ "find-msvc-tools", "jobserver", @@ -846,9 +840,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6b04e07d8080154ed4ac03546d9a2b303cc2fe1901ba0b35b301516e289368" +checksum = "fb693542bcafa528e198be0ebd9d3632ca5b7c93dbe7237460e199910835997c" dependencies = [ "smallvec", "target-lexicon", @@ -884,7 +878,6 @@ dependencies = [ [[package]] name = "clipboard_macos" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "objc", "objc-foundation", @@ -894,22 +887,12 @@ dependencies = [ [[package]] name = "clipboard_wayland" version = "0.2.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" 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" @@ -984,9 +967,9 @@ dependencies = [ [[package]] name = "configparser" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57e3272f0190c3f1584272d613719ba5fc7df7f4942fe542e63d949cf3a649b" +checksum = "b46dec724fd22199ebde05033a0cbae453bc3b1ecff11eb6a6bb3eec4b90c6a4" [[package]] name = "core-foundation" @@ -1044,7 +1027,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "core-foundation 0.10.1", "libc", ] @@ -1061,9 +1044,8 @@ 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", + "bitflags 2.13.0", "cosmic-protocols", "libc", "smithay-client-toolkit", @@ -1074,7 +1056,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 +1076,6 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "quote", "syn", @@ -1104,12 +1084,11 @@ dependencies = [ [[package]] name = "cosmic-freedesktop-icons" version = "0.4.0" -source = "git+https://github.com/pop-os/freedesktop-icons#9c562fe3ecf03241a46a60c0078cd6ea10bd75ce" dependencies = [ "bstr", "btoi", "memchr", - "memmap2 0.9.10", + "memmap2 0.9.11", "thiserror 2.0.18", "tracing", "xdg", @@ -1117,7 +1096,7 @@ dependencies = [ [[package]] name = "cosmic-player" -version = "1.0.13" +version = "1.2.0" dependencies = [ "ashpd 0.12.3", "clap_lex", @@ -1130,9 +1109,10 @@ dependencies = [ "icu_collator", "icu_locale", "image", - "libcosmic", + "libcosmic-yoda", "log", "mpris-server", + "open", "rust-embed", "serde", "tempfile", @@ -1145,9 +1125,8 @@ 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", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -1158,8 +1137,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", ] @@ -1167,10 +1145,8 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be17b688510d934ce13f48a2beba700e11583e281e0fda99c22bb256a14eda73" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "fontdb", "harfrust", "linebender_resource_handle", @@ -1178,7 +1154,7 @@ dependencies = [ "rangemap", "rustc-hash 2.1.2", "self_cell", - "skrifa", + "skrifa 0.40.0", "smol_str", "swash", "sys-locale", @@ -1186,18 +1162,19 @@ dependencies = [ "unicode-linebreak", "unicode-script", "unicode-segmentation", + "unicode-width", ] [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ "almost", "configparser", "cosmic-config", "csscolorparser", "dirs", + "hex_color", "palette", "ron", "serde", @@ -1257,7 +1234,6 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "cryoglyph" version = "0.1.0" -source = "git+https://github.com/iced-rs/cryoglyph.git?rev=e429a025df36ab8145708acb309080ae3deec17a#e429a025df36ab8145708acb309080ae3deec17a" dependencies = [ "cosmic-text", "etagere", @@ -1294,15 +1270,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" @@ -1350,14 +1317,43 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" +[[package]] +name = "defmt" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e524506490a1953d237cb87b1cfc1e46f88c18f10a22dfe0f507dc6bfc7f7f" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0a27770e9c8f719a79d8b638281f4d828f77d8fd61e0bd94451b9b85e576a0b" +dependencies = [ + "defmt-parser", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "defmt-parser" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +dependencies = [ + "thiserror 2.0.18", +] + [[package]] name = "deranged" version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "powerfmt", -] [[package]] name = "derive_setters" @@ -1419,7 +1415,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "libc", "objc2 0.6.4", @@ -1427,9 +1423,9 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", @@ -1448,9 +1444,8 @@ dependencies = [ [[package]] name = "dnd" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "mime", "raw-window-handle", "smithay-client-toolkit", @@ -1475,58 +1470,12 @@ 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 = "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" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "endi" @@ -1557,9 +1506,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" +checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217" dependencies = [ "log", "regex", @@ -1567,9 +1516,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.10" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" +checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6" dependencies = [ "anstream", "anstyle", @@ -1837,7 +1786,7 @@ checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" dependencies = [ "fontconfig-parser", "log", - "memmap2 0.9.10", + "memmap2 0.9.11", "slotmap", "tinyvec", "ttf-parser", @@ -2018,16 +1967,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" @@ -2053,15 +1992,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", - "wasip2", - "wasip3", ] [[package]] @@ -2086,9 +2023,9 @@ dependencies = [ [[package]] name = "gio-sys" -version = "0.22.0" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64729ba2772c080448f9f966dba8f4456beeb100d8c28a865ef8a0f2ef4987e1" +checksum = "353fdc7da7cd16da916104b1e0e4e7de380ec9c8aaa20d4d742d66310ab4b0d5" dependencies = [ "glib-sys", "gobject-sys", @@ -2116,11 +2053,11 @@ checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" [[package]] name = "glib" -version = "0.22.7" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c207e04e51605dcf7b2924c41591b3a10e1438eaac5bcf448fb91f325381104a" +checksum = "ddbcf514bd1881fc1b960e4e52b4e82873f4da3bceddbd58d42827b508888100" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "futures-channel", "futures-core", "futures-executor", @@ -2149,9 +2086,9 @@ dependencies = [ [[package]] name = "glib-sys" -version = "0.22.6" +version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7fbac234ed5bc2a28359b7bde8e1b9cdf1441cc2d7f068e4824672d7db9445" +checksum = "030967459f9f676851872c6304adea7825c6d462ec9b72554c733cf0c5952233" dependencies = [ "libc", "system-deps", @@ -2209,7 +2146,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "gpu-descriptor-types", "hashbrown 0.15.5", ] @@ -2220,7 +2157,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -2231,9 +2168,9 @@ checksum = "b40ca9252762c466af32d0b1002e91e4e1bc5398f77455e55474deb466355ff5" [[package]] name = "gstreamer" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28ca0c594cac4e86f5444aaa767c7bb810340c0710667a6467d3ead248e35e84" +checksum = "ab4527e1b9bae8d29ce137bde5b8eec8ae8f78f13ad00fc6e70cbe227d6ad027" dependencies = [ "cfg-if", "futures-channel", @@ -2241,14 +2178,14 @@ dependencies = [ "futures-util", "glib", "gstreamer-sys", - "itertools", + "itertools 0.15.0", "kstring", "libc", "muldiv", "num-integer", "num-rational", "option-operations", - "pastey 0.2.2", + "pastey 0.2.3", "pin-project-lite", "smallvec", "thiserror 2.0.18", @@ -2284,9 +2221,9 @@ dependencies = [ [[package]] name = "gstreamer-audio" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cdd06eb9c901b05902c55d106034319e2d730179744867564198d17c8486ed2" +checksum = "f97532c3e21287a6e94563a328cce89367324acf8a4489291b40ede2e39163a0" dependencies = [ "cfg-if", "glib", @@ -2299,9 +2236,9 @@ dependencies = [ [[package]] name = "gstreamer-audio-sys" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d25892ad6fdd898936ca338d46d8632b298470ecc3eb82098e330ed2cdaec5d" +checksum = "2abfb81a073c5c8fb115a3639f47b6430f669ee9fa29123bb0116c9ef59d7d16" dependencies = [ "glib-sys", "gobject-sys", @@ -2313,9 +2250,9 @@ dependencies = [ [[package]] name = "gstreamer-base" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c279df2918be97fb9570e589a32ade33598f643b0c4f0c92c17f06be6940574e" +checksum = "c91c94a4d3047d05dd6e1f6d91c74f61f56384c7ea1c9d0c1051572eeeb0138d" dependencies = [ "atomic_refcell", "cfg-if", @@ -2327,9 +2264,9 @@ dependencies = [ [[package]] name = "gstreamer-base-sys" -version = "0.25.0" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6569606feeb89cfcf95a6476a64a0f0aec83fadcef0e91c24e576f7851ceac3a" +checksum = "709fbbc623dc066908ba10c43d629c21096508dea04796592a206c4edd864e37" dependencies = [ "glib-sys", "gobject-sys", @@ -2408,9 +2345,9 @@ dependencies = [ [[package]] name = "gstreamer-video" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf728cb21499561ea0d6ce584e550bf2b98b279cc7741067ee42f41f98b486e" +checksum = "7907cb8a73edc98cf279e5de7370bb2c245b7bedf623ba8c7e59648cd4739133" dependencies = [ "cfg-if", "futures-channel", @@ -2424,9 +2361,9 @@ dependencies = [ [[package]] name = "gstreamer-video-sys" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c2c997a90a5806a8d7fcb416755e3047d6bab8f580d2ededc9ab7ad553caf" +checksum = "94f6753d53c9a5e274f33441bee2c7dabef82edefb39605b75c834d24af89e7e" dependencies = [ "glib-sys", "gobject-sys", @@ -2464,10 +2401,10 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9da2e5ae821f6e96664977bf974d6d6a2d6682f9ccee23e62ec1d134246845f9" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "core_maths", - "read-fonts", + "read-fonts 0.37.0", "smallvec", ] @@ -2515,6 +2452,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" @@ -2600,7 +2548,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 +2568,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,9 +2576,8 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytes", "cosmic-client-toolkit", "dnd", @@ -2647,6 +2592,7 @@ dependencies = [ "serde", "smol_str", "thiserror 2.0.18", + "unicode-segmentation", "web-time", "window_clipboard", ] @@ -2654,7 +2600,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 +2609,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,9 +2622,8 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#4fab6c777dbd1a023440f08fb2b729c86492366c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "cosmic-text", "half", @@ -2699,7 +2642,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 +2650,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 +2661,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 +2675,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 +2691,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 +2699,7 @@ dependencies = [ "gstreamer-pbutils", "html-escape", "iced_wgpu", - "libcosmic", + "libcosmic-yoda", "log", "thiserror 2.0.18", "url", @@ -2770,10 +2708,8 @@ 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", + "bitflags 2.13.0", "bytemuck", "cosmic-client-toolkit", "cryoglyph", @@ -2789,19 +2725,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 +2752,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", @@ -2850,9 +2782,9 @@ dependencies = [ [[package]] name = "icu_collator" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b521b92a2666061ddda902769d8a4cf730b5c9529a845cc1b69770b12a6c9a71" +checksum = "8bbdf98e5e0aa827770acee171ebb568aaab975a36b56afdb5fd0e2f525750bb" dependencies = [ "icu_collator_data", "icu_collections", @@ -2982,12 +2914,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - [[package]] name = "ident_case" version = "1.0.1" @@ -3057,9 +2983,9 @@ checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" [[package]] name = "imgref" -version = "1.12.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40fac9d56ed6437b198fddba683305e8e2d651aa42647f00f5ae542e7f5c94a2" +checksum = "89194689a993ab15268672e99e7b0e19da2da3268ac682e8f02d29d4d1434cd7" [[package]] name = "indexmap" @@ -3069,17 +2995,15 @@ checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", "hashbrown 0.16.1", - "serde", - "serde_core", ] [[package]] name = "inotify" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5b3eaf1a28b758ac0faa5a4254e8ab2705605496f1b1f3fbbc3988ad73d199" +checksum = "533e68a5842e734946fe159fb03fc9bbbb254f590dd0d8ad321ae5ff7beca2c1" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "inotify-sys", "libc", ] @@ -3123,6 +3047,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" @@ -3138,6 +3081,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.18" @@ -3146,24 +3098,25 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jiff" -version = "0.2.24" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00b5dbd620d61dfdcb6007c9c1f6054ebd75319f163d886a9055cec1155073d" +checksum = "ccfe6121cbe750cf81efa362d85c0bde7ea298ec43092d3a193baca59cdbd634" dependencies = [ + "defmt", "jiff-static", "jiff-tzdb-platform", "log", "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.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e000de030ff8022ea1da3f466fbb0f3a809f5e51ed31f6dd931c35181ad8e6d7" +checksum = "e165e897f662d428f3cd3828a919dbe067c2d42bb1031eede74ef9d27ecdedd2" dependencies = [ "proc-macro2", "quote", @@ -3255,13 +3208,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.98" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" dependencies = [ "cfg-if", "futures-util", - "once_cell", "wasm-bindgen", ] @@ -3280,7 +3232,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "serde", ] @@ -3312,9 +3264,9 @@ dependencies = [ [[package]] name = "kqueue" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" +checksum = "273c0752728918e0ac4976f2b275b6fefb9ecd400585dec929419f3844cd87b5" dependencies = [ "kqueue-sys", "libc", @@ -3322,11 +3274,11 @@ 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", + "bitflags 2.13.0", "libc", ] @@ -3360,12 +3312,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - [[package]] name = "lebe" version = "0.5.3" @@ -3379,9 +3325,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", @@ -3393,6 +3338,7 @@ dependencies = [ "cosmic-theme", "css-color", "derive_setters", + "enumflags2", "float-cmp 0.10.0", "futures", "i18n-embed", @@ -3426,9 +3372,9 @@ dependencies = [ [[package]] name = "libfuzzer-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12a681b7dd8ce12bff52488013ba614b869148d54dd79836ab85aafdd53f08d" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" dependencies = [ "arbitrary", "cc", @@ -3452,14 +3398,14 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "libc", "plain", - "redox_syscall 0.7.5", + "redox_syscall 0.8.1", ] [[package]] @@ -3483,12 +3429,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" @@ -3518,9 +3458,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "loop9" @@ -3610,9 +3550,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" [[package]] name = "memmap2" @@ -3625,9 +3565,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" +checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0" dependencies = [ "libc", ] @@ -3647,7 +3587,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block", "core-graphics-types 0.2.0", "foreign-types", @@ -3659,7 +3599,6 @@ dependencies = [ [[package]] name = "mime" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "smithay-clipboard", ] @@ -3676,9 +3615,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" dependencies = [ "libc", "log", @@ -3729,7 +3668,7 @@ checksum = "618f667225063219ddfc61251087db8a9aec3c3f0950c916b614e403486f1135" dependencies = [ "arrayvec", "bit-set", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "cfg_aliases", "codespan-reporting", @@ -3753,7 +3692,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "jni-sys 0.3.1", "log", "ndk-sys", @@ -3813,7 +3752,7 @@ version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "fsevent-sys", "inotify", "kqueue", @@ -3831,7 +3770,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -3846,9 +3785,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" @@ -3973,7 +3912,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -3989,7 +3928,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "objc2 0.6.4", "objc2-core-foundation", @@ -4002,7 +3941,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -4014,7 +3953,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "dispatch2", "objc2 0.6.4", @@ -4026,7 +3965,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "libc", "objc2-core-foundation", ] @@ -4049,7 +3988,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "objc2-core-foundation", "objc2-core-graphics", ] @@ -4066,7 +4005,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -4078,7 +4017,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "objc2 0.6.4", "objc2-core-foundation", @@ -4090,7 +4029,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -4102,7 +4041,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -4115,7 +4054,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "objc2 0.6.4", "objc2-core-foundation", "objc2-foundation 0.3.2", @@ -4142,6 +4081,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" @@ -4154,14 +4104,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", @@ -4287,9 +4237,15 @@ 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" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "percent-encoding" @@ -4392,18 +4348,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", @@ -4464,7 +4420,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "crc32fast", "fdeflate", "flate2", @@ -4538,16 +4494,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - [[package]] name = "proc-macro-crate" version = "3.5.0" @@ -4653,9 +4599,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.45" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" dependencies = [ "proc-macro2", ] @@ -4678,6 +4624,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", ] @@ -4687,10 +4635,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" @@ -4706,6 +4664,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" @@ -4744,7 +4705,7 @@ dependencies = [ "built", "cfg-if", "interpolate_name", - "itertools", + "itertools 0.14.0", "libc", "libfuzzer-sys", "log", @@ -4756,7 +4717,7 @@ dependencies = [ "paste", "profiling", "rand 0.9.4", - "rand_chacha", + "rand_chacha 0.9.0", "simd_helpers", "thiserror 2.0.18", "v_frame", @@ -4815,22 +4776,42 @@ dependencies = [ "font-types", ] +[[package]] +name = "read-fonts" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4ed38b89c2c77ff968c524145ad65fb010f38af5c7a224b53b81d47ac2daa81" +dependencies = [ + "bytemuck", + "font-types", +] + +[[package]] +name = "redox_event" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c07d0d6d291e3a951bd847b1cd4af32fc6243d64116cf7702838c02797688b7" +dependencies = [ + "bitflags 2.13.0", + "libredox", +] + [[package]] name = "redox_syscall" version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] name = "redox_syscall" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4666a1a60d8412eab19d94f6d13dcc9cea0a5ef4fdf6a5db306537413c661b1b" +checksum = "5b44b894f2a6e36457d665d1e08c3866add6ed5e70050c1b4ba8a8ddedb02ce7" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -4846,9 +4827,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" dependencies = [ "aho-corasick", "memchr", @@ -4869,9 +4850,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "renderdoc-sys" @@ -4931,11 +4912,11 @@ dependencies = [ [[package]] name = "ron" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4147b952f3f819eca0e99527022f7d6a8d05f111aeb0a62960c74eb283bec8fc" +checksum = "81116b9531d61eabc41aeb228e4b6b2435bcca3233b98cf3b3077d4e6e9debb3" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "once_cell", "serde", "serde_derive", @@ -5010,7 +4991,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys 0.4.15", @@ -5023,7 +5004,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys 0.12.1", @@ -5042,7 +5023,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "core_maths", "log", @@ -5083,7 +5064,7 @@ checksum = "1dd3accc0f3f4bbaf2c9e1957a030dc582028130c67660d44c0a0345a22ca69b" dependencies = [ "ab_glyph", "log", - "memmap2 0.9.10", + "memmap2 0.9.11", "smithay-client-toolkit", "tiny-skia", ] @@ -5132,9 +5113,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", @@ -5177,9 +5158,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "signal-hook-registry" @@ -5244,7 +5225,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac" dependencies = [ "bytemuck", - "read-fonts", + "read-fonts 0.37.0", +] + +[[package]] +name = "skrifa" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c34617370ae968efb7161bb2beb517d9084659aae19e24b89e3db25b46e4564" +dependencies = [ + "bytemuck", + "read-fonts 0.39.2", ] [[package]] @@ -5264,9 +5255,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "smithay-client-toolkit" @@ -5274,14 +5265,14 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "calloop", "calloop-wayland-source", "cursor-icon", "libc", "log", - "memmap2 0.9.10", + "memmap2 0.9.11", "pkg-config", "rustix 1.1.4", "thiserror 2.0.18", @@ -5301,7 +5292,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", @@ -5321,9 +5311,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" dependencies = [ "libc", "windows-sys 0.61.2", @@ -5332,31 +5322,26 @@ dependencies = [ [[package]] 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", "log", - "memmap2 0.9.10", + "memmap2 0.9.11", "objc", "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]] @@ -5365,7 +5350,7 @@ version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -5413,20 +5398,20 @@ dependencies = [ [[package]] name = "swash" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842f3cd369c2ba38966204f983eaa5e54a8e84a7d7159ed36ade2b6c335aae64" +checksum = "0811b01ca2c4e8718760713911feaf4675c24f94e50530a015ec646cfb622f7c" dependencies = [ - "skrifa", + "skrifa 0.42.1", "yazi", "zeno", ] [[package]] name = "syn" -version = "2.0.117" +version = "2.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ "proc-macro2", "quote", @@ -5480,9 +5465,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.13.3" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" [[package]] name = "tempfile" @@ -5491,7 +5476,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.2", + "getrandom 0.4.3", "once_cell", "rustix 1.1.4", "windows-sys 0.61.2", @@ -5562,12 +5547,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.47" +version = "0.3.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +checksum = "0e48db7b415311b615f910b3dcaa4557bcd4bf1982379c95c223fd8c2a20e210" dependencies = [ "deranged", - "itoa", "libc", "num-conv", "num_threads", @@ -5579,15 +5563,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.27" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f" dependencies = [ "num-conv", "time-core", @@ -5619,19 +5603,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" @@ -5826,9 +5797,9 @@ checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.20.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "uds_windows" @@ -5913,9 +5884,9 @@ checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee" [[package]] name = "unicode-segmentation" -version = "1.13.2" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-vo" @@ -5929,12 +5900,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "url" version = "2.5.8" @@ -6007,9 +5972,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.23.1" +version = "1.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53" dependencies = [ "js-sys", "serde_core", @@ -6069,27 +6034,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.3+wasi-0.2.9" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ - "wit-bindgen 0.57.1", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen 0.51.0", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.121" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" dependencies = [ "cfg-if", "once_cell", @@ -6100,9 +6056,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.71" +version = "0.4.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" dependencies = [ "js-sys", "wasm-bindgen", @@ -6110,9 +6066,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.121" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6120,9 +6076,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.121" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ "bumpalo", "proc-macro2", @@ -6133,47 +6089,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.121" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags 2.11.1", - "hashbrown 0.15.5", - "indexmap", - "semver", -] - [[package]] name = "wasmtimer" version = "0.4.3" @@ -6208,7 +6130,7 @@ version = "0.31.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "645c7c96bb74690c3189b5c9cb4ca1627062bb23693a4fad9d8c3de958260144" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "rustix 1.1.4", "wayland-backend", "wayland-scanner", @@ -6220,7 +6142,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cursor-icon", "wayland-backend", ] @@ -6238,11 +6160,11 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.32.12" +version = "0.32.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563a85523cade2429938e790815fd7319062103b9f4a2dc806e9b53b95982d8f" +checksum = "23d0c813de3daa2ed6520af85a3bd49b0e722a3078506899aa9686fea58dc4b6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -6255,7 +6177,7 @@ version = "20250721.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6268,7 +6190,7 @@ version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9567599ef23e09b8dad6e429e5738d4509dfc46b3b21f32841a304d16b29c8" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6281,7 +6203,7 @@ version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b6d8cf1eb2c1c31ed1f5643c88a6e53538129d4af80030c8cabd1f9fa884d91" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6294,7 +6216,7 @@ version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb04e52f7836d7c7976c78ca0250d61e33873c34156a2a1fc9474828ec268234" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6319,7 +6241,7 @@ version = "0.31.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc1846eb04c49182e04f4a099e2a830a2b745610bbc1d61246e206f29c7000a0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "downcast-rs", "rustix 1.1.4", "wayland-backend", @@ -6340,9 +6262,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.98" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" dependencies = [ "js-sys", "wasm-bindgen", @@ -6371,7 +6293,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9cb534d5ffd109c7d1135f34cdae29e60eab94855a625dcfe1705f8bc7ad79f" dependencies = [ "arrayvec", - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "cfg-if", "cfg_aliases", @@ -6403,7 +6325,7 @@ dependencies = [ "arrayvec", "bit-set", "bit-vec", - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "cfg_aliases", "document-features", @@ -6463,7 +6385,7 @@ dependencies = [ "arrayvec", "ash", "bit-set", - "bitflags 2.11.1", + "bitflags 2.13.0", "block", "bytemuck", "cfg-if", @@ -6507,7 +6429,7 @@ version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e18308757e594ed2cd27dddbb16a139c42a683819d32a2e0b1b0167552f5840c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "js-sys", "log", @@ -6548,12 +6470,10 @@ 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" dependencies = [ "clipboard-win", "clipboard_macos", "clipboard_wayland", - "clipboard_x11", "dnd", "mime", "raw-window-handle", @@ -6993,9 +6913,8 @@ 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", + "bitflags 2.13.0", "cfg_aliases", "cursor-icon", "dpi", @@ -7013,16 +6932,14 @@ dependencies = [ "winit-wayland", "winit-web", "winit-win32", - "winit-x11", ] [[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", + "bitflags 2.13.0", "dpi", "ndk", "raw-window-handle", @@ -7034,9 +6951,8 @@ 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", + "bitflags 2.13.0", "block2 0.6.2", "dispatch2", "dpi", @@ -7056,24 +6972,21 @@ 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", + "memmap2 0.9.11", "objc2 0.6.4", "objc2-core-foundation", "smol_str", "tracing", "winit-core", - "x11-dl", "xkbcommon-dl", ] [[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", + "bitflags 2.13.0", "cursor-icon", "dpi", "keyboard-types", @@ -7085,14 +6998,13 @@ 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", + "bitflags 2.13.0", "dpi", "libredox", "orbclient", "raw-window-handle", - "redox_syscall 0.7.5", + "redox_event", "smol_str", "tracing", "winit-core", @@ -7101,9 +7013,8 @@ 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", + "bitflags 2.13.0", "block2 0.6.2", "dispatch2", "dpi", @@ -7121,15 +7032,14 @@ 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", + "bitflags 2.13.0", "calloop", "cursor-icon", "dpi", "libc", - "memmap2 0.9.10", + "memmap2 0.9.11", "raw-window-handle", "rustix 1.1.4", "sctk-adwaita", @@ -7147,10 +7057,9 @@ 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", + "bitflags 2.13.0", "concurrent-queue", "cursor-icon", "dpi", @@ -7169,9 +7078,8 @@ 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", + "bitflags 2.13.0", "cursor-icon", "dpi", "raw-window-handle", @@ -7182,132 +7090,21 @@ 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" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" dependencies = [ "memchr", ] -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - [[package]] name = "wit-bindgen" version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck 0.5.0", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck 0.5.0", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags 2.11.1", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - [[package]] name = "write16" version = "1.0.0" @@ -7320,39 +7117,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" @@ -7395,7 +7159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d66ca9352cbd4eecbbc40871d8a11b4ac8107cfc528a6e14d7c19c69d0e1ac9" dependencies = [ "libc", - "memmap2 0.9.10", + "memmap2 0.9.11", "xkeysym", ] @@ -7405,7 +7169,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "dlib", "log", "once_cell", @@ -7468,9 +7232,9 @@ checksum = "e01738255b5a16e78bbb83e7fbba0a1e7dd506905cfc53f4622d89015a03fbb5" [[package]] name = "yoke" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -7491,9 +7255,9 @@ dependencies = [ [[package]] name = "zbus" -version = "5.15.0" +version = "5.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bcbf15c8708d7fc1be0c993622e0a5cbd5e8b52bfa40afa4c3e0cd8d724ac1" +checksum = "eee682d202a77e4a9f3b2c2bdf48a7b28af5c08c34ddf66f98c93e5e39464285" dependencies = [ "async-broadcast", "async-executor", @@ -7551,9 +7315,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "5.15.0" +version = "5.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51fa5406ad9175a8c825a931f8cf347116b531b3634fcb0b627c290f1f2516ff" +checksum = "adf1bd45a81a103745b1757754762a26e8cd01e4532e4d6c8ec431624b80d1d6" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7595,18 +7359,18 @@ checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" [[package]] name = "zerocopy" -version = "0.8.48" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.48" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930" dependencies = [ "proc-macro2", "quote", @@ -7716,9 +7480,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "5.11.0" +version = "5.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c1567a6ec68df868cbbfde844cfc6d81649fe5109a62b116b19fabd53e618ee" +checksum = "a192a0bde63360d77a7523c833d4b4ce6070a927e2c53246e4c540b1a3e27be0" dependencies = [ "endi", "enumflags2", @@ -7731,9 +7495,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "5.11.0" +version = "5.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d5b780599bbde114e39d9a0799577fad1ced5105d38515745f7b3099d8ceda" +checksum = "90bc6cde9c01c511074be97f7ccb6c19d0da89e3f8662e812e999dcfd4638737" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7744,9 +7508,9 @@ dependencies = [ [[package]] name = "zvariant_utils" -version = "3.3.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d464f5733ffa07a3164d656f18533caace9d0638596721355d73256a410d691" +checksum = "1e8535915cfa75547e559d8c68e8139909a4aeee076831e4ef7fc59d8172c4d6" dependencies = [ "proc-macro2", "quote", @@ -7754,3 +7518,7 @@ dependencies = [ "syn", "winnow", ] + +[[patch.unused]] +name = "winit-x11" +version = "0.31.0-beta.2" diff --git a/Cargo.toml b/Cargo.toml index 5e770d9..b980b1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmic-player" -version = "1.0.13" +version = "1.2.0" edition = "2024" rust-version = "1.93" @@ -30,16 +30,17 @@ rust-embed = "8" # Logging env_logger = "0.11" log = "0.4" +open = "5.3.2" [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"] +features = ["about", "advanced-shaping", "tokio", "winit", "multi-window"] [dependencies.mpris-server] version = "0.10" @@ -51,9 +52,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 +63,9 @@ 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" } +[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" } 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/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 diff --git a/debian/changelog b/debian/changelog index 281fb04..a192d54 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,33 @@ +cosmic-player (1.2.0) noble; urgency=medium + + * Epoch 1.2.0 version update + + -- Jeremy Soller Tue, 30 Jun 2026 12:21:32 -0600 + +cosmic-player (1.1.0) noble; urgency=medium + + * Epoch 1.1.0 version update + + -- Jeremy Soller Tue, 23 Jun 2026 08:48:43 -0600 + +cosmic-player (1.0.16) noble; urgency=medium + + * Epoch 1.0.16 version update + + -- Jeremy Soller Tue, 09 Jun 2026 10:26:19 -0600 + +cosmic-player (1.0.15) noble; urgency=medium + + * Epoch 1.0.15 version update + + -- Jeremy Soller Tue, 02 Jun 2026 11:02:44 -0600 + +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 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/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 = 音訊;影片;電影;音樂;聲音;影像; diff --git a/redeploy.sh b/redeploy.sh new file mode 100755 index 0000000..553579e --- /dev/null +++ b/redeploy.sh @@ -0,0 +1,70 @@ +#!/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) + +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 + +echo "OK - COSMIC Media Player rebuilt and redeployed." diff --git a/res/icons/hicolor/16x16/apps/playback-speed-symbolic.svg b/res/icons/hicolor/16x16/apps/playback-speed-symbolic.svg new file mode 100644 index 0000000..b0cf5b4 --- /dev/null +++ b/res/icons/hicolor/16x16/apps/playback-speed-symbolic.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 2c11f3d..285ac5b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,18 +1,19 @@ // 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}; +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::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::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}; @@ -33,6 +34,7 @@ mod config; mod key_bind; mod localize; mod menu; +mod mime; #[cfg(feature = "mpris-server")] mod mpris; mod project; @@ -53,6 +55,9 @@ const JUMP_BACKWARD_ICON: &[u8] = const JUMP_FORWARD_ICON: &[u8] = include_bytes!("../res/icons/hicolor/16x16/apps/jump-forward-10-symbolic.svg"); +const PLAYBACK_SPEED_ICON: &[u8] = + include_bytes!("../res/icons/hicolor/16x16/apps/playback-speed-symbolic.svg"); + use std::error::Error; fn language_name(code: &str) -> Option { @@ -166,6 +171,7 @@ fn main() -> Result<(), Box> { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Action { + About, FileClose, FileOpen, FileClearRecents, @@ -191,6 +197,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, @@ -225,6 +232,7 @@ pub struct Flags { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum DropdownKind { Audio, + Speed, Subtitle, } @@ -288,7 +296,8 @@ pub enum Message { FolderOpenRecent(usize), MultipleLoad(Vec), Fullscreen, - Key(Modifiers, Key), + LaunchUrl(String), + Key(Modifiers, Physical, Key), AudioCode(usize), AudioToggle, AudioVolume(f64), @@ -311,14 +320,18 @@ pub enum Message { NewFrame, Reload, AbRepeat, + VideoAreaClick, + PlaybackSpeed(f64), 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, @@ -341,6 +354,7 @@ pub struct App { text_codes: Vec, current_text: Option, ab_repeat: Option<(Option, Option)>, + playback_speed: f64, #[cfg(feature = "xdg-portal")] inhibit: tokio::sync::watch::Sender, } @@ -455,6 +469,11 @@ impl App { self.set_looping_from_repeat_state(); self.update_flags(); self.update_mpris_meta(); + if self.playback_speed != 1.0 { + if let Some(video) = &mut self.video_opt { + Self::apply_speed(video, self.playback_speed); + } + } self.update_title() } @@ -847,6 +866,12 @@ impl App { video.set_looping(self.flags.config_state.player_state.repeat == RepeatState::Track); } } + + fn apply_speed(video: &mut Video, speed: f64) { + if let Err(err) = video.set_speed(speed) { + log::warn!("failed to set playback speed {}: {}", speed, err); + } + } } /// Implement [`cosmic::Application`] to integrate with COSMIC. @@ -882,8 +907,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, @@ -906,6 +949,7 @@ impl Application for App { text_codes: Vec::new(), current_text: None, ab_repeat: None, + playback_speed: 1.0, #[cfg(feature = "xdg-portal")] inhibit, }; @@ -951,6 +995,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) { @@ -1196,9 +1245,15 @@ impl Application for App { ); } } - Message::Key(modifiers, key) => { + Message::LaunchUrl(url) => match open::that_detached(&url) { + Ok(()) => {} + Err(err) => { + log::warn!("failed to open URL {:?}: {}", url, err); + } + }, + Message::Key(modifiers, physical, key) => { for (key_bind, action) in self.key_binds.iter() { - if key_bind.matches(modifiers, &key) { + if key_bind.matches(modifiers, &key, Some(&physical)) { return self.update(action.message()); } } @@ -1330,10 +1385,10 @@ impl Application for App { } Message::SeekRelative(secs) => { if let Some(video) = &mut self.video_opt { - self.position = video.position().as_secs_f64(); - let duration = - Duration::try_from_secs_f64(self.position + secs).unwrap_or_default(); - video.seek(duration, true).expect("seek"); + self.position = + (video.position().as_secs_f64() + secs).clamp(0.0, self.duration); + let target = Duration::try_from_secs_f64(self.position).unwrap_or_default(); + video.seek(target, true).expect("seek"); } } Message::SeekRelease => { @@ -1455,13 +1510,19 @@ impl Application for App { if let Some(video) = &mut self.video_opt && video.has_video() { + video.set_paused(true); video.pipeline().send_event(gst::event::Step::new( gst::format::Buffers::from_u64(1), 1.0, true, false, )); - video.set_paused(true); + + let fps = get_framerate(video).unwrap_or(30.0); + let frame_duration = Duration::from_secs_f64(1.0 / fps); + + self.position = (video.position().as_secs_f64() + frame_duration.as_secs_f64()) + .clamp(0.0, self.duration); self.update_controls(true); } } @@ -1470,16 +1531,33 @@ impl Application for App { && video.has_video() { // TODO: Improve Accuracy. + video.set_paused(true); + let current = video.position(); let fps = get_framerate(video).unwrap_or(30.0); let frame_duration = Duration::from_secs_f64(1.0 / fps); let target = current.saturating_sub(frame_duration + Duration::from_millis(1)); + self.position = target.as_secs_f64().clamp(0.0, self.duration); video.seek(target, true).expect("seek"); - video.set_paused(true); self.update_controls(true); } } + Message::PlaybackSpeed(speed) => { + self.playback_speed = speed; + self.dropdown_opt = None; + if let Some(video) = &mut self.video_opt { + Self::apply_speed(video, speed); + } + self.update_controls(true); + } + Message::VideoAreaClick => { + if self.dropdown_opt.is_some() { + self.dropdown_opt = None; + } else { + return self.update(Message::PlayPause); + } + } Message::AbRepeat => { let current_opt = self.video_opt.as_ref().map(|v| v.position().as_secs_f64()); if let Some(current) = current_opt { @@ -1605,8 +1683,12 @@ 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 => { - process::exit(0); + self.close(); + return exit(); } } Task::none() @@ -1623,6 +1705,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(); @@ -1741,7 +1835,7 @@ impl Application for App { } let mouse_area = widget::mouse_area(video_player) - .on_press(Message::PlayPause) + .on_press(Message::VideoAreaClick) .on_double_press(Message::Fullscreen); let mut popover = widget::popover(mouse_area).position(widget::popover::Position::Bottom); @@ -1778,6 +1872,58 @@ impl Application for App { .into(), ); } + DropdownKind::Speed => { + for &speed in &[0.75f64, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25] { + let s = format!("{:.2}", speed); + let speed_str = + format!("{}x", s.trim_end_matches('0').trim_end_matches('.')); + let is_active = (self.playback_speed - speed).abs() < 0.01; + + let icon: Element<_> = if is_active { + widget::icon::from_name("object-select-symbolic") + .size(16) + .into() + } else { + widget::container(widget::space::horizontal()) + .width(Length::Fixed(16.0)) + .into() + }; + + let label: Element<_> = if is_active { + widget::text(speed_str).font(font::bold()).into() + } else { + widget::text(speed_str).into() + }; + + let row_content = widget::row::with_children(vec![icon, label]) + .spacing(space_xs) + .align_y(Alignment::Center); + + let content: Element<_> = if is_active { + widget::container(row_content) + .class(theme::Container::custom(|theme| { + let accent: Color = theme.cosmic().accent_color().into(); + widget::container::Style { + icon_color: Some(accent), + text_color: Some(accent), + ..Default::default() + } + })) + .into() + } else { + row_content.into() + }; + + items.push( + widget::button::custom(content) + .width(Length::Fill) + .padding([12.0f32, 8.0f32]) + .class(theme::Button::MenuItem) + .on_press(Message::PlaybackSpeed(speed)) + .into(), + ); + } + } DropdownKind::Subtitle => { if !self.audio_codes.is_empty() { items.push(widget::text::heading(fl!("audio")).into()); @@ -1806,34 +1952,42 @@ impl Application for App { } } + let use_padding = !matches!(dropdown, DropdownKind::Speed); let mut column = widget::column::with_capacity(items.len()); for item in items { - column = column.push(widget::container(item).padding([space_xxs, space_m])); + column = column.push(if use_padding { + widget::container(item).padding([space_xxs, space_m]).into() + } else { + item + }); } popup_items.push( widget::row::with_children(vec![ widget::space::horizontal().into(), - widget::container(column) - .padding(1) - //TODO: move style to libcosmic - .class(theme::Container::custom(|theme| { - let cosmic = theme.cosmic(); - let component = &cosmic.background.component; - widget::container::Style { - icon_color: Some(component.on.into()), - text_color: Some(component.on.into()), - background: Some(Background::Color(component.base.into())), - border: Border { - radius: 8.0.into(), - width: 1.0, - color: component.divider.into(), - }, - ..Default::default() - } - })) - .width(Length::Fixed(240.0)) - .into(), + widget::mouse_area( + widget::container(column) + .padding(1) + //TODO: move style to libcosmic + .class(theme::Container::custom(|theme| { + let cosmic = theme.cosmic(); + let component = &cosmic.background(false).component; + widget::container::Style { + icon_color: Some(component.on.into()), + text_color: Some(component.on.into()), + background: Some(Background::Color(component.base.into())), + border: Border { + radius: 8.0.into(), + width: 1.0, + color: component.divider.into(), + }, + ..Default::default() + } + })) + .width(Length::Fixed(240.0)), + ) + .on_press(Message::ShowControls) + .into(), ]) .into(), ); @@ -1929,6 +2083,12 @@ impl Application for App { ) .on_press(Message::DropdownToggle(DropdownKind::Subtitle)), ) + .push( + widget::button::icon( + widget::icon::from_svg_bytes(PLAYBACK_SPEED_ICON).symbolic(true), + ) + .on_press(Message::DropdownToggle(DropdownKind::Speed)), + ) .push( widget::button::icon( widget::icon::from_name("view-fullscreen-symbolic").size(16), @@ -1956,31 +2116,37 @@ impl Application for App { .on_press(Message::DropdownToggle(DropdownKind::Audio)), ); popup_items.push( - widget::container(row) - .padding([space_xxs, space_xs]) - .class(theme::Container::WindowBackground) - .into(), + widget::mouse_area( + widget::container(row) + .padding([space_xxs, space_xs]) + .class(theme::Container::WindowBackground), + ) + .on_press(Message::ShowControls) + .into(), ); if self.core.is_condensed() { popup_items.push( - widget::container( - widget::row::with_capacity(3) - .align_y(Alignment::Center) - .spacing(space_xxs) - .push(widget::text(format_time(self.position)).font(font::mono())) - .push( - Slider::new(0.0..=self.duration, self.position, Message::Seek) - .step(0.1) - .on_release(Message::SeekRelease), - ) - .push( - widget::text(format_time(self.duration - self.position)) - .font(font::mono()), - ), + widget::mouse_area( + widget::container( + widget::row::with_capacity(3) + .align_y(Alignment::Center) + .spacing(space_xxs) + .push(widget::text(format_time(self.position)).font(font::mono())) + .push( + Slider::new(0.0..=self.duration, self.position, Message::Seek) + .step(0.1) + .on_release(Message::SeekRelease), + ) + .push( + widget::text(format_time(self.duration - self.position)) + .font(font::mono()), + ), + ) + .padding([space_xxs, space_xs]) + .class(theme::Container::WindowBackground), ) - .padding([space_xxs, space_xs]) - .class(theme::Container::WindowBackground) + .on_press(Message::ShowControls) .into(), ); } @@ -2010,9 +2176,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, 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)) 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()) } } diff --git a/src/video.rs b/src/video.rs index 743f43e..1953fe5 100644 --- a/src/video.rs +++ b/src/video.rs @@ -27,6 +27,11 @@ pub fn new_video( .downcast::() .map_err(|_| iced_video_player::Error::Cast) .unwrap(); + if let Ok(scaletempo) = gst::ElementFactory::make("scaletempo").build() { + pipeline.set_property("audio-filter", &scaletempo); + } else { + log::warn!("scaletempo element not available; speed changes will affect pitch"); + } pipeline.connect("element-setup", false, |vals| { let Ok(elem) = vals[1].get::() else { return 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..b703312 --- /dev/null +++ b/vendor/iced_video_player/src/pipeline.rs @@ -0,0 +1,448 @@ +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], + immediate_size: 0, + }); + + 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_mask: 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::MipmapFilterMode::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, + multiview_mask: 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..6d174e5 --- /dev/null +++ b/vendor/iced_video_player/src/video.rs @@ -0,0 +1,665 @@ +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()) + } + #[allow(dead_code)] + 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) + } +}