[package]
name = "tvid"
version = "0.2.5"
edition = "2024"
authors = ["copi143 <copi143@outlook.com>"]
license = "MIT OR Apache-2.0"
description = "A terminal video player"
keywords = ["video", "player", "terminal"]
categories = ["command-line-utilities", "multimedia"]
homepage = "https://github.com/copi143/tvid"
repository = "https://github.com/copi143/tvid"
readme = "README.md"

[profile.dev]
debug = true
opt-level = 2
lto = false
debug-assertions = true
overflow-checks = true
codegen-units = 16

[profile.release]
debug = false
opt-level = 3
lto = true
debug-assertions = false
overflow-checks = false
codegen-units = 1

[features]
default = [
  "ffmpeg",
  "i18n",
  "config",
  "audio",
  "video",
  "subtitle",
  "unicode",
  "unifont",
  "command",
]
ffmpeg = ["dep:av", "dep:avsys"] # 使用 ffmpeg 进行视频解码 (目前只支持这一个解码器)
i18n = ["dep:sys-locale", "dep:static-l10n"] # 支持多语言界面
sixel = [] # 支持 sixel 终端图像协议
osc1337 = ["dep:base64", "dep:jpeg-encoder"] # 支持 osc1337 终端图像协议
config = ["dep:serde", "dep:toml_edit"] # WIP
audio = ["dep:cpal"] # 支持音频播放
video = [] # 支持视频显示
subtitle = [] # 支持字幕渲染
unicode = ["dep:unicode-width"] # 支持渲染 Unicode 宽字符
unifont = [] # 在终端字体过小时使用盲文字符打印 Unifont 字体
command = [] # 支持命令输入
ssh = ["dep:russh"] # WIP

[package.metadata.static-l10n]
path = "lang"
base = "en-us"
langs = [
  "en-us",
  "zh-cn",
  "zh-tw",
  "ja-jp",
  "fr-fr",
  "de-de",
  "es-es",
  "ko-kr",
  "pt-br",
  "ru-ru",
  "it-it",
  "tr-tr",
  "vi-vn",
]

[dependencies]
static-l10n = { version = "0.0.2", optional = true }
data-classes = { version = "0.0.0-17", features = ["serde"] }
anyhow = "1.0.102"
tokio = { version = "1.52.2", features = ["rt-multi-thread", "time", "sync"] }
parking_lot = "0.12.5"
avsys = { version = "8.1.0", optional = true, package = "ffmpeg-sys-next" }
av = { version = "8.1.0", optional = true, package = "ffmpeg-next" }
cpal = { version = "0.17.3", optional = true }
unicode-width = { version = "0.2.2", optional = true }
chrono = { version = "0.4.44", default-features = false, features = ["clock"] }
base64 = { version = "0.22.1", optional = true }
jpeg-encoder = { version = "0.7.0", optional = true }
shellexpand = "3.1.2"
serde = { version = "1.0.228", features = ["derive"], optional = true }
toml_edit = { version = "0.25.11", features = ["serde"], optional = true }
clap = { version = "4.6.1", features = ["derive"] }
sys-locale = { version = "0.3.2", optional = true }
russh = { version = "0.60.2", optional = true }

[target.'cfg(unix)'.dependencies]
libc = "0.2.186"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = [
  "std",
  "winbase",
  "processenv",
  "winnt",
  "wincon",
  "consoleapi",
] }
