[package]
name = "hwcodec"
description = "Realtime AV1 and VP9 video encoding and decoding: hardware encoders (NVENC, Quick Sync, AMF, VA-API) and software codecs (SVT-AV1, libvpx, dav1d) behind one interface"
version = "0.1.0"
edition = "2024"
rust-version = "1.90"
license = "MIT OR Apache-2.0"
repository = "https://github.com/Mumcord/hwcodec"
documentation = "https://docs.rs/hwcodec"
readme = "README.md"
keywords = ["av1", "vp9", "video", "encoder", "hardware"]
categories = ["multimedia::video", "multimedia::encoding"]
include = [
"/Cargo.toml",
"/README.md",
"/CHANGELOG.md",
"/LICENSE-APACHE",
"/LICENSE-MIT",
"/build.rs",
"/wrapper.h",
"/src/**",
"/examples/**",
"/tests/**",
"/vendor/**",
]
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[workspace]
members = ["sys/*"]
[features]
default = ["nvenc", "amf", "qsv", "vaapi", "svt-av1", "libvpx", "dav1d"]
nvenc = ["dep:bindgen"]
amf = ["dep:bindgen"]
qsv = ["dep:bindgen", "dep:pkg-config", "dep:hwcodec-libvpl-src", "dep:hwcodec-prebuilt-x86_64-pc-windows-msvc", "dep:sha2"]
vaapi = ["dep:bindgen"]
svt-av1 = ["dep:bindgen", "dep:pkg-config", "dep:hwcodec-svt-av1-src", "dep:hwcodec-prebuilt-x86_64-pc-windows-msvc", "dep:sha2"]
libvpx = ["dep:bindgen", "dep:pkg-config", "dep:hwcodec-libvpx-src", "dep:hwcodec-prebuilt-x86_64-pc-windows-msvc", "dep:sha2"]
dav1d = ["dep:bindgen", "dep:pkg-config", "dep:hwcodec-dav1d-src", "dep:hwcodec-prebuilt-x86_64-pc-windows-msvc", "dep:sha2"]
[dependencies]
log = "0.4"
thiserror = "2"
[target.'cfg(not(target_os = "macos"))'.dependencies]
libloading = "0.9"
[build-dependencies]
bindgen = { version = "0.73", optional = true }
pkg-config = { version = "0.3", optional = true }
hwcodec-libvpx-src = { version = "0.1.0", path = "sys/libvpx-src", optional = true }
hwcodec-svt-av1-src = { version = "0.1.0", path = "sys/svt-av1-src", optional = true }
hwcodec-dav1d-src = { version = "0.1.0", path = "sys/dav1d-src", optional = true }
hwcodec-libvpl-src = { version = "0.1.0", path = "sys/libvpl-src", optional = true }
[target.'cfg(all(target_os = "windows", target_arch = "x86_64", target_env = "msvc"))'.build-dependencies]
hwcodec-prebuilt-x86_64-pc-windows-msvc = { version = "0.1.0", path = "sys/prebuilt-x86_64-pc-windows-msvc", optional = true }
sha2 = { version = "0.10", optional = true }
[[test]]
name = "av1"
required-features = ["svt-av1", "dav1d", "libvpx"]
[[test]]
name = "codec"
required-features = ["libvpx"]
[[test]]
name = "temporal_channels"
required-features = ["svt-av1", "dav1d", "libvpx"]
[[test]]
name = "vaapi"
required-features = ["dav1d", "libvpx"]
[[test]]
name = "settings"
required-features = ["svt-av1", "dav1d", "libvpx"]
[[test]]
name = "fallback"
required-features = ["svt-av1", "dav1d", "libvpx"]
[[example]]
name = "encode_decode"
required-features = ["svt-av1", "dav1d", "libvpx"]
[[example]]
name = "encode_speed"
required-features = ["svt-av1", "libvpx"]
[lints.rust]
missing_docs = "warn"
unsafe_op_in_unsafe_fn = "warn"
[lints.clippy]
dbg_macro = "warn"
todo = "warn"
undocumented_unsafe_blocks = "warn"
unwrap_used = "warn"