diff options
| -rw-r--r-- | Cargo.lock | 376 | ||||
| -rw-r--r-- | Cargo.toml | 11 | ||||
| -rw-r--r-- | flake.lock | 18 | ||||
| -rw-r--r-- | flake.nix | 30 | ||||
| -rw-r--r-- | src/main.rs | 1 |
5 files changed, 409 insertions, 27 deletions
diff --git a/Cargo.lock b/Cargo.lock index 2888833..9519efd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,6 +27,15 @@ dependencies = [ ] [[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] name = "anstream" version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -146,6 +155,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" [[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] name = "bumpalo" version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -210,6 +225,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] +name = "chrono" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +dependencies = [ + "iana-time-zone", + "num-traits", + "windows-link 0.2.1", +] + +[[package]] name = "clang-sys" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -221,6 +247,35 @@ dependencies = [ ] [[package]] +name = "cocoa" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad36507aeb7e16159dfe68db81ccc27571c3ccd4b76fb2fb72fc59e7a4b1b64c" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81411967c50ee9a1fc11365f8c585f863a22a9697c89239c452292c40ba79b0d" +dependencies = [ + "bitflags", + "block", + "core-foundation", + "core-graphics-types", + "objc", +] + +[[package]] name = "colorchoice" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -236,6 +291,46 @@ dependencies = [ ] [[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" +dependencies = [ + "bitflags", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags", + "core-foundation", + "libc", +] + +[[package]] name = "crossbeam-utils" version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -351,6 +446,33 @@ dependencies = [ ] [[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] name = "fragile" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -503,6 +625,31 @@ dependencies = [ ] [[package]] +name = "gdk4-win32" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f88ca409b0e2c814f4a30e78a0ba5f8b5133e2c95ad4f0b57c9a98d1337620" +dependencies = [ + "gdk4", + "gdk4-win32-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk4-win32-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8802202ddc9a4b682ed5cb8e2f3bf9eece0ee55edc938c775ae02378839938" +dependencies = [ + "gdk4-sys", + "glib-sys", + "libc", + "system-deps", +] + +[[package]] name = "getrandom" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -667,6 +814,33 @@ dependencies = [ ] [[package]] +name = "gst-plugin-gtk4" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3ac5bcd3b6d159d4f4bf521efee0db52c97ea1a731f1721ba8a52828b331fb" +dependencies = [ + "async-channel", + "gdk4-win32", + "gst-plugin-version-helper", + "gstreamer", + "gstreamer-base", + "gstreamer-gl", + "gstreamer-video", + "gtk4", + "windows-sys 0.60.2", +] + +[[package]] +name = "gst-plugin-version-helper" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68a894ef2d738054b950e1dbef5d9012b63fd968d4d32dbccd31bd8d8d4b219" +dependencies = [ + "chrono", + "toml_edit 0.23.7", +] + +[[package]] name = "gstreamer" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -719,6 +893,35 @@ dependencies = [ ] [[package]] +name = "gstreamer-gl" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a96afcc53a219607e797af298c50537a0cae0f54414c860209a21b0b660c3b" +dependencies = [ + "glib", + "gstreamer", + "gstreamer-base", + "gstreamer-gl-sys", + "gstreamer-video", + "libc", +] + +[[package]] +name = "gstreamer-gl-sys" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbad7be8c51998c1a4645b0e165b424442649081109aaf30d503d38a57e6f23c" +dependencies = [ + "glib-sys", + "gobject-sys", + "gstreamer-base-sys", + "gstreamer-sys", + "gstreamer-video-sys", + "libc", + "system-deps", +] + +[[package]] name = "gstreamer-play" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -859,10 +1062,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] +name = "iana-time-zone" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] name = "indexmap" -version = "2.11.0" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", "hashbrown", @@ -1007,8 +1234,10 @@ version = "0.1.0" dependencies = [ "anyhow", "async-channel", + "cocoa", "env_logger", "ffmpeg-next", + "gst-plugin-gtk4", "gstreamer", "gstreamer-play", "gstreamer-video", @@ -1016,8 +1245,10 @@ dependencies = [ "isolang", "libadwaita", "log", + "objc", "relm4", "relm4-components", + "system-deps", "tracker", "unicode-segmentation", ] @@ -1039,6 +1270,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] name = "memchr" version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1143,6 +1383,15 @@ dependencies = [ ] [[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] name = "object" version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1265,7 +1514,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ - "toml_edit", + "toml_edit 0.22.27", ] [[package]] @@ -1383,6 +1632,12 @@ dependencies = [ ] [[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1396,18 +1651,27 @@ checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1534,8 +1798,8 @@ checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", - "toml_datetime", - "toml_edit", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", ] [[package]] @@ -1548,6 +1812,15 @@ dependencies = [ ] [[package]] +name = "toml_datetime" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +dependencies = [ + "serde_core", +] + +[[package]] name = "toml_edit" version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1556,7 +1829,28 @@ dependencies = [ "indexmap", "serde", "serde_spanned", - "toml_datetime", + "toml_datetime 0.6.11", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.23.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" +dependencies = [ + "indexmap", + "toml_datetime 0.7.3", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +dependencies = [ "winnow", ] @@ -1655,6 +1949,7 @@ checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] @@ -1705,12 +2000,71 @@ dependencies = [ ] [[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "windows-link" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1750,7 +2104,7 @@ version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ - "windows-link", + "windows-link 0.1.3", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", diff --git a/Cargo.toml b/Cargo.toml index 9731e9a..ed363f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,9 @@ edition = "2024" gst = { version = "0.24.1", package = "gstreamer", features = ["v1_26"] } gst-video = { version = "0.24.1", package = "gstreamer-video", features = ["v1_26"] } gst-play = { version = "0.24.0", package = "gstreamer-play", features = ["v1_26"] } -gtk = { version = "0.10.0", package = "gtk4", features = ["v4_18"] } -adw = { version = "0.8.0", package = "libadwaita", features = ["v1_7"] } +gst-plugin-gtk4 = { version = "0.14", features = ["gtk_v4_16"] } +gtk = { version = "0.10.0", package = "gtk4", features = ["v4_16"] } +adw = { version = "0.8.0", package = "libadwaita", features = ["v1_6"] } async-channel = "2.0" relm4 = { version = "0.10.0-beta.4", features = ["libadwaita"] } relm4-components = "0.10.0-beta.4" @@ -20,6 +21,12 @@ tracker = "0.2.2" unicode-segmentation = "1.12.0" isolang = { git = "https://github.com/humenda/isolang-rs" } +[target.'cfg(target_os = "macos")'.dependencies] +cocoa = "0.26" +objc = "0.2.7" + +[target.'cfg(target_os = "macos")'.build-dependencies] +system-deps = "7" # TODO remove [profile.release] diff --git a/flake.lock b/flake.lock index 83137df..dc178fd 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1756795219, - "narHash": "sha256-tKBQtz1JLKWrCJUxVkHKR+YKmVpm0KZdJdPWmR2slQ8=", + "lastModified": 1760078406, + "narHash": "sha256-JeJK0ZA845PtkCHkfo4KjeI1mYrsr2s3cxBYKhF4BoE=", "owner": "nix-community", "repo": "fenix", - "rev": "80dbdab137f2809e3c823ed027e1665ce2502d74", + "rev": "351277c60d104944122ee389cdf581c5ce2c6732", "type": "github" }, "original": { @@ -84,11 +84,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1756696532, - "narHash": "sha256-6FWagzm0b7I/IGigOv9pr6LL7NQ86mextfE8g8Q6HBg=", + "lastModified": 1759977445, + "narHash": "sha256-LYr4IDfuihCkFAkSYz5//gT2r1ewcWBYgd5AxPzPLIo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "58dcbf1ec551914c3756c267b8b9c8c86baa1b2f", + "rev": "2dad7af78a183b6c486702c18af8a9544f298377", "type": "github" }, "original": { @@ -109,11 +109,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1756597274, - "narHash": "sha256-wfaKRKsEVQDB7pQtAt04vRgFphkVscGRpSx3wG1l50E=", + "lastModified": 1760014945, + "narHash": "sha256-ySdl7F9+oeWNHVrg3QL/brazqmJvYFEdpGnF3pyoDH8=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "21614ed2d3279a9aa1f15c88d293e65a98991b30", + "rev": "90d2e1ce4dfe7dc49250a8b88a0f08ffdb9cb23f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0fca036..1a7ac29 100644 --- a/flake.nix +++ b/flake.nix @@ -23,9 +23,30 @@ system: let overlay = final: prev: { - whisper-cpp = prev.whisper-cpp.override { - vulkanSupport = true; - }; + # whisper-cpp = prev.whisper-cpp.override { + # vulkanSupport = true; + # }; + + # we use the last version of gtk4 which still has the old GL renderer; + # the new one is broken on macos + gtk4 = prev.gtk4.overrideAttrs (finalAttrs: prevAttrs: { + version = "4.16.12"; + src = final.fetchurl { + url = "mirror://gnome/sources/gtk/${final.lib.versions.majorMinor finalAttrs.version}/gtk-${finalAttrs.version}.tar.xz"; + hash = "sha256-7zG9vW8ILEQBY0ogyFCwBQyb8lLvHgeXZO6VoqDEyVo="; + }; + }); + libadwaita = prev.libadwaita.overrideAttrs (finalAttrs: prevAttrs: { + version = "1.6.3"; + src = final.fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "GNOME"; + repo = "libadwaita"; + rev = finalAttrs.version; + hash = "sha256-4rYiNI6Oj++iqbPIwe8KvwviGnh93sAZ9wp1cIPZcBA="; + }; + mesonFlags = []; + }); }; pkgs = import nixpkgs { inherit system; @@ -67,9 +88,8 @@ gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-ugly - gst_all_1.gst-plugins-rs gst_all_1.gst-libav - gst_all_1.gst-vaapi + #gst_all_1.gst-vaapi ffmpeg_8-full.dev ]; diff --git a/src/main.rs b/src/main.rs index 6ce1ca9..0b7db50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,6 +27,7 @@ fn main() { gtk::init().expect("Failed to initialize GTK"); gst::init().expect("Failed to initialize GStreamer"); + gstgtk4::plugin_register_static().expect("Failed to register gstgtk4 plugin."); ffmpeg::init().expect("Failed to initialize FFmpeg"); let css_provider = CssProvider::new(); |