spacedrive/crates/crypto/Cargo.toml
Vítor Vasconcellos e797b02e65
Media metadata extraction & Thumbnailer rework (#2285)
* initial ffprobe commit

* Working slim down version ffprobe

* Auto format ffprobe and deps source

* Remove show_pixel_formats logic
- Fix do_bitexact incorrect check in main after last changes
- Fix some clangd warning

* Remove show_* and print_format options and their respective logic

* Rework ffprobe into simple_ffprobe
- Simplify ffprobe logic into a simple program that gather and print a media file metadata

* Reduce the amount of ffmpeg log messages while generating thumbnails

* Fix completly wrong comments

* mend

* Start modeling ffmpeg extracted metadata on schema
 - Start porting ffprobe code to rust
 - Rename some references to media_data to exif_data

* Finish modeling media info data
 - Add MediaProgram, MediaStream, MediaCodec, MediaVideoProps, MediaAudioProps, MediaSubtitleProps to Schema
 - Fix simple_ffproble to use its custom print_codec, instead of ffmpeg's impl

* Add relation between MediaInfo and FilePath
 - Remove shared properties from MediaInfo and related structs
 - Implement Iterator for FFmpegDict

* Fix and update schema

* Data models and start populating MediaInfo in rust

* Finish populating media info, chapters and program

* Improve FFmpegFormatContext data raw pointer access
 - Implement stream data gathering

* Impl FFmpegCodecContext, retrieve codec information
 - Improve some unsafe pointer uses
 - Impl from FFmpegFormatContext to MediaInfo conversion

* Fix FFmpegDict Drop

* Fix some crago warnings

* Impl retrieval of video props
 - Fix C char* to Rust String convertion

* Impl retrieval of audio and subtitle props
 - Fill props for MediaCodec

* Remove simple_ffprobe now that the Rust impl is done

* Fix schema to match actually retrieved media info
 - Fix import some FFmpeg constants instead of directly using values

* Rework movie_decoder
 - Re-implement create_scale_string and add support anamorphic video
 - Improve C pointer access for FFmpegFormatContext and FFmpegCodecContext
 - Use newer FFmpeg abstractions in movie_decoder

* Fix incorrect props when initializing MovieDecoder

* Remove unecessary lifetimes

* Added more native wrappers for some FFmpeg native objects used in movie_decoder

* Remove FFmpegPacket
 - Some more improvements to movie_decoder

* WIP

* Some small fixes

* More fixes
Rename movie_decoder to frame_decoder
Remove more references to film_strips

* fmt

* Fix duplicate migration for job error changes

* fix rebase

* Solving segfaults, fuck C lang

Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com>

* Update rust to version 1.77
 - Pin rust version with rust-toolchain.toml
 - Change from dtolnay/rust-toolchain to IronCoreLabs/rust-toolchain for rust-toolchain support
 - Remove unused function and imports
 - Replace most CString uses with new c literal string

* More segfault solving and other minor fixes

Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com>

* Fix ffmpeg rotation filter breaking portrait video thumbnails #2150
 - Plus some other misc fixes

* Auto format

* Retrieve video/audio metadata on frontend

* Auto format

* First draft on ffmpeg data save on db

Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com>

* Fix some incorrect changes to prisma schema

* Some fixes for the FFmpegData schema
 - Expand logic to save FFmpegData to db

* A ton of things

Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com>

* Integrating ffmpeg media data in jobs and API

* Rspc can't BigInt

* 🙄

* Add initial ffmpeg metadata entries to Inspector
 - Fix ephemeral metadata api to match the files metadata api call

* Fix Inspector not showing ffmpeg metadata

* Add bitrate, start time and chapters video metadata to Inspector
- Fix backend BigInt conversion incorrectly using i32 instead of u32
- Change FFmpegFormatContext/FFmpegMetaData bit_rate to i64
- Rename byteSize to humanizeSize
- Expand humanizeSize logic to allow handling bits and Binary units
- Move capitalize to @sd/client utils

* Solving some issues

* Fix ffmpeg probe getting incorrect stream id and breaking database unique constraint
 - Fix humanizeSize breaking when receiving floating numbers
 - Fix incorrect equality in StatCard
 - Fix unhandled error in Dialog when trying to remove an unknown dialog

* fmt

* small improvements
 - Remove some unecessary recursion_limit directive
 - Remove unused app_image releated functions
 - Fix metadata query enabled flag

* Add migration for ffmpeg media data

* Fix cypress test

* Requested changes

* Implement feedback
 - Update locale keys for all languages
 - Add pnpm command to update all language keys

* Fix thumb reactivity in non indexed locations

---------

Co-authored-by: Ericson Soares <ericson.ds999@gmail.com>
Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com>
2024-05-09 02:20:28 +00:00

150 lines
3.5 KiB
TOML

[package]
name = "sd-crypto"
rust-version = "1.72"
version = "0.0.0"
authors = ["Jake Robinson <jake@spacedrive.com>"]
description = """
A cryptographic library that provides safe and high-level
encryption, hashing, and encoding interfaces.
"""
readme = "README.md"
keywords = ["crypto"]
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
[features]
sys = []
serde = [
"dep:serde",
"dep:serde_json",
"dep:serde-big-array",
"dep:serdect",
"bincode/serde",
]
keyring = ["dep:linux-keyutils", "dep:security-framework"]
secret-service = [
"keyring",
"dep:secret-service",
"dep:zbus",
] # explicit enabling required as the secret service api requires `zbus` and is messy
experimental = []
[dependencies]
# rng
rand_core = "0.9.0-alpha.0"
rand = "0.9.0-alpha.0"
rand_chacha = "0.9.0-alpha.0"
# hashing
argon2 = { version = "0.6.0-pre.0", default_features = false, features = [
"alloc",
"zeroize",
] }
balloon-hash = { version = "0.5.0-pre.0", default_features = false, features = [
"alloc",
"zeroize",
] }
blake3 = { version = "1.5.0", features = ["traits-preview", "zeroize"] }
# constant time
cmov = "0.3.1"
# aeads
aes-gcm-siv = "0.11.1"
chacha20poly1305 = "0.10.1"
thiserror = "1.0.57"
aead = { version = "0.5.2", default-features = false, features = ["stream"] }
bincode = { version = "2.0.0-rc.3", features = ["derive", "alloc"] }
zeroize = { version = "1.7.0", features = ["derive", "aarch64"] }
serde = { version = "1.0.197", features = ["derive"], optional = true }
serde_json = { version = "1.0.114", optional = true }
serde-big-array = { version = "0.5.1", optional = true }
serdect = { version = "0.3.0-pre.0", optional = true }
specta = { workspace = true, optional = true }
# for asynchronous crypto
tokio = { workspace = true, features = [
"io-util",
"rt-multi-thread",
"macros",
"sync",
], optional = true }
redb = "1.5.0"
hex = "0.4.3"
uuid = { version = "1.7.0", features = ["v4"] }
# ed25519-dalek = { version = "2.1.1", feature = ["std", "zeroize"] }
# x25519-dalek = { version = "2.0.1", feature = [
# "std",
# "zeroize",
# ] } # ReusableSecrets feature may have to come out for X3DH
# linux OS keyring
[target.'cfg(target_os = "linux")'.dependencies]
linux-keyutils = { version = "0.2.4", features = ["std"], optional = true }
secret-service = { version = "3.0.1", features = [
"crypto-rust",
"rt-tokio-crypto-rust",
], optional = true }
# this needs to remain at versions < 4, as they made some changes and i can't get it
# to compile for the time being
zbus = { version = "4.0", default_features = false, features = [
"tokio",
"blocking",
], optional = true }
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
security-framework = { version = "2.9.2", optional = true }
[dev-dependencies]
criterion = "0.5.1"
paste = "1.0.14"
tempfile = "3.10.1"
[clippy]
allow = ["unwrap_in_tests"]
[[bench]]
path = "benches/crypto/aes-256-gcm-siv.rs"
name = "aes-256-gcm-siv"
harness = false
[[bench]]
path = "benches/crypto/xchacha20-poly1305.rs"
name = "xchacha20-poly1305"
harness = false
[[bench]]
path = "benches/hashing/argon2id.rs"
name = "argon2id"
bench = false
harness = false
[[bench]]
path = "benches/hashing/blake3-balloon.rs"
name = "blake3-balloon"
bench = false
harness = false
[[bench]]
path = "benches/hashing/blake3.rs"
name = "blake3"
harness = false
[[bench]]
path = "benches/hashing/blake3-kdf.rs"
name = "blake3-kdf"
harness = false
[[example]]
path = "examples/file_encryption.rs"
name = "file_encryption"