diff --git a/Cargo.lock b/Cargo.lock index 7cfa546ae..36408c9b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,6 +39,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" + [[package]] name = "allocator-api2" version = "0.2.18" @@ -62,9 +68,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -77,43 +83,49 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" + +[[package]] +name = "arbitrary" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" [[package]] name = "arc-swap" @@ -121,6 +133,17 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -180,7 +203,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -191,7 +214,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -206,6 +229,20 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "av1-grain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + [[package]] name = "aws-config" version = "1.5.8" @@ -303,9 +340,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.56.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecd672c8d4265fd4fbecacd4a479180e616881bbe639250cf81ddb604e4c301" +checksum = "8888c238bf93c77c5df8274b3999fd7fc1bb3fb658616f40dfde9e4fcd9efd94" dependencies = [ "ahash", "aws-credential-types", @@ -445,9 +482,9 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.12" +version = "0.60.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" +checksum = "ba1a71073fca26775c8b5189175ea8863afb1c9ea2cceb02a5de5ad9dfbaa795" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -517,9 +554,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.2" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" +checksum = "be28bd063fa91fd871d131fc8b68d7cd4c5fa0869bea68daca50dcb1cbd76be2" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -532,7 +569,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", @@ -561,9 +598,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.7" +version = "1.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" +checksum = "07c9cdc179e6afbf5d391ab08c85eac817b51c87e1892a5edb5f7bbdc64314b4" dependencies = [ "base64-simd", "bytes", @@ -621,7 +658,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "itoa", "matchit", @@ -737,7 +774,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.79", + "syn 2.0.85", "which", ] @@ -756,7 +793,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -771,6 +808,12 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bitstream-io" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81e1519b0d82120d2fd469d5bfb2919a9361c48b02d82d04befc1cdd2002452" + [[package]] name = "bitvec" version = "1.0.1" @@ -814,6 +857,12 @@ dependencies = [ "uuid", ] +[[package]] +name = "built" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" + [[package]] name = "bumpalo" version = "3.16.0" @@ -822,9 +871,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "byteorder" @@ -834,9 +883,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -853,9 +902,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.29" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e804ac3194a48bb129643eb1d62fcc20d18c6b8c181704489353d13120bcd1" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -877,6 +926,16 @@ dependencies = [ "nom", ] +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -947,9 +1006,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "combine" @@ -1150,7 +1209,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1174,7 +1233,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1185,7 +1244,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1255,7 +1314,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1359,7 +1418,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1387,12 +1446,12 @@ dependencies = [ "h3 0.0.6", "h3-quinn", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "opentelemetry", "quinn", "rand", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pemfile 2.2.0", "scuffle-foundations", "socket2", @@ -1524,9 +1583,9 @@ dependencies = [ [[package]] name = "fred" -version = "9.2.1" +version = "9.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1caa4f052f1ee1b987c2089e0524aeb9a0e33cd7be0a184667aca2e4cbf17579" +checksum = "0ac76d6e24da83723c1d118a1d3b794d883eec94715eeaa611698558d5547048" dependencies = [ "arc-swap", "async-trait", @@ -1557,7 +1616,7 @@ checksum = "1458c6e22d36d61507034d5afecc64f105c1d39712b7ac6ec3b352c423f715cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1628,7 +1687,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2044,9 +2103,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -2068,9 +2127,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -2095,7 +2154,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -2111,9 +2170,9 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -2127,7 +2186,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -2145,7 +2204,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", @@ -2217,9 +2276,9 @@ dependencies = [ [[package]] name = "imgref" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" +checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" [[package]] name = "indexmap" @@ -2243,6 +2302,17 @@ dependencies = [ "serde", ] +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "ipconfig" version = "0.3.2" @@ -2342,30 +2412,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] -name = "libaom-sys" -version = "0.17.0+libaom.3.9.1" +name = "libavif-sys" +version = "0.17.0+libavif.1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cba7f0c21a491ce72470f31026d2cd8ddda1032fb09b69ef61b8a9076b6a184f" +checksum = "490ca74b61e773140bebb086c81facb23273a99364a9ab0c92ab1532b90ade35" dependencies = [ "cmake", + "libc", + "libdav1d-sys", + "rav1e", ] [[package]] -name = "libavif-sys" -version = "0.17.0+libavif.1.0.4" +name = "libc" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490ca74b61e773140bebb086c81facb23273a99364a9ab0c92ab1532b90ade35" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" + +[[package]] +name = "libdav1d-sys" +version = "0.7.1+libdav1d.1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d875e9669d116a603412a126de599b7bf47789a365b79fcf461fbf9c18d141f" dependencies = [ - "cmake", - "libaom-sys", "libc", ] [[package]] -name = "libc" -version = "0.2.159" +name = "libfuzzer-sys" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" +dependencies = [ + "arbitrary", + "cc", + "once_cell", +] [[package]] name = "libloading" @@ -2484,6 +2566,15 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", +] + [[package]] name = "md-5" version = "0.10.6" @@ -2517,9 +2608,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minijinja" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1028b628753a7e1a88fc59c9ba4b02ecc3bc0bd3c7af23df667bc28df9b3310e" +checksum = "c9ca8daf4b0b4029777f1bc6e1aedd1aec7b74c276a43bc6f620a8e1a1c0a90e" dependencies = [ "aho-corasick", "percent-encoding", @@ -2617,7 +2708,7 @@ checksum = "3a6dbc533e93429a71c44a14c04547ac783b56d3f22e6c4f12b1b994cf93844e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2626,12 +2717,27 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +[[package]] +name = "nasm-rs" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4d98d0065f4b1daf164b3eafb11974c94662e5e2396cf03f32d0bb5c17da51" +dependencies = [ + "rayon", +] + [[package]] name = "natord" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308d96db8debc727c3fd9744aac51751243420e46edf401010908da7f8d5e57c" +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + [[package]] name = "nix" version = "0.26.4" @@ -2668,6 +2774,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -2703,6 +2815,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -2712,6 +2835,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -2958,29 +3092,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -3074,23 +3208,42 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" +dependencies = [ + "quote", + "syn 2.0.85", +] + [[package]] name = "prometheus-client" version = "0.22.3" @@ -3111,7 +3264,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3151,7 +3304,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.79", + "syn 2.0.85", "tempfile", ] @@ -3172,7 +3325,7 @@ dependencies = [ "prost 0.13.3", "prost-types 0.13.3", "regex", - "syn 2.0.79", + "syn 2.0.85", "tempfile", ] @@ -3186,7 +3339,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3199,7 +3352,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3244,7 +3397,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.14", + "rustls 0.23.15", "socket2", "thiserror", "tokio", @@ -3261,7 +3414,7 @@ dependencies = [ "rand", "ring", "rustc-hash 2.0.0", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-platform-verifier", "slab", "thiserror", @@ -3327,6 +3480,43 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rav1e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cc", + "cfg-if", + "interpolate_name", + "itertools 0.12.1", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "nasm-rs", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand", + "rand_chacha", + "scan_fmt", + "simd_helpers", + "system-deps", + "thiserror", + "v_frame", +] + [[package]] name = "rayon" version = "1.10.0" @@ -3372,9 +3562,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -3418,7 +3608,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-util", "ipnet", @@ -3429,7 +3619,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", @@ -3566,9 +3756,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "aws-lc-rs", "log", @@ -3625,9 +3815,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-platform-verifier" @@ -3640,7 +3830,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -3680,9 +3870,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -3699,11 +3889,17 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scan_fmt" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b53b0a5db882a8e2fdaae0a43f7b39e7e9082389e978398bdf223a55b581248" + [[package]] name = "scc" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "553f8299af7450cda9a52d3a370199904e7a46b5ffd1bef187c4a6af3bb6db69" +checksum = "f2c1f7fc6deb21665a9060dfc7d271be784669295a31babdcd4dd2c79ae8cbfb" dependencies = [ "sdd", ] @@ -3737,6 +3933,7 @@ dependencies = [ name = "scuffle-ffmpeg" version = "0.1.0" dependencies = [ + "arc-swap", "bytes", "crossbeam-channel", "ffmpeg-sys-next", @@ -3763,7 +3960,7 @@ dependencies = [ "http-body 1.0.1", "humantime", "humantime-serde", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "itertools 0.13.0", "matchers", @@ -3781,7 +3978,7 @@ dependencies = [ "quinn", "rand", "regex", - "rustls 0.23.14", + "rustls 0.23.15", "scc", "scuffle-foundations-macros", "serde", @@ -3806,7 +4003,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3921,9 +4118,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] @@ -3939,20 +4136,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "indexmap 2.6.0", "itoa", @@ -3988,7 +4185,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4039,7 +4236,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4137,6 +4334,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + [[package]] name = "slab" version = "0.4.9" @@ -4262,9 +4468,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -4286,6 +4492,19 @@ dependencies = [ "futures-core", ] +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", +] + [[package]] name = "take_mut" version = "0.2.2" @@ -4298,6 +4517,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + [[package]] name = "tempfile" version = "3.13.0" @@ -4313,22 +4538,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4389,9 +4614,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -4413,7 +4638,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4432,7 +4657,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] @@ -4511,7 +4736,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-timeout", "hyper-util", "percent-encoding", @@ -4537,7 +4762,7 @@ dependencies = [ "prost-build 0.13.3", "prost-types 0.13.3", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4608,7 +4833,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4759,14 +4984,25 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "serde", ] +[[package]] +name = "v_frame" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + [[package]] name = "valuable" version = "0.1.0" @@ -4779,6 +5015,12 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + [[package]] name = "version_check" version = "0.9.5" @@ -4838,7 +5080,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -4872,7 +5114,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5201,9 +5443,9 @@ checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" [[package]] name = "yuv" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c028614bf7ce7a9cb9b07ea3b0f4705c303e27afc5b5fd2948766a5bd2cc66b0" +checksum = "8cbe2d856acbe6d86c0fa6f458b73e962834061ca2f7f94c6e4633afc9efd4d4" dependencies = [ "num-traits", "rgb", @@ -5227,7 +5469,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] diff --git a/ffmpeg/Cargo.toml b/ffmpeg/Cargo.toml index 7fd53411d..a861881a8 100644 --- a/ffmpeg/Cargo.toml +++ b/ffmpeg/Cargo.toml @@ -11,6 +11,7 @@ bytes = { optional = true, version = "1" } tokio = { optional = true, version = "1" } crossbeam-channel = { optional = true, version = "0.5" } tracing = { optional = true, version = "0.1" } +arc-swap = { version = "1.7.1" } [features] default = [] diff --git a/ffmpeg/src/codec.rs b/ffmpeg/src/codec.rs index 1955c33a5..fae1dbebd 100644 --- a/ffmpeg/src/codec.rs +++ b/ffmpeg/src/codec.rs @@ -8,7 +8,7 @@ impl std::fmt::Debug for DecoderCodec { if self.0.is_null() { return f .debug_struct("DecoderCodec") - .field("name", &std::ffi::CStr::from_bytes_with_nul(b"null\0").unwrap()) + .field("name", &c"null") .field("id", &AVCodecID::AV_CODEC_ID_NONE) .finish(); } @@ -67,7 +67,7 @@ impl std::fmt::Debug for EncoderCodec { if self.0.is_null() { return f .debug_struct("EncoderCodec") - .field("name", &std::ffi::CStr::from_bytes_with_nul(b"null\0").unwrap()) + .field("name", &c"null") .field("id", &AVCodecID::AV_CODEC_ID_NONE) .finish(); } diff --git a/ffmpeg/src/consts.rs b/ffmpeg/src/consts.rs index e0484e1f4..310472543 100644 --- a/ffmpeg/src/consts.rs +++ b/ffmpeg/src/consts.rs @@ -9,7 +9,7 @@ impl std::fmt::Debug for Const<'_, T> { } } -impl<'a, T> Const<'a, T> { +impl Const<'_, T> { pub(crate) fn new(value: T) -> Self { Self(value, std::marker::PhantomData) } @@ -32,7 +32,7 @@ impl std::fmt::Debug for MutConst<'_, T> { } } -impl<'a, T> MutConst<'a, T> { +impl MutConst<'_, T> { pub(crate) fn new(value: T) -> Self { Self(value, std::marker::PhantomData) } diff --git a/ffmpeg/src/log.rs b/ffmpeg/src/log.rs index 07b8d0692..8b392420f 100644 --- a/ffmpeg/src/log.rs +++ b/ffmpeg/src/log.rs @@ -1,6 +1,7 @@ use std::ffi::CStr; -use std::sync::RwLock; +use std::sync::Arc; +use arc_swap::ArcSwap; use ffmpeg_sys_next::*; #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -20,15 +21,15 @@ pub enum LogLevel { impl LogLevel { pub const fn from_i32(value: i32) -> Self { match value { - AV_LOG_QUIET => Self::Quiet, - AV_LOG_PANIC => Self::Panic, - AV_LOG_FATAL => Self::Fatal, - AV_LOG_ERROR => Self::Error, - AV_LOG_WARNING => Self::Warning, - AV_LOG_INFO => Self::Info, - AV_LOG_VERBOSE => Self::Verbose, - AV_LOG_DEBUG => Self::Debug, - AV_LOG_TRACE => Self::Trace, + -8 => Self::Quiet, + 0 => Self::Panic, + 8 => Self::Fatal, + 16 => Self::Error, + 24 => Self::Warning, + 32 => Self::Info, + 40 => Self::Verbose, + 48 => Self::Debug, + 56 => Self::Trace, _ => Self::Info, } } @@ -54,9 +55,9 @@ pub fn set_log_level(level: LogLevel) { } } -pub fn log_callback_set, String) + 'static>(callback: F) { - type Function = Box, String)>; - static mut LOG_CALLBACK: RwLock> = RwLock::new(None); +pub fn log_callback_set, String) + Send + Sync + 'static>(callback: F) { + type Function = Box, String) + Send + Sync>; + static LOG_CALLBACK: std::sync::OnceLock>> = std::sync::OnceLock::new(); unsafe extern "C" fn log_cb( ptr: *mut libc::c_void, @@ -80,11 +81,17 @@ pub fn log_callback_set, String) + 'static>(callb let msg = CStr::from_ptr(buf.as_ptr() as *const i8).to_string_lossy().trim().to_owned(); - (LOG_CALLBACK.read().unwrap().as_deref().unwrap())(level, class, msg) + if let Some(cb) = LOG_CALLBACK.get() { + if let Some(cb) = cb.load().as_ref() { + cb(level, class, msg); + } + } } unsafe { - *LOG_CALLBACK.write().unwrap() = Some(Box::new(callback)); + LOG_CALLBACK + .get_or_init(|| ArcSwap::new(Arc::new(None))) + .store(Arc::new(Some(Box::new(callback)))); av_log_set_callback(Some(log_cb)); } } diff --git a/ffmpeg/src/stream.rs b/ffmpeg/src/stream.rs index 130c2b61f..15569a3dc 100644 --- a/ffmpeg/src/stream.rs +++ b/ffmpeg/src/stream.rs @@ -100,7 +100,7 @@ impl<'a> Iterator for StreamIter<'a> { } } -impl<'a> std::iter::ExactSizeIterator for StreamIter<'a> {} +impl std::iter::ExactSizeIterator for StreamIter<'_> {} pub struct Stream<'a>(&'a mut AVStream, &'a AVFormatContext); diff --git a/foundations/examples/src/http-server.rs b/foundations/examples/src/http-server.rs index 5a36cd82d..eefe8b8c9 100644 --- a/foundations/examples/src/http-server.rs +++ b/foundations/examples/src/http-server.rs @@ -91,12 +91,14 @@ async fn main(settings: Matches) { struct NoTlsService; impl ServiceHandler for NormalService { - async fn on_request(&self, _: Request) -> Response { - Response::builder() - .status(StatusCode::OK) - .header("Alt-Svc", "h3=\":18080\"; ma=2592000") - .body("Hello, World!".into()) - .unwrap() + fn on_request(&self, _: Request) -> impl std::future::Future + Send { + std::future::ready( + Response::builder() + .status(StatusCode::OK) + .header("Alt-Svc", "h3=\":18080\"; ma=2592000") + .body(axum::body::Body::from("Hello, World!")) + .unwrap(), + ) } } @@ -144,11 +146,14 @@ async fn main(settings: Matches) { } impl MakeService for ServiceFactory { - async fn make_service(&self, incoming: &impl IncomingConnection) -> Option { + fn make_service( + &self, + incoming: &impl IncomingConnection, + ) -> impl std::future::Future> + Send { if incoming.socket_kind() == SocketKind::Tcp { - Some(AnyService::NoTls(NoTlsService)) + std::future::ready(Some(AnyService::NoTls(NoTlsService))) } else { - Some(AnyService::Normal(NormalService)) + std::future::ready(Some(AnyService::Normal(NormalService))) } } } diff --git a/foundations/macros/src/settings/types/enum_ty.rs b/foundations/macros/src/settings/types/enum_ty.rs index 9f5e61405..fe98d6483 100644 --- a/foundations/macros/src/settings/types/enum_ty.rs +++ b/foundations/macros/src/settings/types/enum_ty.rs @@ -203,8 +203,6 @@ pub struct EnumArgs { impl Args for EnumArgs { fn apply_meta(&mut self, meta: &Meta) -> syn::Result { - match meta { - meta => self.global.apply_meta(meta), - } + self.global.apply_meta(meta) } } diff --git a/foundations/macros/src/settings/types/serde.rs b/foundations/macros/src/settings/types/serde.rs index c58d280e0..bbd780924 100644 --- a/foundations/macros/src/settings/types/serde.rs +++ b/foundations/macros/src/settings/types/serde.rs @@ -6,14 +6,14 @@ use syn::Meta; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum RenameAll { - LowerCase, - UpperCase, - PascalCase, - CamelCase, - SnakeCase, - ScreamingSnakeCase, - KebabCase, - ScreamingKebabCase, + Lower, + Upper, + Pascal, + Camel, + Snake, + ScreamingSnake, + Kebab, + ScreamingKebab, } impl FromStr for RenameAll { @@ -21,14 +21,14 @@ impl FromStr for RenameAll { fn from_str(s: &str) -> Result { match s { - "lowercase" => Ok(Self::LowerCase), - "UPPERCASE" => Ok(Self::UpperCase), - "PascalCase" => Ok(Self::PascalCase), - "camelCase" => Ok(Self::CamelCase), - "snake_case" => Ok(Self::SnakeCase), - "SCREAMING_SNAKE_CASE" => Ok(Self::ScreamingSnakeCase), - "kebab-case" => Ok(Self::KebabCase), - "SCREAMING-KEBAB-CASE" => Ok(Self::ScreamingKebabCase), + "lowercase" => Ok(Self::Lower), + "UPPERCASE" => Ok(Self::Upper), + "PascalCase" => Ok(Self::Pascal), + "camelCase" => Ok(Self::Camel), + "snake_case" => Ok(Self::Snake), + "SCREAMING_SNAKE_CASE" => Ok(Self::ScreamingSnake), + "kebab-case" => Ok(Self::Kebab), + "SCREAMING-KEBAB-CASE" => Ok(Self::ScreamingKebab), _ => Err(()), } } @@ -57,14 +57,14 @@ impl RenameAll { pub fn apply(&self, name: &str) -> String { let case = match self { - Self::LowerCase => Case::Lower, - Self::UpperCase => Case::Upper, - Self::PascalCase => Case::Pascal, - Self::CamelCase => Case::Camel, - Self::SnakeCase => Case::Snake, - Self::ScreamingSnakeCase => Case::ScreamingSnake, - Self::KebabCase => Case::Kebab, - Self::ScreamingKebabCase => Case::UpperKebab, + Self::Lower => Case::Lower, + Self::Upper => Case::Upper, + Self::Pascal => Case::Pascal, + Self::Camel => Case::Camel, + Self::Snake => Case::Snake, + Self::ScreamingSnake => Case::ScreamingSnake, + Self::Kebab => Case::Kebab, + Self::ScreamingKebab => Case::UpperKebab, }; name.to_case(case) diff --git a/foundations/macros/src/settings/types/struct_ty.rs b/foundations/macros/src/settings/types/struct_ty.rs index a150edf4c..bb1ef81b4 100644 --- a/foundations/macros/src/settings/types/struct_ty.rs +++ b/foundations/macros/src/settings/types/struct_ty.rs @@ -173,8 +173,6 @@ pub struct StructArgs { impl Args for StructArgs { fn apply_meta(&mut self, meta: &Meta) -> syn::Result { - match meta { - meta => self.global.apply_meta(meta), - } + self.global.apply_meta(meta) } } diff --git a/foundations/src/batcher/dataloader.rs b/foundations/src/batcher/dataloader.rs index 47f0e034a..8b3da0b94 100644 --- a/foundations/src/batcher/dataloader.rs +++ b/foundations/src/batcher/dataloader.rs @@ -51,14 +51,20 @@ impl + 'static + Send + Sync, S: BuildHasher + Default + Send + Syn } } + #[tracing::instrument(skip_all, fields(name = %self.batcher.inner.name))] pub async fn load(&self, key: L::Key) -> Result, ()> { - self.load_many(std::iter::once(key.clone())) + self.internal_load_many(std::iter::once(key.clone())) .await .map(|mut map| map.remove(&key)) } + #[tracing::instrument(skip_all, fields(name = %self.batcher.inner.name))] pub async fn load_many(&self, keys: impl IntoIterator) -> Result, ()> { - self.batcher.execute_many(keys).await.map_err(|err| match err { + self.internal_load_many(keys).await + } + + async fn internal_load_many(&self, keys: impl IntoIterator) -> LoaderOutput { + self.batcher.internal_execute_many(keys).await.map_err(|err| match err { BatcherError::Batch(Unit) => {} err => tracing::error!("failed to load data: {err}"), }) @@ -77,14 +83,14 @@ impl, S: BuildHasher + Default + Send + Sync> BatchOperation for Wr self.0.config() } - fn process( + async fn process( &self, documents: >::Input, - ) -> impl std::future::Future>::OperationOutput, Self::Error>> + Send + '_ + ) -> Result<>::OperationOutput, Self::Error> where Self: Send + Sync, { - async move { self.0.load(documents.into_iter().collect()).await.map_err(|()| Unit) } + self.0.load(documents.into_iter().collect()).await.map_err(|()| Unit) } } diff --git a/foundations/src/batcher/mod.rs b/foundations/src/batcher/mod.rs index 75d342b64..dd02af216 100644 --- a/foundations/src/batcher/mod.rs +++ b/foundations/src/batcher/mod.rs @@ -240,6 +240,7 @@ struct Batch { expires_at: tokio::time::Instant, done: DropGuardCancellationToken, ops: >::Input, + #[allow(clippy::type_complexity)] results: Arc>::OperationOutput, BatcherError>>>, } @@ -265,6 +266,7 @@ struct BatchInsertWaiter { id: u64, done: tokio_util::sync::CancellationToken, tracker: >::Tracker, + #[allow(clippy::type_complexity)] results: Arc>::OperationOutput, BatcherError>>>, } @@ -297,7 +299,7 @@ impl Batch { .instrument(tracing::debug_span!("Semaphore")) .await .map_err(|_| BatcherError::AcquireSemaphore)?; - Ok(inner.operation.process(self.ops).await.map_err(BatcherError::Batch)?) + inner.operation.process(self.ops).await.map_err(BatcherError::Batch) }) .await; } @@ -411,8 +413,9 @@ impl Batcher { } } + #[tracing::instrument(skip_all, fields(name = %self.inner.name))] pub async fn execute(&self, document: T::Item) -> Result> { - let output = self.execute_many(std::iter::once(document)).await; + let output = self.internal_execute_many(std::iter::once(document)).await; let iter = T::Mode::final_output_into_iter(output)?; T::Mode::output_item_to_result(iter.into_iter().next().ok_or(BatcherError::MissingResult)?) } @@ -421,6 +424,13 @@ impl Batcher { pub async fn execute_many( &self, documents: impl IntoIterator, + ) -> >::FinalOutput { + self.internal_execute_many(documents).await + } + + pub async fn internal_execute_many( + &self, + documents: impl IntoIterator, ) -> >::FinalOutput { let waiters = self.inner.batch_inserts(documents).await; diff --git a/foundations/src/context.rs b/foundations/src/context.rs index 2135a095c..f3d55b2ff 100644 --- a/foundations/src/context.rs +++ b/foundations/src/context.rs @@ -268,7 +268,7 @@ pub struct FutureWithContext<'a, F> { ctx: ContextRef<'a>, } -impl<'a, F: Future> Future for FutureWithContext<'a, F> { +impl Future for FutureWithContext<'_, F> { type Output = Option; fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll { @@ -290,7 +290,7 @@ pub struct StreamWithContext<'a, F> { ctx: ContextRef<'a>, } -impl<'a, F: Stream> Stream for StreamWithContext<'a, F> { +impl Stream for StreamWithContext<'_, F> { type Item = F::Item; fn poll_next(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll> { diff --git a/foundations/src/http/server/stream/tcp.rs b/foundations/src/http/server/stream/tcp.rs index 004948a89..e59631c5f 100644 --- a/foundations/src/http/server/stream/tcp.rs +++ b/foundations/src/http/server/stream/tcp.rs @@ -50,7 +50,7 @@ struct IncomingTcpConnection<'a> { connection: &'a TcpStream, } -impl<'a> IncomingConnection for IncomingTcpConnection<'a> { +impl IncomingConnection for IncomingTcpConnection<'_> { fn socket_kind(&self) -> SocketKind { SocketKind::Tcp } diff --git a/foundations/src/settings/mod.rs b/foundations/src/settings/mod.rs index 1d24e4105..b9cd03e5f 100644 --- a/foundations/src/settings/mod.rs +++ b/foundations/src/settings/mod.rs @@ -23,15 +23,15 @@ impl SettingsParser { fn merge(&mut self, incoming: toml::Value) { let root = self.root.take().unwrap(); - self.root = Some(self.merge_loop(root, incoming)); + self.root = Some(Self::merge_loop(root, incoming)); } - fn merge_loop(&self, root: toml::Value, incoming: toml::Value) -> toml::Value { + fn merge_loop(root: toml::Value, incoming: toml::Value) -> toml::Value { match (root, incoming) { (toml::Value::Table(mut first_map), toml::Value::Table(second_map)) => { for (key, value) in second_map { let combined_value = if let Some(existing_value) = first_map.remove(&key) { - self.merge_loop(existing_value, value) + Self::merge_loop(existing_value, value) } else { value }; diff --git a/foundations/src/telemetry/env_filter/env/field.rs b/foundations/src/telemetry/env_filter/env/field.rs index 33ddcbf54..5df635d8f 100644 --- a/foundations/src/telemetry/env_filter/env/field.rs +++ b/foundations/src/telemetry/env_filter/env/field.rs @@ -228,6 +228,7 @@ impl ValueMatch { /// This returns an error if the string didn't contain a valid `bool`, /// `u64`, `i64`, or `f64` literal, and couldn't be parsed as a regular /// expression. + #[allow(clippy::result_large_err)] fn parse_regex(s: &str) -> Result { s.parse::() .map(ValueMatch::Bool) @@ -485,7 +486,7 @@ impl SpanMatch { } } -impl<'a> Visit for MatchVisitor<'a> { +impl Visit for MatchVisitor<'_> { fn record_f64(&mut self, field: &Field, value: f64) { match self.inner.fields.get(field) { Some((ValueMatch::NaN, ref matched)) if value.is_nan() => { diff --git a/foundations/src/telemetry/mod.rs b/foundations/src/telemetry/mod.rs index 13061df1f..9a8e535ef 100644 --- a/foundations/src/telemetry/mod.rs +++ b/foundations/src/telemetry/mod.rs @@ -7,7 +7,7 @@ pub use env_filter::{EnvFilter, EnvFilterBuilder}; #[cfg(feature = "opentelemetry")] pub mod opentelemetry; -#[cfg(any(feature = "pprof-cpu"))] +#[cfg(feature = "pprof-cpu")] pub mod pprof; #[cfg(feature = "metrics")] diff --git a/foundations/src/telemetry/opentelemetry/node.rs b/foundations/src/telemetry/opentelemetry/node.rs index 2a93e83de..e4c9f1fa8 100644 --- a/foundations/src/telemetry/opentelemetry/node.rs +++ b/foundations/src/telemetry/opentelemetry/node.rs @@ -12,6 +12,7 @@ use tracing::{span, Metadata}; pub struct SpanNode { pub id: span::Id, pub status: Status, + pub name: Cow<'static, str>, pub trace_id: TraceId, pub mapped_id: SpanId, pub metadata: &'static Metadata<'static>, @@ -36,6 +37,7 @@ pub enum RootNode { #[derive(Debug, Clone)] pub struct SpanEvent { pub time: std::time::SystemTime, + pub name: Cow<'static, str>, pub metadata: &'static Metadata<'static>, pub attributes: Vec, } @@ -53,7 +55,7 @@ impl SpanEvent { } self.attributes.push(KeyValue::new("level", self.metadata.level().as_str())); - opentelemetry::trace::Event::new(self.metadata.name(), self.time, self.attributes, 0) + opentelemetry::trace::Event::new(self.name, self.time, self.attributes, 0) } } @@ -78,6 +80,7 @@ impl SpanNode { trace_id: trace_id.unwrap_or_else(gen_trace_id), mapped_id, metadata: attrs.metadata(), + name: attrs.metadata().name().into(), attributes: Vec::new(), start: Some(std::time::SystemTime::now()), end: None, @@ -90,7 +93,7 @@ impl SpanNode { root: root_child.map(RootNode::Child), }; - attrs.record(&mut FieldVisitor(&mut this.attributes)); + attrs.record(&mut FieldVisitor(&mut this.attributes, &mut this.name)); this } @@ -118,8 +121,10 @@ impl SpanNode { pub fn event(&mut self, event: &tracing::Event<'_>) { let mut attributes = Vec::new(); - event.record(&mut FieldVisitor(&mut attributes)); + let mut name = event.metadata().name().into(); + event.record(&mut FieldVisitor(&mut attributes, &mut name)); self.events.push(SpanEvent { + name, metadata: event.metadata(), time: std::time::SystemTime::now(), attributes, @@ -127,7 +132,7 @@ impl SpanNode { } pub fn record(&mut self, record: &span::Record<'_>) { - record.record(&mut FieldVisitor(&mut self.attributes)); + record.record(&mut FieldVisitor(&mut self.attributes, &mut self.name)); } pub fn follows_from(&mut self, id: SpanId, span: Option<&SpanNode>) { @@ -273,7 +278,7 @@ impl SpanNode { span.start_time = self.start.unwrap(); span.end_time = self.end.unwrap(); span.dropped_attributes_count = 0; - span.name = self.metadata.name().into(); + span.name = self.name; span.attributes = self.attributes; span.parent_span_id = self.mapped_parent_id.unwrap_or(SpanId::INVALID); span.span_context = SpanContext::new(self.trace_id, self.mapped_id, TraceFlags::SAMPLED, false, TraceState::NONE); @@ -284,7 +289,7 @@ impl SpanNode { } } -struct FieldVisitor<'a>(&'a mut Vec); +struct FieldVisitor<'a>(&'a mut Vec, &'a mut Cow<'static, str>); impl tracing::field::Visit for FieldVisitor<'_> { fn record_bool(&mut self, field: &tracing::field::Field, value: bool) { @@ -316,7 +321,11 @@ impl tracing::field::Visit for FieldVisitor<'_> { } fn record_str(&mut self, field: &tracing::field::Field, value: &str) { - self.0.push(KeyValue::new(field.name(), value.to_string())); + if field.name() == "name" { + *self.1 = format!("{}::{}", self.1, value).into(); + } else { + self.0.push(KeyValue::new(field.name(), value.to_string())); + } } fn record_u128(&mut self, field: &tracing::field::Field, value: u128) { diff --git a/image-processor/Cargo.toml b/image-processor/Cargo.toml index ad5261538..18c08f447 100644 --- a/image-processor/Cargo.toml +++ b/image-processor/Cargo.toml @@ -24,7 +24,7 @@ file-format = "0.25" scopeguard = "1.2" rgb = "0.8" imgref = "1.10" -libavif-sys = { version = "0.17.0", features = ["codec-aom"], default-features = false } +libavif-sys = { version = "0.17.0", features = ["codec-dav1d", "codec-rav1e"], default-features = false } libwebp-sys2 = { version = "0.1", features = ["1_2", "demux", "mux", "static"] } sha2 = "0.10" gifski = "1.13" diff --git a/image-processor/src/database.rs b/image-processor/src/database.rs index 8a77e731f..eecb8f746 100644 --- a/image-processor/src/database.rs +++ b/image-processor/src/database.rs @@ -39,7 +39,7 @@ mod datetime { serializer: S, ) -> Result { match value { - Some(value) => bson::DateTime::from(value.clone()).serialize(serializer), + Some(value) => bson::DateTime::from(*value).serialize(serializer), None => None::.serialize(serializer), } } diff --git a/image-processor/src/management/grpc.rs b/image-processor/src/management/grpc.rs index d3b5801e0..51fe6dd24 100644 --- a/image-processor/src/management/grpc.rs +++ b/image-processor/src/management/grpc.rs @@ -10,7 +10,7 @@ impl ManagementServer { .add_service( scuffle_image_processor_proto::image_processor_server::ImageProcessorServer::new(self.clone()) .max_decoding_message_size(128 * 1024 * 1024) - .max_encoding_message_size(128 * 1024 * 1024) + .max_encoding_message_size(128 * 1024 * 1024), ) .serve_with_shutdown(addr, scuffle_foundations::context::Context::global().into_done()); diff --git a/image-processor/src/management/validation.rs b/image-processor/src/management/validation.rs index 0acef1d1c..1e204310e 100644 --- a/image-processor/src/management/validation.rs +++ b/image-processor/src/management/validation.rs @@ -552,7 +552,7 @@ pub fn validate_input_metadata(mut fragment: Fragment, metadata: Option<&InputMe })?; match (metadata.static_frame_index, metadata.frame_count) { - (None, Some(frame_count)) if frame_count == 0 => { + (None, Some(0)) => { return Err(Error { code: ErrorCode::InvalidInput as i32, message: format!("{}: frame_count must be non 0", fragment), diff --git a/image-processor/src/worker/process/blocking.rs b/image-processor/src/worker/process/blocking.rs index c38967abd..dc1b7ca26 100644 --- a/image-processor/src/worker/process/blocking.rs +++ b/image-processor/src/worker/process/blocking.rs @@ -112,7 +112,9 @@ struct BlockingTask<'a> { loop_count: LoopCount, } -fn split_formats(output: &Output) -> (Vec<(usize, &OutputFormatOptions)>, Vec<(usize, &OutputFormatOptions)>) { +type IdxFormatOptions<'a> = (usize, &'a OutputFormatOptions); + +fn split_formats(output: &Output) -> (Vec, Vec) { output .formats .iter() @@ -173,7 +175,7 @@ impl<'a> BlockingTask<'a> { } let file_format = FileFormat::from_bytes(input); - let decoder = DecoderFrontend::from_format(file_format.clone())?.build(task, Cow::Borrowed(input))?; + let decoder = DecoderFrontend::from_format(file_format)?.build(task, Cow::Borrowed(input))?; let decoder_info = decoder.info(); diff --git a/image-processor/src/worker/process/decoder/ffmpeg.rs b/image-processor/src/worker/process/decoder/ffmpeg.rs index 4fb301dc3..b4d0716f2 100644 --- a/image-processor/src/worker/process/decoder/ffmpeg.rs +++ b/image-processor/src/worker/process/decoder/ffmpeg.rs @@ -94,6 +94,10 @@ impl<'data> FfmpegDecoder<'data> { } } + if decoder.pixel_format() == scuffle_ffmpeg::ffi::AVPixelFormat::AV_PIX_FMT_NONE { + return Err(DecoderError::MalformedInput); + } + let scaler = scuffle_ffmpeg::scalar::Scalar::new( decoder.width(), decoder.height(), @@ -168,14 +172,12 @@ impl Decoder for FfmpegDecoder<'_> { .transpose()?; if let Some(packet) = packet { - self.decoder.send_packet(&packet).map_err(|err| { + self.decoder.send_packet(&packet).inspect_err(|_| { self.done = true; - err })?; } else { - self.decoder.send_eof().map_err(|err| { + self.decoder.send_eof().inspect_err(|_| { self.done = true; - err })?; self.eof = true; } @@ -183,15 +185,13 @@ impl Decoder for FfmpegDecoder<'_> { self.send_packet = false; } - let frame = self.decoder.receive_frame().map_err(|err| { + let frame = self.decoder.receive_frame().inspect_err(|_| { self.done = true; - err })?; if let Some(frame) = frame { - let frame = self.scaler.process(&frame).map_err(|err| { + let frame = self.scaler.process(&frame).inspect_err(|_| { self.done = true; - err })?; // The frame has padding, so we need to copy the data. diff --git a/image-processor/src/worker/process/decoder/mod.rs b/image-processor/src/worker/process/decoder/mod.rs index 40ff8d071..f2e685302 100644 --- a/image-processor/src/worker/process/decoder/mod.rs +++ b/image-processor/src/worker/process/decoder/mod.rs @@ -38,6 +38,8 @@ pub enum DecoderError { TooManyFrames(i64), #[error("exceeded maximum input duration: {0}")] TooLong(i64), + #[error("malformed input")] + MalformedInput, } #[derive(Debug, Clone, Copy)] diff --git a/image-processor/src/worker/process/encoder/libavif.rs b/image-processor/src/worker/process/encoder/libavif.rs index fafe7fd03..79caf8979 100644 --- a/image-processor/src/worker/process/encoder/libavif.rs +++ b/image-processor/src/worker/process/encoder/libavif.rs @@ -1,6 +1,6 @@ use std::ptr::NonNull; -use libavif_sys::{AVIF_QUALITY_LOSSLESS, AVIF_QUANTIZER_BEST_QUALITY, AVIF_SPEED_FASTEST, AVIF_SPEED_SLOWEST}; +use libavif_sys::{AVIF_QUALITY_BEST, AVIF_QUALITY_LOSSLESS, AVIF_SPEED_FASTEST, AVIF_SPEED_SLOWEST}; use scuffle_image_processor_proto::OutputQuality; use super::{Encoder, EncoderError, EncoderInfo, EncoderSettings}; @@ -27,27 +27,19 @@ impl AvifEncoder { encoder.as_mut().maxThreads = 1; encoder.as_mut().timescale = settings.timescale; - encoder.as_mut().autoTiling = 1; encoder.as_mut().quality = match settings.quality { - OutputQuality::Auto => encoder.as_mut().quality, + OutputQuality::Auto => 75_i32, OutputQuality::Lossless => AVIF_QUALITY_LOSSLESS as i32, - OutputQuality::High => 75, - OutputQuality::Medium => 50, - OutputQuality::Low => 25_i32, - }; - encoder.as_mut().qualityAlpha = encoder.as_mut().quality; - encoder.as_mut().minQuantizer = match settings.quality { - OutputQuality::Auto => encoder.as_mut().minQuantizer, - OutputQuality::Lossless => AVIF_QUANTIZER_BEST_QUALITY as i32, - OutputQuality::High => 5, - OutputQuality::Medium => 15, - OutputQuality::Low => 30, + OutputQuality::High => AVIF_QUALITY_BEST as i32, + OutputQuality::Medium => 75, + OutputQuality::Low => 50, }; + encoder.as_mut().qualityAlpha = AVIF_QUALITY_LOSSLESS as i32; encoder.as_mut().speed = match settings.quality { - OutputQuality::Auto => 8, + OutputQuality::Auto => 5_i32, OutputQuality::Lossless => AVIF_SPEED_SLOWEST as i32, - OutputQuality::High => 5, - OutputQuality::Medium => 8, + OutputQuality::High => 4, + OutputQuality::Medium => 7, OutputQuality::Low => AVIF_SPEED_FASTEST as i32, }; diff --git a/image-processor/src/worker/process/encoder/libwebp.rs b/image-processor/src/worker/process/encoder/libwebp.rs index 0e7f386cd..6938f7e7c 100644 --- a/image-processor/src/worker/process/encoder/libwebp.rs +++ b/image-processor/src/worker/process/encoder/libwebp.rs @@ -38,25 +38,23 @@ impl WebpEncoder { config.lossless = if settings.quality == OutputQuality::Lossless { 1 } else { 0 }; config.quality = match settings.quality { - OutputQuality::Auto => 90.0, + OutputQuality::Auto => 75.0, OutputQuality::High => 95.0, OutputQuality::Lossless => 100.0, OutputQuality::Medium => 75.0, OutputQuality::Low => 50.0, }; + config.alpha_quality = 100; config.method = match settings.quality { OutputQuality::Auto => 4, - OutputQuality::High => 4, + OutputQuality::High => 5, OutputQuality::Lossless => 6, OutputQuality::Medium => 3, OutputQuality::Low => 2, }; config.thread_level = 1; - - wrap_error( - unsafe { libwebp_sys::WebPConfigInit(&mut config) }, - "failed to initialize webp config", - )?; + config.qmin = 75; + config.qmax = 100; let mut picture = SmartObject::new(zero_memory_default::(), |ptr| unsafe { libwebp_sys::WebPPictureFree(ptr); @@ -137,12 +135,6 @@ impl Encoder for WebpEncoder { "failed to initialize webp anim encoder options", )?; - config.allow_mixed = 1; - // TOOD(troy): open a libwebp issue to report that images are being encoded - // incorrectly unless this is set to 1. However this forces every frame to be a - // keyframe and thus the size of the file is much larger. - config.kmax = 1; - config.anim_params.loop_count = match self.settings.loop_count { LoopCount::Finite(count) => count as _, LoopCount::Infinite => 0, diff --git a/image-processor/src/worker/process/frame.rs b/image-processor/src/worker/process/frame.rs index b65275176..45b90b9e3 100644 --- a/image-processor/src/worker/process/frame.rs +++ b/image-processor/src/worker/process/frame.rs @@ -13,7 +13,7 @@ pub struct FrameRef<'a> { } impl FrameRef<'_> { - pub fn to_owned(&self) -> Frame { + pub fn to_owned(self) -> Frame { Frame { image: Img::new(self.image.buf().to_vec(), self.image.width(), self.image.height()), duration_ts: self.duration_ts, diff --git a/image-processor/src/worker/process/mod.rs b/image-processor/src/worker/process/mod.rs index 7a25cd1f7..c18b01d04 100644 --- a/image-processor/src/worker/process/mod.rs +++ b/image-processor/src/worker/process/mod.rs @@ -131,31 +131,32 @@ impl ProcessJob { let result = loop { tokio::select! { - _ = tokio::time::sleep(global.config().worker.refresh_interval) => { - match self.job.refresh(&global).await { - Ok(true) => {}, - Ok(false) => { - tracing::warn!("lost job"); - return; - } - Err(err) => { - tracing::error!("failed to refresh job: {err}"); - return; - } - } - } - Some(_) = async { - if let Some(fut) = timeout_fut.as_mut() { - Some(fut.await) - } else { - None - } - } => { - tracing::warn!("timeout"); - break Err(JobError::Internal("timeout")); - } - result = &mut future => break result, - } + _ = tokio::time::sleep(global.config().worker.refresh_interval) => { + match self.job.refresh(&global).await { + Ok(true) => {}, + Ok(false) => { + tracing::warn!("lost job"); + return; + } + Err(err) => { + tracing::error!("failed to refresh job: {err}"); + return; + } + } + } + Some(_) = async { + if let Some(fut) = timeout_fut.as_mut() { + fut.await; + Some(()) + } else { + None + } + } => { + tracing::warn!("timeout"); + break Err(JobError::Internal("timeout")); + } + result = &mut future => break result, + } }; match result { diff --git a/image-processor/src/worker/process/resize.rs b/image-processor/src/worker/process/resize.rs index 981cb23f1..b85729e07 100644 --- a/image-processor/src/worker/process/resize.rs +++ b/image-processor/src/worker/process/resize.rs @@ -199,7 +199,7 @@ impl ImageResizer { }) .collect(), output::Resize::Scaling(scaling) => { - let (base_width, base_height) = match scaling.base.clone().ok_or(ResizeError::MissingResize)? { + let (base_width, base_height) = match scaling.base.ok_or(ResizeError::MissingResize)? { scaling::Base::FixedBase(scale) => { let input = cropped_dims.convert_aspect_ratio(target_aspect_ratio);