20 Commits

Author SHA1 Message Date
6872e7897b build: bump version (v1.2.2) 2021-08-25 17:11:23 +02:00
2d1497cb36 build: update deps 2021-08-25 17:09:33 +02:00
f1fb3506b5 build: update deps 2021-07-25 14:37:08 +02:00
f4050fe645 refactor: switch from space to tab indentation 2021-07-10 10:07:30 +02:00
b533f059d7 build: bump version (v1.2.1) 2021-07-05 20:02:49 +02:00
00a25e168d refactor: use more readable clamp method 2021-07-05 19:53:49 +02:00
b51c9939c1 build: upgrade deps 2021-07-05 19:46:06 +02:00
c22d45818e build: update deps 2021-06-18 11:46:48 +02:00
18cc852e6b build: update deps 2021-05-27 22:52:48 +02:00
65b4f398d9 build: bump version (v1.2.0) 2021-04-22 21:20:51 +02:00
7f40cb0581 build: update nix deps 2021-04-22 21:20:51 +02:00
bc15a4449d build: update cargo deps 2021-04-22 21:20:51 +02:00
1cf7cec8bd feat: add "jobs" cli argument 2021-04-22 21:20:51 +02:00
5cf98b3c17 feat: improve error messages 2021-04-21 00:57:23 +02:00
54e174eb0a build: include "README.md" & "CHANGELOG.md" to crate package 2021-04-21 00:26:28 +02:00
803860cce5 doc: add changelog 2021-04-21 00:26:21 +02:00
f2bfddd76e refactor: move actual transcoding into own fn 2021-04-17 01:53:25 +02:00
d073ef10b5 feat: add "copy" codec 2021-04-17 01:14:34 +02:00
399c4b8a2c build: update cargo deps 2021-04-17 00:21:47 +02:00
3188d074b7 build: update nix deps 2021-04-17 00:20:44 +02:00
10 changed files with 1268 additions and 1104 deletions

View File

@@ -1,7 +1,7 @@
root = true root = true
[*] [*]
indent_style = space indent_style = tab
indent_size = 4 indent_size = 4
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true

1
.rustfmt.toml Normal file
View File

@@ -0,0 +1 @@
hard_tabs = true

19
CHANGELOG.md Normal file
View File

@@ -0,0 +1,19 @@
# Changelog
## v1.2.2
* dependencies upgraded
## v1.2.1
* dependencies upgraded
## v1.2.0
* "copy" encoding format added
* "jobs" cli argument added, that lets you set the number of concurrent transcodes
## v1.1.0
* "flac" encoding format added
* resampling quality set to highest/"10"

442
Cargo.lock generated
View File

@@ -1,10 +1,12 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.15" version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -20,15 +22,15 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.38" version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
[[package]] [[package]]
name = "array-init" name = "array-init"
version = "1.0.0" version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a51c983d65b6691893a791e55aa8bda43bbd9b11f947e5a9581710362277cc95" checksum = "6945cc5422176fc5e602e590c2878d2c2acd9a4fe20a4baa7c28022521698ec6"
[[package]] [[package]]
name = "atty" name = "atty"
@@ -43,7 +45,7 @@ dependencies = [
[[package]] [[package]]
name = "audio-conv" name = "audio-conv"
version = "1.1.0" version = "1.2.2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@@ -72,15 +74,15 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.2.1" version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]] [[package]]
name = "bstr" name = "bstr"
version = "0.2.15" version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -97,6 +99,15 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]]
name = "cfg-expr"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b412e83326147c2bb881f8b40edfbf9905b9b8abaebd0e47ca190ba62fda8f0e"
dependencies = [
"smallvec",
]
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "1.0.0" version = "1.0.0"
@@ -119,46 +130,54 @@ dependencies = [
] ]
[[package]] [[package]]
name = "crossterm" name = "convert_case"
version = "0.18.2" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e86d73f2a0b407b5768d10a8c720cf5d2df49a9efc10ca09176d201ead4b7fb" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
[[package]]
name = "crossterm"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ebde6a9dd5e331cd6c6f48253254d117642c31653baa475e394657c59c1f7d"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"crossterm_winapi", "crossterm_winapi",
"lazy_static",
"libc", "libc",
"mio", "mio",
"parking_lot", "parking_lot",
"signal-hook", "signal-hook",
"signal-hook-mio",
"winapi", "winapi",
] ]
[[package]] [[package]]
name = "crossterm_winapi" name = "crossterm_winapi"
version = "0.6.2" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2265c3f8e080075d9b6417aa72293fc71662f34b4af2612d8d1b074d29510db" checksum = "3a6966607622438301997d3dac0d2f6e9a90c68bb6bc1785ea98456ab93c0507"
dependencies = [ dependencies = [
"winapi", "winapi",
] ]
[[package]] [[package]]
name = "derive_more" name = "derive_more"
version = "0.99.11" version = "0.99.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df"
dependencies = [ dependencies = [
"convert_case",
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustc_version",
"syn", "syn",
] ]
[[package]] [[package]]
name = "dtoa" name = "dtoa"
version = "0.4.7" version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88d7ed2934d741c6b37e33e3832298e8850b53fd2d2bea03873375596c7cea4e" checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0"
[[package]] [[package]]
name = "either" name = "either"
@@ -174,9 +193,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]] [[package]]
name = "futures" name = "futures"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150" checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
@@ -189,9 +208,9 @@ dependencies = [
[[package]] [[package]]
name = "futures-channel" name = "futures-channel"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-sink", "futures-sink",
@@ -199,15 +218,15 @@ dependencies = [
[[package]] [[package]]
name = "futures-core" name = "futures-core"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99"
[[package]] [[package]]
name = "futures-executor" name = "futures-executor"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-task", "futures-task",
@@ -216,16 +235,17 @@ dependencies = [
[[package]] [[package]]
name = "futures-io" name = "futures-io"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500" checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582"
[[package]] [[package]]
name = "futures-macro" name = "futures-macro"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
dependencies = [ dependencies = [
"autocfg",
"proc-macro-hack", "proc-macro-hack",
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -234,25 +254,23 @@ dependencies = [
[[package]] [[package]]
name = "futures-sink" name = "futures-sink"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53"
[[package]] [[package]]
name = "futures-task" name = "futures-task"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2"
dependencies = [
"once_cell",
]
[[package]] [[package]]
name = "futures-util" name = "futures-util"
version = "0.3.12" version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78"
dependencies = [ dependencies = [
"autocfg",
"futures-channel", "futures-channel",
"futures-core", "futures-core",
"futures-io", "futures-io",
@@ -269,32 +287,31 @@ dependencies = [
[[package]] [[package]]
name = "glib" name = "glib"
version = "0.10.3" version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c685013b7515e668f1b57a165b009d4d28cb139a8a989bbd699c10dad29d0c5" checksum = "a8fb802e3798d75b415bea8f016eed88d50106ce82f1274e80f31d80cfd4b056"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"futures-channel", "futures-channel",
"futures-core", "futures-core",
"futures-executor", "futures-executor",
"futures-task", "futures-task",
"futures-util",
"glib-macros", "glib-macros",
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"libc", "libc",
"once_cell", "once_cell",
"smallvec",
] ]
[[package]] [[package]]
name = "glib-macros" name = "glib-macros"
version = "0.10.1" version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41486a26d1366a8032b160b59065a59fb528530a46a49f627e7048fb8c064039" checksum = "2aad66361f66796bfc73f530c51ef123970eb895ffba991a234fcf7bea89e518"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"heck", "heck",
"itertools",
"proc-macro-crate", "proc-macro-crate",
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
@@ -304,9 +321,9 @@ dependencies = [
[[package]] [[package]]
name = "glib-sys" name = "glib-sys"
version = "0.10.1" version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7e9b997a66e9a23d073f2b1abb4dbfc3925e0b8952f67efd8d9b6e168e4cdc1" checksum = "1c1d60554a212445e2a858e42a0e48cece1bd57b311a19a9468f70376cf554ae"
dependencies = [ dependencies = [
"libc", "libc",
"system-deps", "system-deps",
@@ -314,9 +331,9 @@ dependencies = [
[[package]] [[package]]
name = "globset" name = "globset"
version = "0.4.6" version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c152169ef1e421390738366d2f796655fec62621dabbd0fd476f905934061e4a" checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"bstr", "bstr",
@@ -327,9 +344,9 @@ dependencies = [
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.10.0" version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c" checksum = "aa92cae29759dae34ab5921d73fff5ad54b3d794ab842c117e36cafc7994c3f5"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
@@ -338,9 +355,9 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer" name = "gstreamer"
version = "0.16.5" version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d50f822055923f1cbede233aa5dfd4ee957cf328fb3076e330886094e11d6cf" checksum = "810e68483c27518ec8491d71ee163f9fc03dcc4ebacee98caa348e8a064898ef"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cfg-if", "cfg-if",
@@ -348,11 +365,10 @@ dependencies = [
"futures-core", "futures-core",
"futures-util", "futures-util",
"glib", "glib",
"glib-sys",
"gobject-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"muldiv", "muldiv",
"num-integer",
"num-rational", "num-rational",
"once_cell", "once_cell",
"paste", "paste",
@@ -362,29 +378,26 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-audio" name = "gstreamer-audio"
version = "0.16.5" version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b926a2fa1b6756cf4087fe54ac20bb9951131efe8529dfb5c151b490d9dfe242" checksum = "420b6bcb1759231f01172751da094e7afa5cd9edf40bee7475f5bc86df433c57"
dependencies = [ dependencies = [
"array-init", "array-init",
"bitflags", "bitflags",
"cfg-if",
"glib", "glib",
"glib-sys",
"gobject-sys",
"gstreamer", "gstreamer",
"gstreamer-audio-sys", "gstreamer-audio-sys",
"gstreamer-base", "gstreamer-base",
"gstreamer-base-sys",
"gstreamer-sys",
"libc", "libc",
"once_cell", "once_cell",
] ]
[[package]] [[package]]
name = "gstreamer-audio-sys" name = "gstreamer-audio-sys"
version = "0.9.1" version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b614d5e478ad2ff6f5699757d03f11f2868ea43164c651c60449bd0e3c6b7d75" checksum = "d066ddfd05f63836f35ac4a5830d5bb2f7f3d6c33c870e9b15c667d20f65d7f6"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
@@ -396,25 +409,23 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-base" name = "gstreamer-base"
version = "0.16.5" version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bafd01c56f59cb10f4b5a10f97bb4bdf8c2b2784ae5b04da7e2d400cf6e6afcf" checksum = "2c0c1d8c62eb5d08fb80173609f2eea71d385393363146e4e78107facbd67715"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cfg-if",
"glib", "glib",
"glib-sys",
"gobject-sys",
"gstreamer", "gstreamer",
"gstreamer-base-sys", "gstreamer-base-sys",
"gstreamer-sys",
"libc", "libc",
] ]
[[package]] [[package]]
name = "gstreamer-base-sys" name = "gstreamer-base-sys"
version = "0.9.1" version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4b7b6dc2d6e160a1ae28612f602bd500b3fa474ce90bf6bb2f08072682beef5" checksum = "28169a7b58edb93ad8ac766f0fa12dcd36a2af4257a97ee10194c7103baf3e27"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
@@ -425,9 +436,9 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-sys" name = "gstreamer-sys"
version = "0.9.1" version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc1f154082d01af5718c5f8a8eb4f565a4ea5586ad8833a8fc2c2aa6844b601d" checksum = "a81704feeb3e8599913bdd1e738455c2991a01ff4a1780cb62200993e454cc3e"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
@@ -436,52 +447,62 @@ dependencies = [
] ]
[[package]] [[package]]
name = "heck" name = "hashbrown"
version = "0.3.2" version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
[[package]]
name = "heck"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
dependencies = [ dependencies = [
"unicode-segmentation", "unicode-segmentation",
] ]
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.1.18" version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [ dependencies = [
"libc", "libc",
] ]
[[package]] [[package]]
name = "instant" name = "indexmap"
version = "0.1.9" version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "instant"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]] [[package]]
name = "itertools" name = "itertools"
version = "0.9.0" version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf"
dependencies = [ dependencies = [
"either", "either",
] ]
[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.86" version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5"
[[package]] [[package]]
name = "linked-hash-map" name = "linked-hash-map"
@@ -491,9 +512,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.4.2" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb"
dependencies = [ dependencies = [
"scopeguard", "scopeguard",
] ]
@@ -509,15 +530,15 @@ dependencies = [
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.3.4" version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]] [[package]]
name = "mio" name = "mio"
version = "0.7.7" version = "0.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e50ae3f04d169fcc9bde0b547d1c205219b7157e07ded9c5aff03e0637cb3ed7" checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16"
dependencies = [ dependencies = [
"libc", "libc",
"log", "log",
@@ -528,19 +549,18 @@ dependencies = [
[[package]] [[package]]
name = "miow" name = "miow"
version = "0.3.6" version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
dependencies = [ dependencies = [
"socket2",
"winapi", "winapi",
] ]
[[package]] [[package]]
name = "muldiv" name = "muldiv"
version = "0.2.1" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0419348c027fa7be448d2ae7ea0e4e04c2334c31dc4e74ab29f00a2a7ca69204" checksum = "b5136edda114182728ccdedb9f5eda882781f35fa6e80cc360af12a8932507f3"
[[package]] [[package]]
name = "ntapi" name = "ntapi"
@@ -563,9 +583,9 @@ dependencies = [
[[package]] [[package]]
name = "num-rational" name = "num-rational"
version = "0.3.2" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"num-integer", "num-integer",
@@ -593,9 +613,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.5.2" version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
[[package]] [[package]]
name = "parking_lot" name = "parking_lot"
@@ -610,9 +630,9 @@ dependencies = [
[[package]] [[package]]
name = "parking_lot_core" name = "parking_lot_core"
version = "0.8.2" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272" checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"instant", "instant",
@@ -624,15 +644,24 @@ dependencies = [
[[package]] [[package]]
name = "paste" name = "paste"
version = "1.0.4" version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5d65c4d95931acda4498f675e332fcbdc9a06705cd07086c510e9b6009cd1c1" checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58"
[[package]]
name = "pest"
version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53"
dependencies = [
"ucd-trie",
]
[[package]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
version = "0.2.4" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"
[[package]] [[package]]
name = "pin-utils" name = "pin-utils"
@@ -654,10 +683,11 @@ checksum = "bc5c99d529f0d30937f6f4b8a86d988047327bb88d04d2c4afc356de74722131"
[[package]] [[package]]
name = "proc-macro-crate" name = "proc-macro-crate"
version = "0.1.5" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92"
dependencies = [ dependencies = [
"thiserror",
"toml", "toml",
] ]
@@ -699,45 +729,56 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.24" version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
dependencies = [ dependencies = [
"unicode-xid", "unicode-xid",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.8" version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.1.57" version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
dependencies = [
"bitflags",
]
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.4.3" version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
"regex-syntax", "regex-syntax",
"thread_local",
] ]
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.6.22" version = "0.6.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
name = "rustc_version"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee"
dependencies = [
"semver",
]
[[package]] [[package]]
name = "same-file" name = "same-file"
@@ -755,19 +796,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]] [[package]]
name = "serde" name = "semver"
version = "1.0.123" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6"
dependencies = [
"semver-parser",
]
[[package]]
name = "semver-parser"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7"
dependencies = [
"pest",
]
[[package]]
name = "serde"
version = "1.0.129"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1f72836d2aa753853178eda473a3b9d8e4eefdaf20523b919677e6de489f8f1"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.123" version = "1.0.129"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" checksum = "e57ae87ad533d9a56427558b516d0adac283614e347abf85b0dc0cbbf0a249f3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -776,41 +835,51 @@ dependencies = [
[[package]] [[package]]
name = "serde_yaml" name = "serde_yaml"
version = "0.8.17" version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23" checksum = "6375dbd828ed6964c3748e4ef6d18e7a175d408ffe184bca01698d0c73f915a9"
dependencies = [ dependencies = [
"dtoa", "dtoa",
"linked-hash-map", "indexmap",
"serde", "serde",
"yaml-rust", "yaml-rust",
] ]
[[package]] [[package]]
name = "signal-hook" name = "signal-hook"
version = "0.1.17" version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e31d442c16f047a671b5a71e2161d6e68814012b7f5379d269ebd915fac2729" checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39"
dependencies = [ dependencies = [
"libc", "libc",
"mio",
"signal-hook-registry", "signal-hook-registry",
] ]
[[package]] [[package]]
name = "signal-hook-registry" name = "signal-hook-mio"
version = "1.3.0" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" checksum = "29fd5867f1c4f2c5be079aee7a2adf1152ebb04a4bc4d341f504b7dece607ed4"
dependencies = [
"libc",
"mio",
"signal-hook",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
dependencies = [ dependencies = [
"libc", "libc",
] ]
[[package]] [[package]]
name = "slab" name = "slab"
version = "0.4.2" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
[[package]] [[package]]
name = "smallvec" name = "smallvec"
@@ -818,17 +887,6 @@ version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
[[package]]
name = "socket2"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e"
dependencies = [
"cfg-if",
"libc",
"winapi",
]
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.8.0" version = "0.8.0"
@@ -837,15 +895,15 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]] [[package]]
name = "strum" name = "strum"
version = "0.18.0" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2"
[[package]] [[package]]
name = "strum_macros" name = "strum_macros"
version = "0.18.0" version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
@@ -855,9 +913,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.60" version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -866,11 +924,14 @@ dependencies = [
[[package]] [[package]]
name = "system-deps" name = "system-deps"
version = "1.3.2" version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b" checksum = "480c269f870722b3b08d2f13053ce0c2ab722839f472863c3e2d61ff3a1c2fa6"
dependencies = [ dependencies = [
"anyhow",
"cfg-expr",
"heck", "heck",
"itertools",
"pkg-config", "pkg-config",
"strum", "strum",
"strum_macros", "strum_macros",
@@ -890,38 +951,29 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.23" version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.23" version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn",
] ]
[[package]]
name = "thread_local"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd"
dependencies = [
"once_cell",
]
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.2.0" version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8190d04c665ea9e6b6a0dc45523ade572c088d2e6566244c1122671dbf4ae3a" checksum = "92036be488bb6594459f2e03b60e42df6f937fe6ca5c5ffdcb539c6b84dc40f5"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"bytes", "bytes",
@@ -932,9 +984,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "1.1.0" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -952,9 +1004,9 @@ dependencies = [
[[package]] [[package]]
name = "tui" name = "tui"
version = "0.14.0" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ced152a8e9295a5b168adc254074525c17ac4a83c90b2716274cc38118bddc9" checksum = "39c8ce4e27049eed97cfa363a5048b09d995e209994634a0efc26a14ab6c0c23"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cassowary", "cassowary",
@@ -964,10 +1016,16 @@ dependencies = [
] ]
[[package]] [[package]]
name = "unicode-segmentation" name = "ucd-trie"
version = "1.7.1" version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
name = "unicode-segmentation"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
@@ -977,9 +1035,9 @@ checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
[[package]] [[package]]
name = "unicode-xid" name = "unicode-xid"
version = "0.2.1" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]] [[package]]
name = "vec_map" name = "vec_map"
@@ -989,21 +1047,21 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "version-compare" name = "version-compare"
version = "0.0.10" version = "0.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b"
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.2" version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
[[package]] [[package]]
name = "walkdir" name = "walkdir"
version = "2.3.1" version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
dependencies = [ dependencies = [
"same-file", "same-file",
"winapi", "winapi",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "audio-conv" name = "audio-conv"
version = "1.1.0" version = "1.2.2"
edition = "2018" edition = "2018"
description = "Copies directory structure and converts audio files in it" description = "Copies directory structure and converts audio files in it"
authors = ["Thomas Heck <t@b128.net>"] authors = ["Thomas Heck <t@b128.net>"]
@@ -16,13 +16,15 @@ keywords = ["audio", "conversion", "opus", "flac"]
include = [ include = [
"/src/**/*", "/src/**/*",
"/example.audio-conv.yaml", "/example.audio-conv.yaml",
"/README.md",
"/CHANGELOG.md",
] ]
[dependencies] [dependencies]
gstreamer-audio = { version = "0.16", features = ["v1_10"] } gstreamer-audio = { version = "0.17", features = ["v1_10"] }
gstreamer = { version = "0.16", features = ["v1_10"] } gstreamer = { version = "0.17", features = ["v1_10"] }
gstreamer-base = { version = "0.16", features = ["v1_10"] } gstreamer-base = { version = "0.17", features = ["v1_10"] }
glib = "0.10" glib = "0.14"
futures = "0.3" futures = "0.3"
num_cpus = "1" num_cpus = "1"
walkdir = "2" walkdir = "2"
@@ -34,7 +36,7 @@ serde_yaml = "0.8"
regex = "1" regex = "1"
globset = "0.4" globset = "0.4"
derive_more = "0.99" derive_more = "0.99"
tui = { version = "0.14", default-features = false, features = ["crossterm"] } tui = { version = "0.16", default-features = false, features = ["crossterm"] }
[dependencies.tokio] [dependencies.tokio]
version = "1" version = "1"

View File

@@ -13,6 +13,10 @@ matches:
bitrate: 160 bitrate: 160
bitrate_type: vbr # or cbr bitrate_type: vbr # or cbr
# for copy (copies file without transcoding it):
# to:
# codec: copy
# for mp3: # for mp3:
# to: # to:
# codec: mp3 # codec: mp3

12
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1610051610, "lastModified": 1629481132,
"narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", "rev": "997f7efcb746a9c140ce1f13c72263189225f482",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -32,11 +32,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1612988144, "lastModified": 1629897889,
"narHash": "sha256-X1IO9gtzE0dRVpDqknjF39IVDnuKuZsRis38WnLfHLo=", "narHash": "sha256-YoY/umk+NUtLFJgvTJkup6nLJb+sGEZ21hrupKTp7EI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "26f6af373ec1b867d751b56fb802f14010c8351b", "rev": "6248814b6892af7dc0cf973b49690fd102088e02",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -12,6 +12,7 @@ pub struct Config {
pub from: PathBuf, pub from: PathBuf,
pub to: PathBuf, pub to: PathBuf,
pub matches: Vec<TranscodeMatch>, pub matches: Vec<TranscodeMatch>,
pub jobs: Option<usize>,
} }
#[derive(Debug)] #[derive(Debug)]
@@ -46,6 +47,9 @@ pub enum Transcode {
#[serde(default = "bitrate_type_vbr")] #[serde(default = "bitrate_type_vbr")]
bitrate_type: BitrateType, bitrate_type: BitrateType,
}, },
#[serde(rename = "copy")]
Copy,
} }
impl Transcode { impl Transcode {
@@ -54,6 +58,7 @@ impl Transcode {
Transcode::Opus { .. } => "opus", Transcode::Opus { .. } => "opus",
Transcode::Flac { .. } => "flac", Transcode::Flac { .. } => "flac",
Transcode::Mp3 { .. } => "mp3", Transcode::Mp3 { .. } => "mp3",
Transcode::Copy => "",
} }
} }
} }
@@ -123,7 +128,7 @@ pub fn config() -> Result<Config> {
.long("config") .long("config")
.required(false) .required(false)
.takes_value(true) .takes_value(true)
.help("path to an audio-conv config file, defaults to \"audio-conv.yaml\""), .help("Path to an audio-conv config file, defaults to \"audio-conv.yaml\""),
) )
.arg( .arg(
Arg::with_name("from") Arg::with_name("from")
@@ -131,7 +136,7 @@ pub fn config() -> Result<Config> {
.long("from") .long("from")
.required(false) .required(false)
.takes_value(true) .takes_value(true)
.help("from directory path"), .help("\"from\" directory path"),
) )
.arg( .arg(
Arg::with_name("to") Arg::with_name("to")
@@ -139,12 +144,20 @@ pub fn config() -> Result<Config> {
.long("to") .long("to")
.required(false) .required(false)
.takes_value(true) .takes_value(true)
.help("to directory path"), .help("\"to\" directory path"),
)
.arg(
Arg::with_name("jobs")
.short("j")
.long("jobs")
.required(false)
.takes_value(true)
.help("Allow N jobs/transcodes at once. Defaults to number of logical cores"),
) )
.subcommand(SubCommand::with_name("init").about("writes an example config")) .subcommand(SubCommand::with_name("init").about("writes an example config"))
.get_matches(); .get_matches();
let current_dir = std::env::current_dir().context("could not get current directory")?; let current_dir = std::env::current_dir().context("Could not get current directory")?;
let config_path = arg_matches.value_of_os("config"); let config_path = arg_matches.value_of_os("config");
let force_load = config_path.is_some(); let force_load = config_path.is_some();
@@ -159,17 +172,17 @@ pub fn config() -> Result<Config> {
.create_new(true) .create_new(true)
.open(&config_path) .open(&config_path)
.and_then(|mut f| f.write_all(std::include_bytes!("../example.audio-conv.yaml"))) .and_then(|mut f| f.write_all(std::include_bytes!("../example.audio-conv.yaml")))
.with_context(|| format!("unable to write config file to {}", config_path.display()))?; .with_context(|| format!("Unable to write config file to {}", config_path.display()))?;
std::process::exit(0); std::process::exit(0);
} }
let config_dir = config_path let config_dir = config_path
.parent() .parent()
.context("could not get parent directory of the config file")?; .context("Could not get parent directory of the config file")?;
let config_file = load_config_file(&config_path) let config_file = load_config_file(&config_path)
.with_context(|| format!("failed loading config file \"{}\"", config_path.display()))?; .with_context(|| format!("Failed loading config file {}", config_path.display()))?;
if force_load && config_file.is_none() { if force_load && config_file.is_none() {
return Err(Error::msg(format!( return Err(Error::msg(format!(
@@ -181,7 +194,7 @@ pub fn config() -> Result<Config> {
let default_regex = RegexBuilder::new("\\.(flac|wav)$") let default_regex = RegexBuilder::new("\\.(flac|wav)$")
.case_insensitive(true) .case_insensitive(true)
.build() .build()
.expect("failed compiling default match regex"); .expect("Failed compiling default match regex");
let transcode_matches = config_file let transcode_matches = config_file
.as_ref() .as_ref()
@@ -194,8 +207,8 @@ pub fn config() -> Result<Config> {
let glob = GlobBuilder::new(glob) let glob = GlobBuilder::new(glob)
.case_insensitive(true) .case_insensitive(true)
.build() .build()
.context("failed building glob")?; .context("Failed building glob")?;
let regex = Regex::new(glob.regex()).context("failed compiling regex")?; let regex = Regex::new(glob.regex()).context("Failed compiling regex")?;
Ok(regex) Ok(regex)
}); });
@@ -203,7 +216,7 @@ pub fn config() -> Result<Config> {
let regex = RegexBuilder::new(regex) let regex = RegexBuilder::new(regex)
.case_insensitive(true) .case_insensitive(true)
.build() .build()
.context("failed compiling regex")?; .context("Failed compiling regex")?;
Ok(regex) Ok(regex)
}); });
@@ -215,7 +228,7 @@ pub fn config() -> Result<Config> {
let regex = RegexBuilder::new(&ext) let regex = RegexBuilder::new(&ext)
.case_insensitive(true) .case_insensitive(true)
.build() .build()
.context("failed compiling regex")?; .context("Failed compiling regex")?;
Ok(regex) Ok(regex)
}); });
@@ -258,7 +271,7 @@ pub fn config() -> Result<Config> {
}) })
.ok_or_else(|| Error::msg("\"from\" not configured"))? .ok_or_else(|| Error::msg("\"from\" not configured"))?
.canonicalize() .canonicalize()
.context("could not canonicalize \"from\" path")? .context("Could not canonicalize \"from\" path")?
}, },
to: arg_matches to: arg_matches
.value_of_os("to") .value_of_os("to")
@@ -272,8 +285,26 @@ pub fn config() -> Result<Config> {
}) })
.ok_or_else(|| Error::msg("\"to\" not configured"))? .ok_or_else(|| Error::msg("\"to\" not configured"))?
.canonicalize() .canonicalize()
.context("could not canonicalize \"to\" path")?, .context("Could not canonicalize \"to\" path")?,
matches: transcode_matches, matches: transcode_matches,
jobs: arg_matches
.value_of_os("jobs")
.map(|jobs_os_str| {
let jobs_str = jobs_os_str.to_str().with_context(|| {
// TODO: use `OsStr.display` when it lands
// https://github.com/rust-lang/rust/pull/80841
format!(
"Could not convert \"jobs\" argument to string due to invalid characters",
)
})?;
jobs_str.parse().with_context(|| {
format!(
"Could not parse \"jobs\" argument \"{}\" to a number",
&jobs_str
)
})
})
.transpose()?,
}) })
} }
@@ -284,6 +315,6 @@ fn load_config_file(path: &Path) -> Result<Option<ConfigFile>> {
Err(err) => return Err(Error::new(err)), Err(err) => return Err(Error::new(err)),
}; };
let config: ConfigFile = let config: ConfigFile =
serde_yaml::from_reader(&mut file).context("could not parse config file")?; serde_yaml::from_reader(&mut file).context("Could not parse config file")?;
Ok(Some(config)) Ok(Some(config))
} }

View File

@@ -1,11 +1,11 @@
mod config; mod config;
mod ui; mod ui;
use crate::config::Config; use crate::config::{Config, Transcode};
use anyhow::{Context, Error, Result}; use anyhow::{Context, Error, Result};
use futures::{pin_mut, prelude::*}; use futures::{pin_mut, prelude::*};
use glib::{subclass::prelude::*, GBoxed, GString}; use glib::{GBoxed, GString};
use gstreamer::{gst_element_error, prelude::*, Element}; use gstreamer::{element_error, prelude::*, Element};
use gstreamer_base::prelude::*; use gstreamer_base::prelude::*;
use std::{ use std::{
borrow::Cow, borrow::Cow,
@@ -52,12 +52,12 @@ struct GErrorMessage {
fn gmake<T: IsA<Element>>(factory_name: &str) -> Result<T> { fn gmake<T: IsA<Element>>(factory_name: &str) -> Result<T> {
let res = gstreamer::ElementFactory::make(factory_name, None) let res = gstreamer::ElementFactory::make(factory_name, None)
.with_context(|| format!("could not make gstreamer Element \"{}\"", factory_name))? .with_context(|| format!("Could not make gstreamer Element \"{}\"", factory_name))?
.downcast() .downcast()
.ok() .ok()
.with_context(|| { .with_context(|| {
format!( format!(
"could not cast gstreamer Element \"{}\" into `{}`", "Could not cast gstreamer Element \"{}\" into `{}`",
factory_name, factory_name,
std::any::type_name::<T>() std::any::type_name::<T>()
) )
@@ -68,7 +68,7 @@ fn gmake<T: IsA<Element>>(factory_name: &str) -> Result<T> {
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ConversionArgs { pub struct ConversionArgs {
rel_from_path: PathBuf, rel_from_path: PathBuf,
transcode: config::Transcode, transcode: Transcode,
} }
fn get_conversion_args(config: &Config) -> impl Iterator<Item = Result<ConversionArgs>> + '_ { fn get_conversion_args(config: &Config) -> impl Iterator<Item = Result<ConversionArgs>> + '_ {
@@ -97,7 +97,7 @@ fn get_conversion_args(config: &Config) -> impl Iterator<Item = Result<Conversio
let rel_path = e.path().strip_prefix(&config.from).with_context(|| { let rel_path = e.path().strip_prefix(&config.from).with_context(|| {
format!( format!(
"unable to get relative path for {} from {}", "Unable to get relative path for {} from {}",
e.path().display(), e.path().display(),
config.from.display() config.from.display()
) )
@@ -112,7 +112,10 @@ fn get_conversion_args(config: &Config) -> impl Iterator<Item = Result<Conversio
.map_err(Error::new) .map_err(Error::new)
.and_then(|md| md.modified().map_err(Error::new)) .and_then(|md| md.modified().map_err(Error::new))
.with_context(|| { .with_context(|| {
format!("unable to get mtime for from file {}", e.path().display()) format!(
"Unable to get mtime for \"from\" file {}",
e.path().display()
)
})?; })?;
let to_mtime = to.metadata().and_then(|md| md.modified()); let to_mtime = to.metadata().and_then(|md| md.modified());
match to_mtime { match to_mtime {
@@ -120,7 +123,7 @@ fn get_conversion_args(config: &Config) -> impl Iterator<Item = Result<Conversio
Err(err) if err.kind() == std::io::ErrorKind::NotFound => true, Err(err) if err.kind() == std::io::ErrorKind::NotFound => true,
Err(err) => { Err(err) => {
return Err(err).with_context(|| { return Err(err).with_context(|| {
format!("unable to get mtime for to file {}", to.display()) format!("Unable to get mtime for \"to\" file {}", to.display())
}) })
} }
} }
@@ -147,15 +150,15 @@ async fn main() -> Result<()> {
let main_handle = async move { let main_handle = async move {
let ok = task::spawn_local(main_loop(ui_queue)) let ok = task::spawn_local(main_loop(ui_queue))
.await .await
.context("main task failed")??; .context("Main task failed")??;
Result::<_>::Ok(ok) Result::<_>::Ok(ok)
}; };
let ui_handle = async move { let ui_handle = async move {
let ok = task::spawn_local(ui_fut) let ok = task::spawn_local(ui_fut)
.await .await
.context("ui task failed")? .context("Ui task failed")?
.context("ui failed")?; .context("Ui failed")?;
Result::<_>::Ok(ok) Result::<_>::Ok(ok)
}; };
@@ -168,20 +171,20 @@ async fn main() -> Result<()> {
async fn main_loop(ui_queue: ui::MsgQueue) -> Result<()> { async fn main_loop(ui_queue: ui::MsgQueue) -> Result<()> {
let (config, conv_args) = task::spawn_blocking(|| -> Result<_> { let (config, conv_args) = task::spawn_blocking(|| -> Result<_> {
gstreamer::init()?; gstreamer::init()?;
let config = config::config().context("could not get the config")?; let config = config::config().context("Could not get the config")?;
let conv_args = get_conversion_args(&config) let conv_args = get_conversion_args(&config)
.collect::<Result<Vec<_>>>() .collect::<Result<Vec<_>>>()
.context("failed loading dir structure")?; .context("Failed loading dir structure")?;
Ok((config, conv_args)) Ok((config, conv_args))
}) })
.await .await
.context("init task failed")??; .context("Init task failed")??;
let log_path = Path::new(".") let log_path = Path::new(".")
.canonicalize() .canonicalize()
.context("unable to canonicalize path to log file")? .context("Unable to canonicalize path to log file")?
.join("audio-conv.log"); .join("audio-conv.log");
ui_queue.push(ui::Msg::Init { ui_queue.push(ui::Msg::Init {
@@ -189,9 +192,11 @@ async fn main_loop(ui_queue: ui::MsgQueue) -> Result<()> {
log_path: log_path.clone(), log_path: log_path.clone(),
}); });
let concurrent_jobs = config.jobs.unwrap_or_else(|| num_cpus::get());
stream::iter(conv_args.into_iter().enumerate()) stream::iter(conv_args.into_iter().enumerate())
.map(Ok) .map(Ok)
.try_for_each_concurrent(num_cpus::get(), |(i, args)| { .try_for_each_concurrent(concurrent_jobs, |(i, args)| {
let config = &config; let config = &config;
let ui_queue = &ui_queue; let ui_queue = &ui_queue;
let log_path = &log_path; let log_path = &log_path;
@@ -206,7 +211,7 @@ async fn main_loop(ui_queue: ui::MsgQueue) -> Result<()> {
Ok(()) => ui_queue.push(ui::Msg::TaskEnd { id: i }), Ok(()) => ui_queue.push(ui::Msg::TaskEnd { id: i }),
Err(err) => { Err(err) => {
let err = err.context(format!( let err = err.context(format!(
"failed transcoding \"{}\"", "Transcoding failed for {}",
args.rel_from_path.display() args.rel_from_path.display()
)); ));
@@ -264,15 +269,64 @@ async fn transcode(
) -> Result<()> { ) -> Result<()> {
let from_path = config.from.join(&args.rel_from_path); let from_path = config.from.join(&args.rel_from_path);
let mut to_path = config.to.join(&args.rel_from_path); let mut to_path = config.to.join(&args.rel_from_path);
to_path.set_extension(args.transcode.extension());
let file_src: Element = gmake("filesrc")?; fs::create_dir_all(
file_src.set_property("location", &path_to_gstring(&from_path))?; to_path
.parent()
.with_context(|| format!("Could not get parent dir for {}", to_path.display()))?,
)
.await?;
// encode into a tmp file first, then rename to actuall file name, that way we're writing // encode into a tmp file first, then rename to actuall file name, that way we're writing
// "whole" files to the intended file path, ignoring partial files in the mtime check // "whole" files to the intended file path, ignoring partial files in the mtime check
let to_path_tmp = to_path.with_extension("tmp"); let to_path_tmp = to_path.with_extension("tmp");
rm_file_on_err(&to_path_tmp, async {
match args.transcode {
Transcode::Copy => {
fs::copy(&from_path, &to_path_tmp).await.with_context(|| {
format!(
"Could not copy file from {} to {}",
from_path.display(),
to_path_tmp.display()
)
})?;
}
_ => {
to_path.set_extension(args.transcode.extension());
transcode_gstreamer(
&from_path,
&to_path_tmp,
args.transcode.clone(),
task_id,
queue,
)
.await?
}
}
fs::rename(&to_path_tmp, &to_path).await.with_context(|| {
format!(
"Could not rename temporary file {} to {}",
to_path_tmp.display(),
to_path.display()
)
})
})
.await
}
async fn transcode_gstreamer(
from_path: &Path,
to_path: &Path,
transcode: Transcode,
task_id: usize,
queue: &ui::MsgQueue,
) -> Result<()> {
let file_src: Element = gmake("filesrc")?;
file_src.set_property("location", &path_to_gstring(&from_path))?;
let decodebin: Element = gmake("decodebin")?; let decodebin: Element = gmake("decodebin")?;
let src_elems: &[&Element] = &[&file_src, &decodebin]; let src_elems: &[&Element] = &[&file_src, &decodebin];
@@ -285,10 +339,7 @@ async fn transcode(
// downgrade pipeline RC to a weak RC to break the reference cycle // downgrade pipeline RC to a weak RC to break the reference cycle
let pipeline_weak = pipeline.downgrade(); let pipeline_weak = pipeline.downgrade();
let transcode_args = args.transcode.clone(); let to_path_clone = to_path.to_owned();
let to_path_tmp_clone = to_path_tmp.clone();
decodebin.connect_pad_added(move |decodebin, src_pad| { decodebin.connect_pad_added(move |decodebin, src_pad| {
let insert_sink = || -> Result<()> { let insert_sink = || -> Result<()> {
let pipeline = match pipeline_weak.upgrade() { let pipeline = match pipeline_weak.upgrade() {
@@ -299,9 +350,9 @@ async fn transcode(
} }
}; };
let is_audio = src_pad.get_current_caps().and_then(|caps| { let is_audio = src_pad.current_caps().and_then(|caps| {
caps.get_structure(0).map(|s| { caps.structure(0).map(|s| {
let name = s.get_name(); let name = s.name();
name.starts_with("audio/") name.starts_with("audio/")
}) })
}); });
@@ -309,7 +360,7 @@ async fn transcode(
None => { None => {
return Err(Error::msg(format!( return Err(Error::msg(format!(
"Failed to get media type from pad {}", "Failed to get media type from pad {}",
src_pad.get_name() src_pad.name()
))); )));
} }
Some(false) => { Some(false) => {
@@ -329,8 +380,8 @@ async fn transcode(
gmake("audioconvert")?, gmake("audioconvert")?,
]; ];
match &transcode_args { match &transcode {
config::Transcode::Opus { Transcode::Opus {
bitrate, bitrate,
bitrate_type, bitrate_type,
} => { } => {
@@ -339,7 +390,7 @@ async fn transcode(
"bitrate", "bitrate",
&i32::from(*bitrate) &i32::from(*bitrate)
.checked_mul(1_000) .checked_mul(1_000)
.context("bitrate overflowed")?, .context("Bitrate overflowed")?,
)?; )?;
encoder.set_property_from_str( encoder.set_property_from_str(
"bitrate-type", "bitrate-type",
@@ -353,13 +404,13 @@ async fn transcode(
dest_elems.push(gmake("oggmux")?); dest_elems.push(gmake("oggmux")?);
} }
config::Transcode::Flac { compression } => { Transcode::Flac { compression } => {
let encoder: Element = gmake("flacenc")?; let encoder: Element = gmake("flacenc")?;
encoder.set_property_from_str("quality", &compression.to_string()); encoder.set_property_from_str("quality", &compression.to_string());
dest_elems.push(encoder); dest_elems.push(encoder);
} }
config::Transcode::Mp3 { Transcode::Mp3 {
bitrate, bitrate,
bitrate_type, bitrate_type,
} => { } => {
@@ -378,10 +429,15 @@ async fn transcode(
dest_elems.push(encoder); dest_elems.push(encoder);
dest_elems.push(gmake("id3v2mux")?); dest_elems.push(gmake("id3v2mux")?);
} }
Transcode::Copy => {
// already handled outside this fn
unreachable!();
}
}; };
let file_dest: gstreamer_base::BaseSink = gmake("filesink")?; let file_dest: gstreamer_base::BaseSink = gmake("filesink")?;
file_dest.set_property("location", &path_to_gstring(&to_path_tmp_clone))?; file_dest.set_property("location", &path_to_gstring(&to_path_clone))?;
file_dest.set_sync(false); file_dest.set_sync(false);
dest_elems.push(file_dest.upcast()); dest_elems.push(file_dest.upcast());
@@ -396,7 +452,7 @@ async fn transcode(
let sink_pad = dest_elems let sink_pad = dest_elems
.get(0) .get(0)
.unwrap() .unwrap()
.get_static_pad("sink") .static_pad("sink")
.expect("1. dest element has no sinkpad"); .expect("1. dest element has no sinkpad");
src_pad.link(&sink_pad)?; src_pad.link(&sink_pad)?;
@@ -408,7 +464,7 @@ async fn transcode(
.field("error", &GBoxErrorWrapper::new(err)) .field("error", &GBoxErrorWrapper::new(err))
.build(); .build();
gst_element_error!( element_error!(
decodebin, decodebin,
gstreamer::LibraryError::Failed, gstreamer::LibraryError::Failed,
("Failed to insert sink"), ("Failed to insert sink"),
@@ -417,16 +473,8 @@ async fn transcode(
} }
}); });
let bus = pipeline.get_bus().context("pipe get bus")?; let bus = pipeline.bus().context("Could not get bus for pipeline")?;
fs::create_dir_all(
to_path
.parent()
.with_context(|| format!("could not get parent dir for {}", to_path.display()))?,
)
.await?;
rm_file_on_err(&to_path_tmp, async {
pipeline pipeline
.set_state(gstreamer::State::Playing) .set_state(gstreamer::State::Playing)
.context("Unable to set the pipeline to the `Playing` state")?; .context("Unable to set the pipeline to the `Playing` state")?;
@@ -446,37 +494,43 @@ async fn transcode(
Ok(false) Ok(false)
} }
MessageView::Error(err) => { MessageView::Error(err) => {
pipeline.set_state(gstreamer::State::Null).context( let pipe_stop_res = pipeline.set_state(gstreamer::State::Null);
"Unable to set the pipeline to the `Null` state, after error",
)?;
let err = err let err: Error = err
.get_details() .details()
.and_then(|details| { .and_then(|details| {
if details.get_name() != "error-details" { if details.name() != "error-details" {
return None; return None;
} }
let err = details let err = details
.get::<&GBoxErrorWrapper>("error") .get::<&GBoxErrorWrapper>("error")
.unwrap() .unwrap()
.map(|err| err.clone().into()) .clone()
.expect("error-details message without actual error"); .into();
Some(err) Some(err)
}) })
.unwrap_or_else(|| { .unwrap_or_else(|| {
GErrorMessage { GErrorMessage {
src: msg src: msg
.get_src() .src()
.map(|s| String::from(s.get_path_string())) .map(|s| String::from(s.path_string()))
.unwrap_or_else(|| String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().to_string(), error: err.error().to_string(),
debug: err.get_debug(), debug: err.debug(),
source: err.get_error(), source: err.error(),
} }
.into() .into()
}); });
if let Err(pipe_err) = pipe_stop_res {
let err = err.context(pipe_err).context(
"Unable to set the pipeline to the `Null` state, after error",
);
Err(err) Err(err)
} else {
Err(err)
}
} }
_ => Ok(true), _ => Ok(true),
} }
@@ -489,8 +543,7 @@ async fn transcode(
} }
}) })
.try_for_each(|_| futures::future::ready(Ok(()))) .try_for_each(|_| futures::future::ready(Ok(())))
.await .await?;
.context("failed converting")?;
Result::<_>::Ok(()) Result::<_>::Ok(())
}; };
@@ -505,7 +558,7 @@ async fn transcode(
let dur = decodebin let dur = decodebin
.query_duration::<ClockTime>() .query_duration::<ClockTime>()
.and_then(|time| time.nanoseconds()); .map(|time| time.nseconds());
let ratio = dur.and_then(|dur| { let ratio = dur.and_then(|dur| {
if dur == 0 { if dur == 0 {
@@ -514,11 +567,11 @@ async fn transcode(
let pos = decodebin let pos = decodebin
.query_position::<ClockTime>() .query_position::<ClockTime>()
.and_then(|time| time.nanoseconds()); .map(|time| time.nseconds());
pos.map(|pos| { pos.map(|pos| {
let ratio = pos as f64 / dur as f64; let ratio = pos as f64 / dur as f64;
ratio.max(0.0).min(1.0) ratio.clamp(0.0, 1.0)
}) })
}); });
@@ -540,11 +593,7 @@ async fn transcode(
.set_state(gstreamer::State::Null) .set_state(gstreamer::State::Null)
.context("Unable to set the pipeline to the `Null` state")?; .context("Unable to set the pipeline to the `Null` state")?;
fs::rename(&to_path_tmp, &to_path).await?;
Ok(()) Ok(())
})
.await
} }
async fn rm_file_on_err<F, T>(path: &Path, f: F) -> Result<T> async fn rm_file_on_err<F, T>(path: &Path, f: F) -> Result<T>
@@ -558,7 +607,7 @@ where
Err(fs_err) => { Err(fs_err) => {
let err = err let err = err
.context(fs_err) .context(fs_err)
.context(format!("removing {} failed", path.display())); .context(format!("Removing file {} failed", path.display()));
Err(err) Err(err)
} }
}, },

View File

@@ -88,7 +88,7 @@ impl State {
Msg::TaskEnd { id } => { Msg::TaskEnd { id } => {
self.running_tasks self.running_tasks
.remove(&id) .remove(&id)
.context("unable to remove finished task; could't find task")?; .context("Unable to remove finished task; could't find task")?;
self.ended_tasks += 1; self.ended_tasks += 1;
} }
Msg::TaskProgress { id, ratio } => { Msg::TaskProgress { id, ratio } => {
@@ -102,7 +102,7 @@ impl State {
// TODO // TODO
self.running_tasks self.running_tasks
.remove(&id) .remove(&id)
.context("unable to remove errored task; could't find task")?; .context("Unable to remove errored task; could't find task")?;
self.ended_tasks += 1; self.ended_tasks += 1;
self.has_errored = true; self.has_errored = true;
} }
@@ -136,7 +136,7 @@ impl State {
running_tasks.sort_by_key(|task| task.id); running_tasks.sort_by_key(|task| task.id);
if !self.has_rendered { if !self.has_rendered {
self.terminal.clear().context("cleaning ui failed")?; self.terminal.clear().context("Clearing ui failed")?;
self.has_rendered = true; self.has_rendered = true;
} }
@@ -222,7 +222,7 @@ impl State {
chunks[1], chunks[1],
); );
}) })
.context("rendering ui failed")?; .context("Rendering ui failed")?;
Ok(()) Ok(())
} }
@@ -267,8 +267,8 @@ pub fn init() -> (MsgQueue, impl Future<Output = Result<()>>) {
} }
}) })
.await .await
.context("ui update task failed")? .context("Ui update task failed")?
.context("ui update failed")?; .context("Ui update failed")?;
match render_res { match render_res {
Some(s) => wrapped = Some(s), Some(s) => wrapped = Some(s),