Skip to content

Commit

Permalink
rc6
Browse files Browse the repository at this point in the history
  • Loading branch information
l1npengtul committed Dec 19, 2022
1 parent 5900488 commit c65504a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nokhwa"
version = "0.10.0-rc.5"
version = "0.10.0-rc.6"
authors = ["l1npengtul <[email protected]>"]
edition = "2021"
description = "A Simple-to-use, cross-platform Rust Webcam Capture Library"
Expand Down Expand Up @@ -34,7 +34,7 @@ output-wgpu = ["wgpu", "nokhwa-core/wgpu-types"]
output-threaded = []
small-wasm = []
docs-only = ["input-native", "input-opencv", "input-jscam","output-wgpu", "output-threaded", "serialize"]
docs-nolink = ["opencv/docs-only"]
docs-nolink = ["opencv/docs-only", "nokhwa-core/docs-features"]
docs-features = []
test-fail-warning = []

Expand All @@ -43,7 +43,7 @@ thiserror = "1.0"
paste = "1.0"

[dependencies.nokhwa-core]
version = "0.1.0-rc.5"
version = "0.1.0-rc.6"
path = "nokhwa-core"

[dependencies.serde]
Expand Down Expand Up @@ -81,17 +81,17 @@ version = "0.8"
optional = true

[dependencies.nokhwa-bindings-windows]
version = "0.4.0-rc.5"
version = "0.4.0-rc.6"
path = "nokhwa-bindings-windows"
optional = true

[dependencies.nokhwa-bindings-macos]
version = "0.2.0-rc.5"
version = "0.2.0-rc.6"
path = "nokhwa-bindings-macos"
optional = true

[dependencies.nokhwa-bindings-linux]
version = "0.1.0-rc.5"
version = "0.1.0-rc.6"
path = "nokhwa-bindings-linux"
optional = true

Expand Down
4 changes: 2 additions & 2 deletions nokhwa-bindings-linux/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nokhwa-bindings-linux"
version = "0.1.0-rc.5"
version = "0.1.0-rc.6"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/l1npengtul/nokhwa"
Expand All @@ -11,7 +11,7 @@ keywords = ["v4l", "v4l2", "linux", "capture", "webcam"]
[dependencies]

[dependencies.nokhwa-core]
version = "0.1.0-rc.5"
version = "0.1.0-rc.6"
path = "../nokhwa-core"

[target.'cfg(target_os="linux")'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions nokhwa-bindings-macos/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nokhwa-bindings-macos"
version = "0.2.0-rc.5"
version = "0.2.0-rc.6"
edition = "2021"
authors = ["l1npengtul"]
license = "Apache-2.0"
Expand All @@ -13,7 +13,7 @@ keywords = ["avfoundation", "macos", "capture", "webcam"]


[dependencies.nokhwa-core]
version = "0.1.0-rc.5"
version = "0.1.0-rc.6"
path = "../nokhwa-core"

[target.'cfg(any(target_os="macos",target_os="ios"))'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions nokhwa-bindings-windows/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nokhwa-bindings-windows"
version = "0.4.0-rc.5"
version = "0.4.0-rc.6"
authors = ["l1npengtul"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -13,7 +13,7 @@ keywords = ["media-foundation", "windows", "capture", "webcam"]
[dependencies]

[dependencies.nokhwa-core]
version = "0.1.0-rc.5"
version = "0.1.0-rc.6"
path = "../nokhwa-core"

[target.'cfg(target_os="windows")'.dependencies.windows]
Expand Down
2 changes: 1 addition & 1 deletion nokhwa-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nokhwa-core"
version = "0.1.0-rc.5"
version = "0.1.0-rc.6"
authors = ["l1npengtul <[email protected]>"]
edition = "2021"
description = "Core type definitions for nokhwa"
Expand Down
9 changes: 6 additions & 3 deletions nokhwa-core/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Buffer {
}
/// Decodes a image with allocation using the provided [`FormatDecoder`] into a [`Mat`](https://docs.rs/opencv/latest/opencv/core/struct.Mat.html).
///
/// Note that this does a clone when creating the buffer, to decouple the lifetime of the internal data to the temporary Buffer. If you want to avoid this, please see [`decode_as_opencv_mat`](Self::decode_as_opencv_mat).
/// Note that this does a clone when creating the buffer, to decouple the lifetime of the internal data to the temporary Buffer. If you want to avoid this, please see [`decode_opencv_mat`](Self::decode_opencv_mat).
/// # Errors
/// Will error when the decoding fails, or `OpenCV` failed to create/copy the [`Mat`](https://docs.rs/opencv/latest/opencv/core/struct.Mat.html).
/// # Safety
Expand All @@ -113,7 +113,10 @@ impl Buffer {
/// Most notably, the `data` **must** stay in scope for the duration of the [`Mat`](https://docs.rs/opencv/latest/opencv/core/struct.Mat.html) or bad, ***bad*** things happen.
#[cfg(feature = "opencv-mat")]
#[cfg_attr(feature = "docs-features", doc(cfg(feature = "opencv-mat")))]
pub fn decode_opencv_mat<F: FormatDecoder>(&self) -> Result<opencv::core::Mat, NokhwaError> {
#[allow(clippy::cast_possible_wrap)]
pub fn decode_opencv_mat<F: FormatDecoder>(
&mut self,
) -> Result<opencv::core::Mat, NokhwaError> {
use image::Pixel;
use opencv::core::{Mat, Mat_AUTO_STEP, CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4};

Expand All @@ -137,7 +140,7 @@ impl Buffer {
self.resolution.height_y as i32,
self.resolution.width_x as i32,
array_type,
data.as_ref().as_mut_ptr().cast(),
self.buffer.as_ref().as_ptr().cast_mut().cast(),
Mat_AUTO_STEP,
)
.map_err(|why| NokhwaError::ProcessFrameError {
Expand Down
2 changes: 0 additions & 2 deletions nokhwa-core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,11 +1383,9 @@ pub enum ApiBackend {
Auto,
AVFoundation,
Video4Linux,
#[deprecated]
UniversalVideoClass,
MediaFoundation,
OpenCv,
#[deprecated]
GStreamer,
Network,
Browser,
Expand Down

0 comments on commit c65504a

Please sign in to comment.