This commit is contained in:
l1npengtul
2025-11-10 10:59:04 +09:00
parent a0a864c848
commit 6f5d4efac5
3 changed files with 143 additions and 94 deletions
+99 -58
View File
@@ -1,105 +1,130 @@
[package]
name = "nokhwa"
version = "0.10.9"
authors = ["l1npengtul <l1npengtul@protonmail.com>"]
edition = "2021"
name = "nokhwa"
version = "0.10.10"
authors = [ "l1npengtul <l1npengtul@protonmail.com>" ]
edition = "2021"
description = "A Simple-to-use, cross-platform Rust Webcam Capture Library"
keywords = ["camera", "webcam", "capture", "cross-platform"]
categories = ["api-bindings", "multimedia", "os", "web-programming"]
license = "Apache-2.0"
repository = "https://github.com/l1npengtul/nokhwa"
keywords = [ "camera", "webcam", "capture", "cross-platform" ]
categories = [ "api-bindings", "multimedia", "os", "web-programming" ]
license = "Apache-2.0"
repository = "https://github.com/l1npengtul/nokhwa"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[workspace]
members = ["nokhwa-bindings-macos", "nokhwa-bindings-windows", "nokhwa-bindings-linux", "nokhwa-core", "examples/*"]
exclude = ["examples/jscam"]
members = [
"nokhwa-bindings-macos",
"nokhwa-bindings-windows",
"nokhwa-bindings-linux",
"nokhwa-core",
"examples/*",
]
exclude = [ "examples/jscam" ]
[lib]
crate-type = ["cdylib", "rlib"]
crate-type = [ "cdylib", "rlib" ]
[features]
default = ["decoding"]
serialize = ["serde", "nokhwa-core/serialize"]
decoding = ["nokhwa-core/mjpeg"]
input-avfoundation = ["nokhwa-bindings-macos"]
input-msmf = ["nokhwa-bindings-windows"]
input-v4l = ["nokhwa-bindings-linux"]
default = [ "decoding" ]
serialize = [ "serde", "nokhwa-core/serialize" ]
decoding = [ "nokhwa-core/mjpeg" ]
input-avfoundation = [ "nokhwa-bindings-macos" ]
input-msmf = [ "nokhwa-bindings-windows" ]
input-v4l = [ "nokhwa-bindings-linux" ]
# Disable arena buffer on v4l
# This should fix crash on Raspberry Pi that have faulty v4l driver.
# WARNING: This create a performance regression, half of the frames will be dropped
# You shouldn't enable this unless you have to.
input-v4l-no-arena-buffer = ["nokhwa-bindings-linux/no-arena-buffer"]
input-native = ["input-avfoundation", "input-v4l", "input-msmf"]
input-v4l-no-arena-buffer = [ "nokhwa-bindings-linux/no-arena-buffer" ]
input-native = [ "input-avfoundation", "input-v4l", "input-msmf" ]
# Re-enable it once soundness has been proven + mozjpeg is updated to 0.9.x
# input-uvc = ["uvc", "uvc/vendor", "usb_enumeration", "lazy_static"]
input-opencv = ["opencv", "opencv/videoio", "opencv/rgb", "opencv/clang-runtime", "nokhwa-core/opencv-mat"]
input-jscam = ["web-sys", "js-sys", "wasm-bindgen-futures", "wasm-bindgen", "wasm-rs-async-executor"]
output-wgpu = ["wgpu", "nokhwa-core/wgpu-types"]
input-opencv = [
"opencv",
"opencv/videoio",
"opencv/rgb",
"opencv/clang-runtime",
"nokhwa-core/opencv-mat",
]
input-jscam = [
"web-sys",
"js-sys",
"wasm-bindgen-futures",
"wasm-bindgen",
"wasm-rs-async-executor",
]
output-wgpu = [ "wgpu", "nokhwa-core/wgpu-types" ]
#output-wasm = ["input-jscam"]
output-threaded = ["parking_lot", "camera-sync-impl"]
camera-sync-impl = []
small-wasm = []
docs-only = ["input-native", "input-opencv", "input-jscam","output-wgpu", "output-threaded", "serialize"]
docs-nolink = ["nokhwa-core/docs-features"]
docs-features = []
test-fail-warning = []
output-threaded = [ "parking_lot", "camera-sync-impl" ]
camera-sync-impl = [ ]
small-wasm = [ ]
docs-only = [
"input-native",
"input-opencv",
"input-jscam",
"output-wgpu",
"output-threaded",
"serialize",
]
docs-nolink = [ "nokhwa-core/docs-features" ]
docs-features = [ ]
test-fail-warning = [ ]
[dependencies]
thiserror = "2.0"
paste = "1.0"
flume = "0.11"
paste = "1.0"
flume = "0.11"
[dependencies.nokhwa-core]
version = "0.1"
path = "nokhwa-core"
path = "nokhwa-core"
[dependencies.serde]
version = "1.0"
version = "1.0"
optional = true
[dependencies.image]
version = "0.25"
version = "0.25"
default-features = false
[dependencies.usb_enumeration]
version = "0.2"
version = "0.2"
optional = true
[dependencies.wgpu]
version = "23"
version = "27"
optional = true
[dependencies.opencv]
version = "0.95"
version = "0.97"
default-features = false
optional = true
optional = true
[dependencies.rgb]
version = "0.8"
version = "0.8"
optional = true
[dependencies.nokhwa-bindings-windows]
version = "0.4"
path = "nokhwa-bindings-windows"
version = "0.4"
path = "nokhwa-bindings-windows"
optional = true
[dependencies.nokhwa-bindings-macos]
version = "0.2"
path = "nokhwa-bindings-macos"
version = "0.2"
path = "nokhwa-bindings-macos"
optional = true
[dependencies.nokhwa-bindings-linux]
version = "0.1"
path = "nokhwa-bindings-linux"
version = "0.1"
path = "nokhwa-bindings-linux"
optional = true
[dependencies.regex]
version = "1.7"
version = "1.12"
optional = true
[dependencies.parking_lot]
version = "0.12"
version = "0.12"
optional = true
[dependencies.web-sys]
@@ -110,33 +135,49 @@ features = [
"CssStyleDeclaration",
"Document",
"Element",
"HtmlElement", "HtmlVideoElement", "HtmlCanvasElement",
"HtmlElement",
"HtmlVideoElement",
"HtmlCanvasElement",
"ImageData",
"MediaDevices", "MediaDeviceInfo", "MediaDeviceKind", "MediaStreamConstraints", "MediaTrackSupportedConstraints", "MediaStream", "MediaStreamTrack", "MediaTrackSettings", "MediaTrackConstraints", "MediaStreamTrackState",
"MimeType", "MimeTypeArray",
"MediaDevices",
"MediaDeviceInfo",
"MediaDeviceKind",
"MediaStreamConstraints",
"MediaTrackSupportedConstraints",
"MediaStream",
"MediaStreamTrack",
"MediaTrackSettings",
"MediaTrackConstraints",
"MediaStreamTrackState",
"MimeType",
"MimeTypeArray",
"Navigator",
"Node",
"Permissions", "PermissionDescriptor", "PermissionState", "PermissionStatus",
"Plugin", "PluginArray",
"Window"
"Permissions",
"PermissionDescriptor",
"PermissionState",
"PermissionStatus",
"Plugin",
"PluginArray",
"Window",
]
optional = true
[dependencies.js-sys]
version = "0.3"
version = "0.3"
optional = true
[dependencies.wasm-bindgen]
version = "0.2"
version = "0.2"
optional = true
[dependencies.wasm-bindgen-futures]
version = "0.4"
version = "0.4"
optional = true
[dependencies.wasm-rs-async-executor]
version = "0.9"
version = "0.9"
optional = true
[package.metadata.docs.rs]
features = ["docs-only", "docs-nolink", "docs-features"]
features = [ "docs-only", "docs-nolink", "docs-features" ]
+21 -13
View File
@@ -1,28 +1,36 @@
[package]
name = "nokhwa-bindings-windows"
version = "0.4.4"
authors = ["l1npengtul"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/l1npengtul/nokhwa"
name = "nokhwa-bindings-windows"
version = "0.4.5"
authors = [ "l1npengtul" ]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/l1npengtul/nokhwa"
description = "The Windows Media Foundation bindings crate for `nokhwa`"
keywords = ["media-foundation", "windows", "capture", "webcam"]
keywords = [ "media-foundation", "windows", "capture", "webcam" ]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
docs-only = []
docs-only = [ ]
[dependencies]
once_cell = "1"
once_cell = "1"
[dependencies.nokhwa-core]
version = "0.1"
path = "../nokhwa-core"
path = "../nokhwa-core"
[target.'cfg(target_os="windows")'.dependencies.windows]
version = "0.61"
features = ["Win32_Media_MediaFoundation", "Win32_System_Com", "Win32_Foundation", "Win32_Media_DirectShow", "Win32_Media", "Win32", "Win32_Media_KernelStreaming"]
version = "0.62"
features = [
"Win32_Media_MediaFoundation",
"Win32_System_Com",
"Win32_Foundation",
"Win32_Media_DirectShow",
"Win32_Media",
"Win32",
"Win32_Media_KernelStreaming",
]
[package.metadata.docs.rs]
features = ["docs-only"]
features = [ "docs-only" ]
+23 -23
View File
@@ -1,52 +1,52 @@
[package]
name = "nokhwa-core"
version = "0.1.7"
authors = ["l1npengtul <l1npengtul@protonmail.com>"]
edition = "2021"
name = "nokhwa-core"
version = "0.1.8"
authors = [ "l1npengtul <l1npengtul@protonmail.com>" ]
edition = "2021"
description = "Core type definitions for nokhwa"
keywords = ["camera", "webcam", "capture", "cross-platform"]
license = "Apache-2.0"
repository = "https://github.com/l1npengtul/nokhwa"
keywords = [ "camera", "webcam", "capture", "cross-platform" ]
license = "Apache-2.0"
repository = "https://github.com/l1npengtul/nokhwa"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = []
serialize = ["serde"]
wgpu-types = ["wgpu"]
mjpeg = ["mozjpeg"]
opencv-mat = ["opencv", "opencv/clang-runtime", "bytemuck"]
docs-features = ["serialize", "wgpu-types", "mjpeg"]
test-fail-warnings = []
default = [ ]
serialize = [ "serde" ]
wgpu-types = [ "wgpu" ]
mjpeg = [ "mozjpeg" ]
opencv-mat = [ "opencv", "opencv/clang-runtime", "bytemuck" ]
docs-features = [ "serialize", "wgpu-types", "mjpeg" ]
test-fail-warnings = [ ]
[dependencies]
thiserror = "2.0"
bytes = "1.3"
bytes = "1.3"
[dependencies.image]
version = "0.25"
version = "0.25"
default-features = false
[dependencies.serde]
version = "1.0"
features = ["derive"]
version = "1.0"
features = [ "derive" ]
optional = true
[dependencies.wgpu]
version = "23"
version = "27"
optional = true
[dependencies.opencv]
version = "0.95"
version = "0.97"
optional = true
[dependencies.bytemuck]
version = "1"
version = "1"
optional = true
[dependencies.mozjpeg]
version = "0.10"
version = "0.10"
optional = true
[package.metadata.docs.rs]
features = ["docs-features"]
features = [ "docs-features" ]