Comments (9)
@mangoleaf @ahirner Actually, this issue still stands even to the date. I'm using M1 mac if that helps.
from nokhwa.
Same thing here, to fix (not tested thought) just do what the compiler says:
Line 230: bytes_per_row: Some(width_nonzero),
Line 231: rows_per_image: Some(height_nonzero),
from nokhwa.
Facing this issue as well
from nokhwa.
I think this can be closed after #142 and thus is duplicated by #141.
from nokhwa.
I agree that it can be closed, but it would also be nice if 0.10.5 crate was released so people don't have to pull directly from the git repo for the fix
from nokhwa.
@Kofituo The fix was merged in #142, but the rust crate was never released since. This worked for me when I checked out the latest code instead of trying to get the crate via crates.io. I am also on an M1 mac.
from nokhwa.
@mangoleaf @ahirner That's surprising. Here's my full project https://github.com/Kofituo/sample_gui/blob/master
Here's the full list of errors I'm facing. They're mostly syntax errors, among others:
// cargo run
Compiling nokhwa-core v0.2.0 (https://github.com/l1npengtul/nokhwa.git#f0bbbf32)
error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `:`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:20:35
|
20 | self.$name: Option<Range<$range_type>> = Some(Range {
| ^ expected one of 7 possible tokens
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `:`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:45:35
|
45 | self.$name: Option<Range<$range_type>> = Some(Range {
| ^ expected one of 7 possible tokens
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `:`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:60:35
|
60 | self.$name: Option<Range<$range_type>> = Some(Range {
| ^ expected one of 7 possible tokens
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `:`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:76:35
|
76 | self.$name: Option<Range<$range_type>> = Some(Range {
| ^ expected one of 7 possible tokens
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `:`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:91:35
|
91 | self.$name: Option<Range<$range_type>> = Some(Range {
| ^ expected one of 7 possible tokens
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `:`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:115:35
|
115 | self.$name: Option<Range<$range_type>> = Some(Range {
| ^ expected one of 7 possible tokens
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `;`, found keyword `Self`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:125:35
|
125 | self.$name = $name
| ^ help: add `;` here
126 | Self
| ---- unexpected token
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:14:46
|
14 | pub fn [< with_maximum_ $name >](mut self, $name: $range_type) -> Self {
| ^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:30:47
|
30 | pub fn [< reset_maximum_ $name >](mut self) -> Self {
| ^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:39:45
|
39 | pub fn [< set_maximum_ $name >](&mut self, $name: Option<$range_type>) {
| ^^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:54:48
|
54 | pub fn [< with_preferred_ $name >](mut self, $name: $range_type) -> Self {
| ^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:70:47
|
70 | pub fn [< set_preferred_ $name >](&mut self, $name: $range_type) {
| ^^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:85:46
|
85 | pub fn [< with_minimum_ $name >](mut self, $name: $range_type) -> Self {
| ^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:101:47
|
101 | pub fn [< reset_minimum_ $name >](mut self) -> Self {
| ^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:109:45
|
109 | pub fn [< set_minimum_ $name >](&mut self, $name: Option<$range_type>) {
| ^^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:124:45
|
124 | pub fn [< with_ $name _range >](mut self, $name: Option<Range<$range_type>>) -> Self {
| ^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `self` parameter is only allowed in associated functions
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:129:44
|
129 | pub fn [< set_ $name _range >](&mut self, $name: Option<Range<$range_type>>) {
| ^^^^^^^^^ not semantically valid as function parameter
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `serde`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/decoder.rs:3:5
|
3 | use serde::de::Error;
| ^^^^^ use of undeclared crate or module `serde`
error[E0432]: unresolved import `crate::frame_format::SourceFrameFormat`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/buffer.rs:17:13
|
17 | use crate::{frame_format::SourceFrameFormat, types::Resolution};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `SourceFrameFormat` in `frame_format`
error[E0432]: unresolved import `crate::frame_format::SourceFrameFormat`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:1:5
|
1 | use crate::frame_format::SourceFrameFormat;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `SourceFrameFormat` in `frame_format`
error[E0432]: unresolved imports `crate::format_request::FormatFilter`, `crate::frame_format::SourceFrameFormat`
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/traits.rs:20:5
|
20 | format_request::FormatFilter,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `FormatFilter` in `format_request`
21 | frame_format::SourceFrameFormat,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `SourceFrameFormat` in `frame_format`
error[E0412]: cannot find type `RgbAFormat` in this scope
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/buffer.rs:173:50
|
173 | let frame = self.frame()?.decode_image::<RgbAFormat>()?;
| ^^^^^^^^^^ not found in this scope
|
help: you might be missing a type parameter
|
162 | impl<RgbAFormat> Buffer {
| ++++++++++++
error[E0411]: cannot find type `Self` in this scope
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:14:79
|
14 | pub fn [< with_maximum_ $name >](mut self, $name: $range_type) -> Self {
| ------------------------- `Self` not allowed in a function ^^^^ `Self` is only available in impls, traits, and type definitions
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0411]: cannot find type `Self` in this scope
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:30:60
|
30 | pub fn [< reset_maximum_ $name >](mut self) -> Self {
| -------------------------- ^^^^ `Self` is only available in impls, traits, and type definitions
| |
| `Self` not allowed in a function
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0411]: cannot find type `Self` in this scope
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:54:81
|
54 | pub fn [< with_preferred_ $name >](mut self, $name: $range_type) -> Self {
| --------------------------- `Self` not allowed in a function ^^^^ `Self` is only available in impls, traits, and type definitions
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0411]: cannot find type `Self` in this scope
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:85:79
|
85 | pub fn [< with_minimum_ $name >](mut self, $name: $range_type) -> Self {
| ------------------------- `Self` not allowed in a function ^^^^ `Self` is only available in impls, traits, and type definitions
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0411]: cannot find type `Self` in this scope
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:101:60
|
101 | pub fn [< reset_minimum_ $name >](mut self) -> Self {
| -------------------------- ^^^^ `Self` is only available in impls, traits, and type definitions
| |
| `Self` not allowed in a function
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0411]: cannot find type `Self` in this scope
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:124:93
|
124 | pub fn [< with_ $name _range >](mut self, $name: Option<Range<$range_type>>) -> Self {
| ------------------------ `Self` not allowed in a function ^^^^ `Self` is only available in impls, traits, and type definitions
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `Self` in this scope
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/format_request.rs:126:17
|
126 | Self
| ^^^^ help: a local variable with a similar name exists (notice the capitalization): `self`
...
210 | range_set_fields!((Resolution, resolution), (u32, frame_rate),);
| --------------------------------------------------------------- in this macro invocation
|
= note: this error originates in the macro `range_set_fields` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0223]: ambiguous associated type
--> /Users/kofiotuo/.cargo/git/checkouts/nokhwa-66b597f0abb1b795/f0bbbf3/nokhwa-core/src/decoder.rs:14:37
|
14 | type Container: Deref<Target = [Pixel::Subpixel]>;
| ^^^^^^^^^^^^^^^
|
help: if there were a type named `Example` that implemented `Pixel`, you could use the fully-qualified path
|
14 | type Container: Deref<Target = [<Example as Pixel>::Subpixel]>;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some errors have detailed explanations: E0223, E0411, E0412, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0223`.
error: could not compile `nokhwa-core` (lib) due to 30 previous errors
from nokhwa.
@Kofituo I was facing the same issue on mac m1, but using the pull #142, commit "8987af8", It compiles fine on my machine.
from nokhwa.
@MohammadKurjieh I guess the crate just isn't updated ?
from nokhwa.
Related Issues (20)
- Wrong `frame_rate` on Windows HOT 5
- Multiple AVFoundation cameras on macOS panics with an NSException
- yuv422 confusions? HOT 2
- Compile issues on v4l2_pix_format in linux kernel 6.2 HOT 3
- Can't compile on archlinux 6.5.5-arch1-1 HOT 1
- Unable to access capture card on windows HOT 1
- Use AVCaptureDeviceTypeExternal on macOS
- what FrameFormat::GRAY is?
- Incorrect pixel format HOT 1
- AVFoundation backend is not passing the frame format HOT 1
- Meta: Current Status, Progress and Future Plans for this Project HOT 12
- Support for macOS continuity camera HOT 3
- Possible unsoundness HOT 1
- Switching devices leads to assertion failure at the device list. HOT 1
- threaded camera deadlock on stop stream HOT 1
- [Windows] Panic when no cams are connected
- [Request] BGR and GBR support HOT 1
- [Web] Update `jscam` example to function correctly in the latest version
- Build fails on multiple versions on Pop_OS! HOT 2
- v4l camera indexing isn't necessarily accurate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nokhwa.