diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b84ada5..e944336 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,10 +26,10 @@ jobs: - name: Install rust toolchain run: sudo apt-get install -qy cargo-1.80 rust-1.80-clippy - name: Install system dependencies - run: sudo apt-get install -qy liblzma-dev libpipewire-0.3-dev libclang-dev libdbus-1-dev ffmpeg libavutil-dev libavformat-dev libavfilter-dev libavdevice-dev + run: sudo apt-get install -qy liblzma-dev libpipewire-0.3-dev libclang-dev libdbus-1-dev - name: Run Clippy run: cargo clippy --all-targets --all-features - name: Build - run: cargo build --release + run: cargo build --release --verbose diff --git a/Cargo.lock b/Cargo.lock index 0be38da..b9ad7ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,20 +74,20 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.8" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6680de5231bd6ee4c6191b8a1325daa282b415391ec9d3a37bd34f2060dc73fa" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", - "once_cell_polyfill", + "once_cell", "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.98" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "arbitrary" @@ -120,9 +120,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "av1-grain" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3efb2ca85bc610acfa917b5aaa36f3fcbebed5b3182d7f877b02531c4b80c8" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" dependencies = [ "anyhow", "arrayvec", @@ -148,10 +148,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "annotate-snippets", - "bitflags 2.9.1", + "bitflags 2.8.0", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools", "lazy_static", "lazycell", "proc-macro2", @@ -162,24 +162,6 @@ dependencies = [ "syn", ] -[[package]] -name = "bindgen" -version = "0.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" -dependencies = [ - "bitflags 2.9.1", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", -] - [[package]] name = "bit_field" version = "0.10.2" @@ -194,9 +176,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitstream-io" @@ -245,9 +227,15 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.23.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "byteorder-lite" @@ -257,15 +245,15 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.10.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.2.24" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16595d3be041c03b09d08d0858631facccee9221e579704070e6e9e4915d3bc7" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -297,6 +285,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "clang-sys" version = "1.8.1" @@ -310,9 +304,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.38" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", "clap_derive", @@ -320,9 +314,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.38" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstream", "anstyle", @@ -332,9 +326,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck", "proc-macro2", @@ -443,7 +437,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32eb7c354ae9f6d437a6039099ce7ecd049337a8109b23d73e48e8ffba8e9cd5" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.8.0", "core-foundation", "core-graphics-types", "foreign-types", @@ -521,10 +515,20 @@ dependencies = [ ] [[package]] -name = "data-encoding" -version = "2.9.0" +name = "ctrlc" +version = "3.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" +checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" +dependencies = [ + "nix 0.29.0", + "windows-sys", +] + +[[package]] +name = "data-encoding" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" [[package]] name = "dbus" @@ -564,9 +568,9 @@ dependencies = [ [[package]] name = "either" -version = "1.15.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" [[package]] name = "env_filter" @@ -580,14 +584,14 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.8" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" dependencies = [ "anstream", "anstyle", "env_filter", - "jiff", + "humantime", "log", ] @@ -614,9 +618,9 @@ dependencies = [ [[package]] name = "fast_image_resize" -version = "5.1.4" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d372ab3252d8f162d858d675a3d88a8c33ba24a6238837c50c8851911c7e89cd" +checksum = "b55264ccc579fc127eebf6c6c1841d0c160d79a44c8f6f97047b7bc4a9c0d1a5" dependencies = [ "bytemuck", "cfg-if", @@ -635,36 +639,11 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "ffmpeg-next" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da02698288e0275e442a47fc12ca26d50daf0d48b15398ba5906f20ac2e2a9f9" -dependencies = [ - "bitflags 2.9.1", - "ffmpeg-sys-next", - "libc", -] - -[[package]] -name = "ffmpeg-sys-next" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9e9c75ebd4463de9d8998fb134ba26347fe5faee62fabf0a4b4d41bd500b4ad" -dependencies = [ - "bindgen 0.70.1", - "cc", - "libc", - "num_cpus", - "pkg-config", - "vcpkg", -] - [[package]] name = "flate2" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "miniz_oxide", @@ -810,9 +789,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -821,14 +800,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" dependencies = [ "cfg-if", "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", ] [[package]] @@ -849,9 +828,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "half" -version = "2.6.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", @@ -859,9 +838,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.3" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -869,17 +848,11 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "http" -version = "1.3.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -888,15 +861,21 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "image" -version = "0.25.6" +version = "0.25.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" dependencies = [ "bytemuck", "byteorder-lite", @@ -933,9 +912,9 @@ checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" [[package]] name = "indexmap" -version = "2.9.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown", @@ -967,52 +946,18 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "jiff" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a194df1107f33c79f4f93d02c80798520551949d59dfad22b6157048a88cca93" -dependencies = [ - "jiff-static", - "log", - "portable-atomic", - "portable-atomic-util", - "serde", -] - -[[package]] -name = "jiff-static" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c6e1db7ed32c6c71b759497fae34bf7933636f75a251b9e736555da426f6442" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" -version = "0.1.33" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ - "getrandom 0.3.3", "libc", ] @@ -1042,9 +987,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.172" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libdbus-sys" @@ -1067,12 +1012,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.7" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.53.0", + "windows-targets", ] [[package]] @@ -1081,13 +1026,13 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65f3a4b81b2a2d8c7f300643676202debd1b7c929dbf5c9bb89402ea11d19810" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.8.0", "cc", "convert_case", "cookie-factory", "libc", "libspa-sys", - "nix", + "nix 0.27.1", "nom", "system-deps", ] @@ -1098,7 +1043,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf0d9716420364790e85cbb9d3ac2c950bde16a7dd36f3209b7dfdfc4a24d01f" dependencies = [ - "bindgen 0.69.5", + "bindgen", "cc", "system-deps", ] @@ -1121,9 +1066,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "loop9" @@ -1167,9 +1112,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.8" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", "simd-adler32", @@ -1187,11 +1132,23 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.8.0", "cfg-if", "libc", ] +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.8.0", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -1267,16 +1224,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "objc" version = "0.2.7" @@ -1318,15 +1265,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "once_cell_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "parking_lot" @@ -1348,7 +1289,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -1376,11 +1317,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08e645ba5c45109106d56610b3ee60eb13a6f2beb8b74f8dc8186cf261788dda" dependencies = [ "anyhow", - "bitflags 2.9.1", + "bitflags 2.8.0", "libc", "libspa", "libspa-sys", - "nix", + "nix 0.27.1", "once_cell", "pipewire-sys", "thiserror 1.0.69", @@ -1392,16 +1333,16 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "849e188f90b1dda88fe2bfe1ad31fe5f158af2c98f80fb5d13726c44f3f01112" dependencies = [ - "bindgen 0.69.5", + "bindgen", "libspa-sys", "system-deps", ] [[package]] name = "pkg-config" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "png" @@ -1416,35 +1357,20 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "portable-atomic" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" - -[[package]] -name = "portable-atomic-util" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" -dependencies = [ - "portable-atomic", -] - [[package]] name = "ppv-lite86" -version = "0.2.21" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy", + "zerocopy 0.7.35", ] [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -1485,19 +1411,13 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.40" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] -[[package]] -name = "r-efi" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" - [[package]] name = "radium" version = "0.7.0" @@ -1517,12 +1437,13 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.3", + "rand_core 0.9.2", + "zerocopy 0.8.21", ] [[package]] @@ -1542,7 +1463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", + "rand_core 0.9.2", ] [[package]] @@ -1551,16 +1472,17 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.15", ] [[package]] name = "rand_core" -version = "0.9.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +checksum = "7a509b1a2ffbe92afab0e55c8fd99dea1c280e8171bd2d88682bb20bc41cbc2c" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.1", + "zerocopy 0.8.21", ] [[package]] @@ -1577,7 +1499,7 @@ dependencies = [ "built", "cfg-if", "interpolate_name", - "itertools 0.12.1", + "itertools", "libc", "libfuzzer-sys", "log", @@ -1600,9 +1522,9 @@ dependencies = [ [[package]] name = "ravif" -version = "0.11.12" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6a5f31fcf7500f9401fea858ea4ab5525c99f2322cfcee732c0e6c74208c0c6" +checksum = "2413fd96bd0ea5cdeeb37eaf446a22e6ed7b981d792828721e74ded1980a45c6" dependencies = [ "avif-serialize", "imgref", @@ -1635,11 +1557,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.12" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.8.0", ] [[package]] @@ -1695,9 +1617,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustversion" -version = "1.0.21" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "scap" @@ -1750,18 +1672,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.219" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", @@ -1779,30 +1701,29 @@ dependencies = [ [[package]] name = "servicepoint" -version = "0.15.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91a33bff7f9db5008748b23ca0c906c276fe00694390b681f004a55968a42cfe" +checksum = "33abd53582a995aaf5d387be4a1f7eb294a084185f88f8cf61652b6272041660" dependencies = [ "bitvec", "log", "once_cell", "rust-lzma", - "thiserror 2.0.12", + "thiserror 2.0.11", + "tungstenite", ] [[package]] name = "servicepoint-cli" -version = "0.4.0" +version = "0.3.0" dependencies = [ "clap", "env_logger", "fast_image_resize", - "ffmpeg-next", "image", "log", "scap", "servicepoint", - "tungstenite", ] [[package]] @@ -1848,9 +1769,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.15.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "strsim" @@ -1860,9 +1781,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.101" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -1932,11 +1853,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.12" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.12", + "thiserror-impl 2.0.11", ] [[package]] @@ -1952,9 +1873,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", @@ -1974,9 +1895,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.22" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -1986,18 +1907,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.9" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.26" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -2017,9 +1938,9 @@ dependencies = [ "http", "httparse", "log", - "rand 0.9.1", + "rand 0.9.0", "sha1", - "thiserror 2.0.12", + "thiserror 2.0.11", "utf-8", ] @@ -2031,9 +1952,9 @@ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-segmentation" @@ -2096,9 +2017,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" -version = "0.14.2+wasi-0.2.4" +version = "0.13.3+wasi-0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" dependencies = [ "wit-bindgen-rt", ] @@ -2163,9 +2084,9 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.10" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "winapi" @@ -2196,7 +2117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core 0.52.0", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2206,42 +2127,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ "windows-core 0.58.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows" -version = "0.61.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" -dependencies = [ - "windows-collections", - "windows-core 0.61.2", - "windows-future", - "windows-link", - "windows-numerics", + "windows-targets", ] [[package]] name = "windows-capture" -version = "1.4.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c9e7b920233fec91cb314ad92b96853ba2907e3482a193d290d33838e3fc5" +checksum = "6001b777f61cafce437201de46a019ed7f4afed3b669f02e5ce4e0759164cb3e" dependencies = [ + "clap", + "ctrlc", "parking_lot", "rayon", - "thiserror 2.0.12", - "windows 0.61.1", - "windows-future", -] - -[[package]] -name = "windows-collections" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" -dependencies = [ - "windows-core 0.61.2", + "thiserror 1.0.69", + "windows 0.58.0", ] [[package]] @@ -2250,7 +2150,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2259,35 +2159,11 @@ version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" -dependencies = [ - "windows-implement 0.60.0", - "windows-interface 0.59.1", - "windows-link", - "windows-result 0.3.4", - "windows-strings 0.4.2", -] - -[[package]] -name = "windows-future" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" -dependencies = [ - "windows-core 0.61.2", - "windows-link", - "windows-threading", + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets", ] [[package]] @@ -2301,17 +2177,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-implement" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-interface" version = "0.58.0" @@ -2323,49 +2188,13 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-interface" -version = "0.59.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-link" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" - -[[package]] -name = "windows-numerics" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" -dependencies = [ - "windows-core 0.61.2", - "windows-link", -] - [[package]] name = "windows-result" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link", + "windows-targets", ] [[package]] @@ -2374,17 +2203,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link", + "windows-result", + "windows-targets", ] [[package]] @@ -2393,7 +2213,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2402,39 +2222,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" -dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", -] - -[[package]] -name = "windows-threading" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" -dependencies = [ - "windows-link", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -2443,112 +2238,64 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - [[package]] name = "winnow" -version = "0.7.10" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" dependencies = [ "memchr", ] [[package]] name = "wit-bindgen-rt" -version = "0.39.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.8.0", ] [[package]] @@ -2571,18 +2318,39 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.25" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "byteorder", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf01143b2dd5d134f11f545cf9f1431b13b749695cb33bcce051e7568f99478" +dependencies = [ + "zerocopy-derive 0.8.21", ] [[package]] name = "zerocopy-derive" -version = "0.8.25" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712c8386f4f4299382c9abee219bee7084f78fb939d88b6840fcc1320d5f6da2" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index b857c2d..a8cd60f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "servicepoint-cli" description = "A command line interface for the ServicePoint display." -version = "0.4.0" +version = "0.3.0" edition = "2021" rust-version = "1.80.0" publish = true @@ -13,19 +13,10 @@ homepage = "https://crates.io/crates/servicepoint-cli" keywords = ["cccb", "cccb-servicepoint", "cli"] [dependencies] +servicepoint = { version = "0.13.2", features = ["protocol_websocket"] } clap = { version = "4.5", features = ["derive"] } env_logger = "0.11" log = "0.4" scap = "0.0.8" -image = "0.25" -fast_image_resize = { version = "5.1", features = ["image"] } -tungstenite = "0.26" -ffmpeg-next = "7.1" - -[dependencies.servicepoint] -version = "0.15.0" - -[profile.release] -lto = true # Enable link-time optimization -codegen-units = 1 # Reduce number of codegen units to increase optimizations -strip = true # Strip symbols from binary +image = "0.25.5" +fast_image_resize = { version = "5.1.2", features = ["image"] } diff --git a/README.md b/README.md index 3876566..be1dab7 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,5 @@ # servicepoint-cli -[![Release](https://git.berlin.ccc.de/servicepoint/servicepoint-cli/badges/release.svg)](https://git.berlin.ccc.de/servicepoint/servicepoint-cli/releases) -[![crates.io](https://img.shields.io/crates/v/servicepoint-cli.svg)](https://crates.io/crates/servicepoint-cli) -[![Crates.io Total Downloads](https://img.shields.io/crates/d/servicepoint-cli)](https://crates.io/crates/servicepoint-cli) -![GPLv3 licensed](https://img.shields.io/crates/l/servicepoint-cli) -[![CI](https://git.berlin.ccc.de/servicepoint/servicepoint-cli/badges/workflows/rust.yml/badge.svg)](https://git.berlin.ccc.de/servicepoint/servicepoint-cli) - This repository contains a command line interface for the ServicePoint display. To send commands, this uses the [servicepoint crate](https://crates.io/crates/servicepoint). @@ -39,15 +33,15 @@ cargo run -- ## Usage -```text +``` Usage: servicepoint-cli [OPTIONS] Commands: - reset Reset both pixels and brightness [aliases: r] - pixels Commands for manipulating pixels [aliases: p] - brightness Commands for manipulating the brightness [aliases: b] - text Commands for sending text to the screen [aliases: t] - help Print this message or the help of the given subcommand(s) + reset-everything Reset both pixels and brightness [aliases: r] + pixels Commands for manipulating pixels [aliases: p] + brightness Commands for manipulating the brightness [aliases: b] + text Commands for sending text to the screen [aliases: t] + help Print this message or the help of the given subcommand(s) Options: -d, --destination ip:port of the servicepoint display [default: 127.0.0.1:2342] @@ -59,7 +53,7 @@ Options: ### Pixels -```text +``` Commands for manipulating pixels Usage: servicepoint-cli pixels @@ -69,13 +63,12 @@ Commands: flip Invert the state of all pixels [aliases: f] on Set all pixels to the on state image Send an image file (e.g. jpeg or png) to the display. [aliases: i] - video Stream a video file (e.g. mp4) to the display. [aliases: v] screen Stream the default screen capture source to the display. On Linux Wayland, this pops up a screen or window chooser, but it also may directly start streaming your main screen. [aliases: s] ``` #### Image -```text +``` Send an image file (e.g. jpeg or png) to the display. Usage: servicepoint-cli pixels image [OPTIONS] @@ -92,28 +85,9 @@ Options: --no-aspect Do not keep aspect ratio when resizing. ``` -#### Video file - -```text -Stream a video file (e.g. mp4) to the display. - -Usage: servicepoint-cli pixels video [OPTIONS] - -Arguments: - - -Options: - --no-hist Disable histogram correction - --no-blur Disable blur - --no-sharp Disable sharpening - --no-dither Disable dithering. Brightness will be adjusted so that around half of the pixels are on. - --no-spacers Do not remove the spacers from the image. - --no-aspect Do not keep aspect ratio when resizing. -``` - #### Screen -```text +``` Stream the default screen capture source to the display. On Linux Wayland, this pops up a screen or window chooser, but it also may directly start streaming your main screen. Usage: servicepoint-cli pixels screen [OPTIONS] @@ -130,7 +104,7 @@ Options: ### Brightness -```text +``` Commands for manipulating the brightness Usage: servicepoint-cli brightness @@ -143,18 +117,18 @@ Commands: ### Text -```text +``` Commands for sending text to the screen Usage: servicepoint-cli text Commands: - stdin Pipe text to the display, example: `journalctl | servicepoint-cli text stdin` + stdin Pipe text to the display, example: `journalctl | servicepoint-cli stream stdin` ``` #### Stdin -```text +``` Pipe text to the display, example: `journalctl | servicepoint-cli stream stdin` Usage: servicepoint-cli stream stdin [OPTIONS] @@ -163,16 +137,6 @@ Options: -s, --slow Wait for a short amount of time before sending the next line ``` -### Reset - -```text -Reset both pixels and brightness - -Usage: servicepoint-cli reset [OPTIONS] - -Options: --f, --force hard reset screen -``` ## Contributing diff --git a/flake.lock b/flake.lock index 93740d5..e99b4ca 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1745925850, - "narHash": "sha256-cyAAMal0aPrlb1NgzMxZqeN1mAJ2pJseDhm2m6Um8T0=", + "lastModified": 1739824009, + "narHash": "sha256-fcNrCMUWVLMG3gKC5M9CBqVOAnJtyRvGPxptQFl5mVg=", "owner": "nix-community", "repo": "naersk", - "rev": "38bc60bbc157ae266d4a0c96671c6c742ee17a5f", + "rev": "e5130d37369bfa600144c2424270c96f0ef0e11d", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1747862697, - "narHash": "sha256-U4HaNZ1W26cbOVm0Eb5OdGSnfQVWQKbLSPrSSa78KC0=", + "lastModified": 1740603184, + "narHash": "sha256-t+VaahjQAWyA+Ctn2idyo1yxRIYpaDxMgHkgCNiMJa4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2baa12ff69913392faf0ace833bc54bba297ea95", + "rev": "f44bd8ca21e026135061a0a57dcf3d0775b67a49", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f1a8ebf..405734a 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,7 @@ }; nativeBuildInputs = with pkgs; [ pkg-config + libclang rustPlatform.bindgenHook ]; strictDeps = true; @@ -63,13 +64,14 @@ [ xe xz - ffmpeg-headless + clang ] ++ lib.optionals pkgs.stdenv.isLinux ( with pkgs; [ dbus pipewire + libclang ] ); }; @@ -88,7 +90,8 @@ { default = pkgs.mkShell rec { inputsFrom = [ self.packages.${system}.default ]; - packages = with pkgs; [ + packages = [ + pkgs.gdb (pkgs.symlinkJoin { name = "rust-toolchain"; paths = with pkgs; [ @@ -100,9 +103,7 @@ cargo-expand ]; }) - - cargo-flamegraph - gdb + pkgs.cargo-flamegraph ]; LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (builtins.concatMap (d: d.buildInputs) inputsFrom)}"; RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; diff --git a/src/brightness.rs b/src/brightness.rs index 49ad898..adead44 100644 --- a/src/brightness.rs +++ b/src/brightness.rs @@ -1,8 +1,8 @@ -use crate::{cli::BrightnessCommand, transport::Transport}; +use crate::cli::BrightnessCommand; use log::info; -use servicepoint::{Brightness, GlobalBrightnessCommand}; +use servicepoint::{Brightness, Command, Connection}; -pub(crate) fn brightness(connection: &Transport, brightness_command: BrightnessCommand) { +pub(crate) fn brightness(connection: &Connection, brightness_command: BrightnessCommand) { match brightness_command { BrightnessCommand::Max => brightness_set(connection, Brightness::MAX), BrightnessCommand::Min => brightness_set(connection, Brightness::MIN), @@ -12,9 +12,9 @@ pub(crate) fn brightness(connection: &Transport, brightness_command: BrightnessC } } -pub(crate) fn brightness_set(connection: &Transport, brightness: Brightness) { +pub(crate) fn brightness_set(connection: &Connection, brightness: Brightness) { connection - .send_command(GlobalBrightnessCommand::from(brightness)) + .send(Command::Brightness(brightness)) .expect("Failed to set brightness"); info!("set brightness to {brightness:?}"); } diff --git a/src/cli.rs b/src/cli.rs index c7a4a45..365ff5a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -19,7 +19,7 @@ pub struct Cli { value_enum, default_value = "udp" )] - pub transport: TransportType, + pub transport: Protocol, #[clap(subcommand)] pub command: Mode, #[clap(short, long, help = "verbose logging")] @@ -29,10 +29,7 @@ pub struct Cli { #[derive(clap::Parser, std::fmt::Debug)] pub enum Mode { #[command(visible_alias = "r", about = "Reset both pixels and brightness")] - Reset { - #[arg(short, long, help = "hard reset screen")] - force: bool, - }, + ResetEverything, #[command(visible_alias = "p")] Pixels { #[clap(subcommand)] @@ -74,16 +71,6 @@ pub enum PixelCommand { #[command(flatten)] image_processing_options: ImageProcessingOptions, }, - #[command( - visible_alias = "v", - about = "Stream a video file (e.g. mp4) to the display." - )] - Video { - #[command(flatten)] - send_image_options: SendImageOptions, - #[command(flatten)] - image_processing_options: ImageProcessingOptions, - }, #[command( visible_alias = "s", about = "Stream the default screen capture source to the display. \ @@ -117,7 +104,7 @@ pub enum BrightnessCommand { } #[derive(clap::ValueEnum, Clone, Debug)] -pub enum TransportType { +pub enum Protocol { Udp, WebSocket, Fake, @@ -127,7 +114,7 @@ pub enum TransportType { #[clap(about = "Commands for sending text to the screen")] pub enum TextCommand { #[command( - about = "Pipe text to the display, example: `journalctl | servicepoint-cli text stdin`" + about = "Pipe text to the display, example: `journalctl | servicepoint-cli stream stdin`" )] Stdin { #[arg( diff --git a/src/image_processing.rs b/src/image_processing.rs index 6e27cde..4e6baa8 100644 --- a/src/image_processing.rs +++ b/src/image_processing.rs @@ -35,7 +35,6 @@ impl ImageProcessingPipeline { } } - #[must_use] pub fn process(&mut self, frame: DynamicImage) -> Bitmap { let start_time = Instant::now(); @@ -101,7 +100,7 @@ impl ImageProcessingPipeline { let result = if self.options.no_dither { let cutoff = median_brightness(&orig); let bits = orig.iter().map(move |x| x > &cutoff).collect(); - Bitmap::from_bitvec(orig.width() as usize, bits).unwrap() + Bitmap::from_bitvec(orig.width() as usize, bits) } else { ostromoukhov_dither(orig, u8::MAX / 2) }; @@ -114,7 +113,7 @@ impl ImageProcessingPipeline { let width = source.width(); let result_height = Self::calc_height_without_spacers(source.height()); - let mut result = Bitmap::new(width, result_height).unwrap(); + let mut result = Bitmap::new(width, result_height); let mut source_y = 0; for result_y in 0..result_height { diff --git a/src/ledwand_dither.rs b/src/ledwand_dither.rs index c1caed4..d0e4b43 100644 --- a/src/ledwand_dither.rs +++ b/src/ledwand_dither.rs @@ -1,8 +1,7 @@ //! Based on https://github.com/WarkerAnhaltRanger/CCCB_Ledwand use image::GrayImage; -use log::debug; -use servicepoint::{Bitmap, DisplayBitVec, PIXEL_HEIGHT}; +use servicepoint::{BitVec, Bitmap, PIXEL_HEIGHT}; type GrayHistogram = [usize; 256]; @@ -170,11 +169,10 @@ pub(crate) fn ostromoukhov_dither(source: GrayImage, bias: u8) -> Bitmap { assert_eq!(width % 8, 0); let mut source = source.into_raw(); - let mut destination = DisplayBitVec::repeat(false, source.len()); + let mut destination = BitVec::repeat(false, source.len()); for y in 0..height as usize { let start = y * width as usize; - let last_row = y == (height - 1) as usize; if y % 2 == 0 { for x in start..start + width as usize { ostromoukhov_dither_pixel( @@ -182,7 +180,7 @@ pub(crate) fn ostromoukhov_dither(source: GrayImage, bias: u8) -> Bitmap { &mut destination, x, width as usize, - last_row, + y == (height - 1) as usize, 1, bias, ); @@ -194,7 +192,7 @@ pub(crate) fn ostromoukhov_dither(source: GrayImage, bias: u8) -> Bitmap { &mut destination, x, width as usize, - last_row, + y == (height - 1) as usize, -1, bias, ); @@ -202,13 +200,13 @@ pub(crate) fn ostromoukhov_dither(source: GrayImage, bias: u8) -> Bitmap { } } - Bitmap::from_bitvec(width as usize, destination).unwrap() + Bitmap::from_bitvec(width as usize, destination) } #[inline] fn ostromoukhov_dither_pixel( source: &mut [u8], - destination: &mut DisplayBitVec, + destination: &mut BitVec, position: usize, width: usize, last_row: bool, @@ -219,16 +217,8 @@ fn ostromoukhov_dither_pixel( destination.set(position, destination_value); let mut diffuse = |to: usize, mat: i16| { - match source.get(to) { - None => { - // last row has a out of bounds error on the last pixel - // TODO fix the iter bounds instead of ignoring here - } - Some(val) => { - let diffuse_value = *val as i16 + mat; - source[to] = diffuse_value.clamp(u8::MIN.into(), u8::MAX.into()) as u8; - } - }; + let diffuse_value = source[to] as i16 + mat; + source[to] = diffuse_value.clamp(u8::MIN.into(), u8::MAX.into()) as u8; }; let lookup = if destination_value { @@ -239,14 +229,11 @@ fn ostromoukhov_dither_pixel( diffuse((position as isize + direction) as usize, lookup[0]); if !last_row { - debug!("begin"); diffuse( ((position + width) as isize - direction) as usize, lookup[1], ); - debug!("mit"); diffuse(((position + width) as isize) as usize, lookup[2]); - debug!("end"); } } diff --git a/src/main.rs b/src/main.rs index cdae13c..4ca1df4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,12 @@ use crate::{ brightness::{brightness, brightness_set}, - cli::{Cli, Mode}, + cli::{Cli, Mode, Protocol}, pixels::{pixels, pixels_off}, - text::text, - transport::Transport, + text::text }; use clap::Parser; use log::debug; -use servicepoint::{Brightness, HardResetCommand}; +use servicepoint::{Brightness, Connection}; mod brightness; mod cli; @@ -17,32 +16,40 @@ mod pixels; mod stream_stdin; mod stream_window; mod text; -mod transport; fn main() { let cli = Cli::parse(); init_logging(cli.verbose); debug!("running with arguments: {:?}", cli); - let transport = Transport::connect(cli.transport, &cli.destination); - debug!("connection established: {:#?}", transport); + let connection = make_connection(cli.destination, cli.transport); + debug!("connection established: {:#?}", connection); - execute_mode(cli.command, transport); + execute_mode(cli.command, connection); } -pub fn execute_mode(mode: Mode, connection: Transport) { +pub fn execute_mode(mode: Mode, connection: Connection) { match mode { - Mode::Reset { force } => { - if force { - connection.send_command(HardResetCommand).unwrap() - } else { - brightness_set(&connection, Brightness::MAX); - pixels_off(&connection); - } + Mode::ResetEverything => { + brightness_set(&connection, Brightness::MAX); + pixels_off(&connection); } Mode::Pixels { pixel_command } => pixels(&connection, pixel_command), Mode::Brightness { brightness_command } => brightness(&connection, brightness_command), - Mode::Text { text_command } => text(&connection, text_command), + Mode::Text { text_command} => text(&connection, text_command), + } +} + +fn make_connection(destination: String, transport: Protocol) -> Connection { + match transport { + Protocol::Udp => Connection::open(destination).expect("Failed to open UDP connection"), + Protocol::WebSocket => { + let url = destination.parse().expect( + "provided destination is not a valid url - make sure it starts with 'ws://'", + ); + Connection::open_websocket(url).expect("Failed to open WebSocket connection") + } + Protocol::Fake => Connection::Fake, } } diff --git a/src/pixels.rs b/src/pixels.rs index 3f9665d..da1aa6d 100644 --- a/src/pixels.rs +++ b/src/pixels.rs @@ -1,18 +1,12 @@ use crate::{ - cli::{ImageProcessingOptions, PixelCommand, SendImageOptions}, image_processing::ImageProcessingPipeline, - stream_window::stream_window, - transport::Transport, + cli::{ImageProcessingOptions, PixelCommand, SendImageOptions}, + stream_window::stream_window }; -use ffmpeg_next as ffmpeg; -use image::{DynamicImage, RgbImage}; use log::info; -use servicepoint::{ - BinaryOperation, BitVecCommand, BitmapCommand, ClearCommand, CompressionCode, DisplayBitVec, - Origin, PIXEL_COUNT, -}; +use servicepoint::{BitVec, Command, CompressionCode, Connection, Origin, PIXEL_COUNT}; -pub(crate) fn pixels(connection: &Transport, pixel_command: PixelCommand) { +pub(crate) fn pixels(connection: &Connection, pixel_command: PixelCommand) { match pixel_command { PixelCommand::Off => pixels_off(connection), PixelCommand::Flip => pixels_invert(connection), @@ -25,50 +19,34 @@ pub(crate) fn pixels(connection: &Transport, pixel_command: PixelCommand) { stream_options, image_processing, } => stream_window(connection, stream_options, image_processing), - PixelCommand::Video { - image_processing_options: processing_options, - send_image_options: image_options, - } => pixels_video(connection, image_options, processing_options), } } -fn pixels_on(connection: &Transport) { - let mask = DisplayBitVec::repeat(true, PIXEL_COUNT); - let command = BitVecCommand { - offset: 0, - bitvec: mask, - compression: CompressionCode::Lzma, - operation: BinaryOperation::Overwrite, - }; +fn pixels_on(connection: &Connection) { + let mask = BitVec::repeat(true, PIXEL_COUNT); connection - .send_command(command) + .send(Command::BitmapLinear(0, mask, CompressionCode::Lzma)) .expect("could not send command"); info!("turned on all pixels") } -fn pixels_invert(connection: &Transport) { - let mask = DisplayBitVec::repeat(true, PIXEL_COUNT); - let command = BitVecCommand { - offset: 0, - bitvec: mask, - compression: CompressionCode::Lzma, - operation: BinaryOperation::Xor, - }; +fn pixels_invert(connection: &Connection) { + let mask = BitVec::repeat(true, PIXEL_COUNT); connection - .send_command(command) + .send(Command::BitmapLinearXor(0, mask, CompressionCode::Lzma)) .expect("could not send command"); info!("inverted all pixels"); } -pub(crate) fn pixels_off(connection: &Transport) { +pub(crate) fn pixels_off(connection: &Connection) { connection - .send_command(ClearCommand) + .send(Command::Clear) .expect("failed to clear pixels"); info!("reset pixels"); } fn pixels_image( - connection: &Transport, + connection: &Connection, options: SendImageOptions, processing_options: ImageProcessingOptions, ) { @@ -76,82 +54,11 @@ fn pixels_image( let mut pipeline = ImageProcessingPipeline::new(processing_options); let bitmap = pipeline.process(image); connection - .send_command(BitmapCommand { - origin: Origin::ZERO, + .send(Command::BitmapLinearWin( + Origin::ZERO, bitmap, - compression: CompressionCode::default(), - }) + CompressionCode::default(), + )) .expect("failed to send image command"); info!("sent image to display"); } - -fn pixels_video( - connection: &Transport, - options: SendImageOptions, - processing_options: ImageProcessingOptions, -) { - ffmpeg::init().unwrap(); - - let mut ictx = ffmpeg::format::input(&options.file_name).expect("failed to open video input file"); - - let input = ictx - .streams() - .best(ffmpeg::media::Type::Video) - .ok_or(ffmpeg::Error::StreamNotFound) - .expect("could not get video stream from input file"); - let video_stream_index = input.index(); - - let context_decoder = ffmpeg::codec::context::Context::from_parameters(input.parameters()) - .expect("could not extract video context from parameters"); - let mut decoder = context_decoder.decoder().video() - .expect("failed to create decoder for video stream"); - - let src_width = decoder.width(); - let src_height = decoder.height(); - - let mut scaler = ffmpeg::software::scaling::Context::get( - decoder.format(), - src_width, - src_height, - ffmpeg::format::Pixel::RGB24, - src_width, - src_height, - ffmpeg::software::scaling::Flags::BILINEAR, - ).expect("failed to create scaling context"); - - let mut frame_index = 0; - - let mut processing_pipeline = ImageProcessingPipeline::new(processing_options); - - let mut receive_and_process_decoded_frames = - |decoder: &mut ffmpeg::decoder::Video| -> Result<(), ffmpeg::Error> { - let mut decoded = ffmpeg::util::frame::video::Video::empty(); - let mut rgb_frame = ffmpeg::util::frame::video::Video::empty(); - while decoder.receive_frame(&mut decoded).is_ok() { - scaler.run(&decoded, &mut rgb_frame) - .expect("failed to scale frame"); - - let image = RgbImage::from_raw(src_width, src_height, rgb_frame.data(0).to_owned()) - .expect("could not read rgb data to image"); - let image = DynamicImage::from(image); - let bitmap= processing_pipeline.process(image); - connection.send_command(BitmapCommand::from(bitmap)) - .expect("failed to send image command"); - - frame_index += 1; - } - Ok(()) - }; - - for (stream, packet) in ictx.packets() { - if stream.index() == video_stream_index { - decoder.send_packet(&packet) - .expect("failed to send video packet"); - receive_and_process_decoded_frames(&mut decoder) - .expect("failed to process video packet"); - } - } - decoder.send_eof().expect("failed to send eof"); - receive_and_process_decoded_frames(&mut decoder) - .expect("failed to eof packet"); -} diff --git a/src/stream_stdin.rs b/src/stream_stdin.rs index 872461c..b8b6cfb 100644 --- a/src/stream_stdin.rs +++ b/src/stream_stdin.rs @@ -1,9 +1,8 @@ -use crate::transport::Transport; use log::warn; use servicepoint::*; use std::thread::sleep; -pub(crate) fn stream_stdin(connection: &Transport, slow: bool) { +pub(crate) fn stream_stdin(connection: &Connection, slow: bool) { warn!("This mode will break when using multi-byte characters and does not support ANSI escape sequences yet."); let mut app = App { connection, @@ -15,7 +14,7 @@ pub(crate) fn stream_stdin(connection: &Transport, slow: bool) { } struct App<'t> { - connection: &'t Transport, + connection: &'t Connection, mirror: CharGrid, y: usize, slow: bool, @@ -24,7 +23,7 @@ struct App<'t> { impl App<'_> { fn run(&mut self) { self.connection - .send_command(ClearCommand) + .send(Command::Clear) .expect("couldn't clear screen"); let last_y = self.mirror.height() - 1; for line in std::io::stdin().lines() { @@ -64,10 +63,10 @@ impl App<'_> { fn send_mirror(&self) { self.connection - .send_command(CharGridCommand { - origin: Origin::ZERO, - grid: self.mirror.clone(), - }) + .send(Command::Utf8Data( + Origin::ZERO, + self.mirror.clone(), + )) .expect("couldn't send screen to display"); } @@ -77,10 +76,7 @@ impl App<'_> { Self::line_onto_grid(&mut line_grid, 0, line); Self::line_onto_grid(&mut self.mirror, self.y, line); self.connection - .send_command(CharGridCommand { - origin: Origin::new(0, self.y), - grid: line_grid, - }) + .send(Command::Utf8Data(Origin::new(0, self.y), line_grid)) .expect("couldn't send single line to screen"); } } diff --git a/src/stream_window.rs b/src/stream_window.rs index ffbc717..f8e41ec 100644 --- a/src/stream_window.rs +++ b/src/stream_window.rs @@ -1,7 +1,6 @@ use crate::{ cli::{ImageProcessingOptions, StreamScreenOptions}, image_processing::ImageProcessingPipeline, - transport::Transport, }; use image::{DynamicImage, ImageBuffer, Rgb, Rgba}; use log::{debug, error, info, trace, warn}; @@ -10,11 +9,11 @@ use scap::{ frame::convert_bgra_to_rgb, frame::Frame, }; -use servicepoint::{BitmapCommand, CompressionCode, Origin, FRAME_PACING}; +use servicepoint::{Command, CompressionCode, Connection, Origin, FRAME_PACING}; use std::time::{Duration, Instant}; pub fn stream_window( - connection: &Transport, + connection: &Connection, options: StreamScreenOptions, processing_options: ImageProcessingOptions, ) { @@ -37,11 +36,11 @@ pub fn stream_window( trace!("bitmap ready to send in: {:?}", start.elapsed()); connection - .send_command(BitmapCommand { - origin: Origin::ZERO, - bitmap: bitmap.clone(), - compression: CompressionCode::default(), - }) + .send(Command::BitmapLinearWin( + Origin::ZERO, + bitmap.clone(), + CompressionCode::default(), + )) .expect("failed to send frame to display"); debug!("frame time: {:?}", start.elapsed()); diff --git a/src/text.rs b/src/text.rs index b5fbd4c..247b9ad 100644 --- a/src/text.rs +++ b/src/text.rs @@ -1,7 +1,7 @@ -use crate::{cli::TextCommand, stream_stdin::stream_stdin, transport::Transport}; +use servicepoint::Connection; +use crate::cli::TextCommand; +use crate::stream_stdin::stream_stdin; -pub fn text(connection: &Transport, command: TextCommand) { - match command { - TextCommand::Stdin { slow } => stream_stdin(connection, slow), - } +pub fn text(connection: &Connection, command: TextCommand) { + match command { TextCommand::Stdin { slow } => stream_stdin(connection, slow), } } diff --git a/src/transport.rs b/src/transport.rs deleted file mode 100644 index 03c651a..0000000 --- a/src/transport.rs +++ /dev/null @@ -1,51 +0,0 @@ -use crate::cli::TransportType; -use servicepoint::{FakeConnection, Packet, UdpSocketExt}; -use std::fmt::Debug; -use std::net::{TcpStream, UdpSocket}; -use std::sync::Mutex; -use tungstenite::client::IntoClientRequest; -use tungstenite::stream::MaybeTlsStream; -use tungstenite::{ClientRequestBuilder, WebSocket}; - -#[derive(Debug)] -pub enum Transport { - Fake, - Udp(UdpSocket), - WebSocket(Mutex>>), -} - -impl Transport { - pub fn connect(kind: TransportType, destination: &str) -> Transport { - match kind { - TransportType::Udp => { - Self::Udp(UdpSocket::bind_connect(destination).expect("failed to bind socket")) - } - TransportType::WebSocket => { - let request = ClientRequestBuilder::new( - destination.parse().expect("Invalid destination url"), - ) - .into_client_request() - .unwrap(); - let (sock, _) = - tungstenite::connect(request).expect("failed to connect to websocket"); - Self::WebSocket(Mutex::new(sock)) - } - TransportType::Fake => Self::Fake, - } - } - - pub(crate) fn send_command>(&self, command: T) -> Option<()> - where - >::Error: Debug, - { - match self { - Self::Udp(socket) => socket.send_command(command), - Self::WebSocket(socket) => { - let bytes: Vec = command.try_into().unwrap().into(); - let mut socket = socket.lock().unwrap(); - socket.send(tungstenite::Message::Binary(bytes.into())).ok() - } - Self::Fake => FakeConnection.send_command(command), - } - } -}