Adapt the self-join check and worker event lifetime from RustAudio/cpal#1187 (dccd6b464dc49267fa214ee168eb2b3c17a1ebf6). Keep shared OwnedHandle ownership so command submission also retains a valid event. Verify callback-thread destruction with a real WASAPI regression.
1. Add new feature `screencapturekit`.
2. Remove `unwrap()` in mod `screencapturekit`.
No all `unwrap()` in this crate are removed.
3. Add selector check before calling it.
Signed-off-by: fufesou <linlong1266@gmail.com>
Time to get list of WASAPI devices on my machine (5 devices in total) before change:
Input devices: 12 ms, output devices: 187 ms
After change:
Input devices: 1 ms, output devices: 1 ms
* Bump to version 0.12.
* Fix some cargo clippy lints.
* Partially revert temp_buffer_to_data to be closer to original.
* Suppress too many arguments lint.
## Description
This PR migrates the wasm example from an npm/webpack based approach to [trunk](https://trunkrs.dev/). Fixes#834.
Of note:
the `console_error_panic_hook` dependency was gated in `Cargo.toml` via `[target."cfg(debug_assertions)".dependencies]`. This is documented as nonfunctional and will throw a warning on build:
```
warning: Found `debug_assertions` in `target.'cfg(...)'.dependencies`.
This value is not supported for selecting dependencies and will not work as expected.
To learn more visit https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies
```
Since the actual usage of `console_error_panic_hook` is *also* gated in `lib.rs` behind `#[cfg(debug_assertions)]` it didn't make sense to have the cargo gate in place, hence I have removed it.
## Next steps
If this PR is merged, the [wiki page](https://github.com/RustAudio/cpal/wiki/Setting-up-a-new-CPAL-WASM-project) linked in the root README should be updated as well.
The standard library is using a similar implementation to parking_lot now. Other than APIs that are unstable, there shouldn't be that much of a reason to rely on parking_lot anymore. Parts of the cpal codebase already are using std locks. This PR removes the remaining parking_lot uses and replaces them with the standard library's.