From 0712a975e7846bb843012d2c926d60c813ac4334 Mon Sep 17 00:00:00 2001 From: liam Date: Thu, 18 Apr 2024 16:08:48 -0700 Subject: [PATCH] update macos docs --- .../capture_stream/struct.CaptureConfig.html | 2 +- .../capture_stream/struct.CaptureStream.html | 2 +- .../wgpu/enum.WgpuVideoFrameError.html | 4 ++-- .../wgpu/enum.WgpuVideoFramePlaneTexture.html | 6 +++--- .../crabgrab/feature/wgpu/index.html | 2 +- .../wgpu/trait.WgpuCaptureConfigExt.html | 6 +++--- .../wgpu/trait.WgpuCaptureStreamExt.html | 8 ++++---- .../feature/wgpu/trait.WgpuVideoFrameExt.html | 6 +++--- .../crabgrab/frame/struct.VideoFrame.html | 2 +- docs/macos_docs/crabgrab/index.html | 10 +++++----- .../src/crabgrab/feature/wgpu/mod.rs.html | 20 ++++++++++++++----- docs/macos_docs/src/crabgrab/lib.rs.html | 10 +++++----- 12 files changed, 44 insertions(+), 34 deletions(-) diff --git a/docs/macos_docs/crabgrab/capture_stream/struct.CaptureConfig.html b/docs/macos_docs/crabgrab/capture_stream/struct.CaptureConfig.html index 4b62cfe8..6ad83cd1 100644 --- a/docs/macos_docs/crabgrab/capture_stream/struct.CaptureConfig.html +++ b/docs/macos_docs/crabgrab/capture_stream/struct.CaptureConfig.html @@ -11,7 +11,7 @@

Higher numbers mean higher latency, but smoother performance

source

pub fn with_show_cursor(self, show_cursor: bool) -> Self

Configure whether the cursor is visible in the capture

source

pub fn with_output_size(self, output_size: Size) -> Self

Configure the output texture size - by default, this will match the captured content at the time of enumeration

-

Trait Implementations§

source§

impl Clone for CaptureConfig

source§

fn clone(&self) -> CaptureConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CaptureConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl MacosCaptureConfigExt for CaptureConfig

source§

fn with_scale_to_fit(self, scale_to_fit: bool) -> Self

source§

fn with_maximum_fps(self, maximum_fps: Option<f32>) -> Self

source§

fn with_metal_device(self, metal_device: Device) -> Self

source§

impl WgpuCaptureConfigExt for CaptureConfig

Trait Implementations§

source§

impl Clone for CaptureConfig

source§

fn clone(&self) -> CaptureConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CaptureConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl MacosCaptureConfigExt for CaptureConfig

source§

fn with_scale_to_fit(self, scale_to_fit: bool) -> Self

source§

fn with_maximum_fps(self, maximum_fps: Option<f32>) -> Self

source§

fn with_metal_device(self, metal_device: Device) -> Self

source§

impl WgpuCaptureConfigExt for CaptureConfig

source§

fn with_wgpu_device( self, wgpu_device: Arc<dyn AsRef<Device> + Send + Sync + 'static> ) -> Result<Self, String>

Supply a wgpu device to the config, allowing the generation of wgpu textures from video frames

diff --git a/docs/macos_docs/crabgrab/capture_stream/struct.CaptureStream.html b/docs/macos_docs/crabgrab/capture_stream/struct.CaptureStream.html index b0423d4f..0eb30b88 100644 --- a/docs/macos_docs/crabgrab/capture_stream/struct.CaptureStream.html +++ b/docs/macos_docs/crabgrab/capture_stream/struct.CaptureStream.html @@ -9,7 +9,7 @@ callback: impl FnMut(Result<StreamEvent, StreamError>) + Send + 'static ) -> Result<Self, StreamCreateError>

Start a new capture stream with the given stream callback

source

pub fn stop(&mut self) -> Result<(), StreamStopError>

Stop the capture

-

Trait Implementations§

source§

impl MetalCaptureStreamExt for CaptureStream

source§

fn get_metal_device(&self) -> Device

Get the metal device used for frame capture
source§

impl WgpuCaptureStreamExt for CaptureStream

source§

fn get_wgpu_device(&self) -> Option<&Device>

Gets the Wgpu device referenced by device wrapper supplied to CaptureConfig::with_wgpu_device(..)
source§

fn get_wgpu_device_wrapper( +

Trait Implementations§

source§

impl MetalCaptureStreamExt for CaptureStream

source§

fn get_metal_device(&self) -> Device

Get the metal device used for frame capture
source§

impl WgpuCaptureStreamExt for CaptureStream

source§

fn get_wgpu_device(&self) -> Option<&Device>

Gets the Wgpu device referenced by device wrapper supplied to CaptureConfig::with_wgpu_device(..)
source§

fn get_wgpu_device_wrapper( &self ) -> Option<Arc<dyn AsRef<Device> + Send + Sync + 'static>>

Gets the Wgpu device wrapper supplied to CaptureConfig::with_wgpu_device(..)
source§

impl Send for CaptureStream

Auto Trait Implementations§

§

impl !RefUnwindSafe for CaptureStream

§

impl !Sync for CaptureStream

§

impl Unpin for CaptureStream

§

impl !UnwindSafe for CaptureStream

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere diff --git a/docs/macos_docs/crabgrab/feature/wgpu/enum.WgpuVideoFrameError.html b/docs/macos_docs/crabgrab/feature/wgpu/enum.WgpuVideoFrameError.html index 3d69d701..24adb946 100644 --- a/docs/macos_docs/crabgrab/feature/wgpu/enum.WgpuVideoFrameError.html +++ b/docs/macos_docs/crabgrab/feature/wgpu/enum.WgpuVideoFrameError.html @@ -1,4 +1,4 @@ -WgpuVideoFrameError in crabgrab::feature::wgpu - Rust

Variants§

§

NoBackendTexture

the backend texture couldn’t be fetched

§

InvalidVideoPlaneTexture

The requested plane isn’t valid for this frame

§

NoWgpuDevice

No wgpu device

-
§

Other(String)

Trait Implementations§

source§

impl Clone for WgpuVideoFrameError

source§

fn clone(&self) -> WgpuVideoFrameError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WgpuVideoFrameError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for WgpuVideoFrameError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for WgpuVideoFrameError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +

§

Other(String)

Trait Implementations§

source§

impl Clone for WgpuVideoFrameError

source§

fn clone(&self) -> WgpuVideoFrameError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WgpuVideoFrameError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for WgpuVideoFrameError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for WgpuVideoFrameError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for WgpuVideoFrameError

§

impl Send for WgpuVideoFrameError

§

impl Sync for WgpuVideoFrameError

§

impl Unpin for WgpuVideoFrameError

§

impl UnwindSafe for WgpuVideoFrameError

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/docs/macos_docs/crabgrab/feature/wgpu/enum.WgpuVideoFramePlaneTexture.html b/docs/macos_docs/crabgrab/feature/wgpu/enum.WgpuVideoFramePlaneTexture.html index 1cd93961..c79999dd 100644 --- a/docs/macos_docs/crabgrab/feature/wgpu/enum.WgpuVideoFramePlaneTexture.html +++ b/docs/macos_docs/crabgrab/feature/wgpu/enum.WgpuVideoFramePlaneTexture.html @@ -1,4 +1,4 @@ -WgpuVideoFramePlaneTexture in crabgrab::feature::wgpu - Rust

Variants§

§

Rgba

The single RGBA plane for an RGBA format frame

§

Luminance

The Luminance (brightness) plane for a YCbCr format frame

§

Chroma

The Chroma (red/blue) plane for a YCbCr format frame

-

Trait Implementations§

source§

impl Clone for WgpuVideoFramePlaneTexture

source§

fn clone(&self) -> WgpuVideoFramePlaneTexture

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WgpuVideoFramePlaneTexture

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for WgpuVideoFramePlaneTexture

source§

fn eq(&self, other: &WgpuVideoFramePlaneTexture) -> bool

This method tests for self and other values to be equal, and is used +

Trait Implementations§

source§

impl Clone for WgpuVideoFramePlaneTexture

source§

fn clone(&self) -> WgpuVideoFramePlaneTexture

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WgpuVideoFramePlaneTexture

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for WgpuVideoFramePlaneTexture

source§

fn eq(&self, other: &WgpuVideoFramePlaneTexture) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for WgpuVideoFramePlaneTexture

source§

impl Eq for WgpuVideoFramePlaneTexture

source§

impl StructuralEq for WgpuVideoFramePlaneTexture

source§

impl StructuralPartialEq for WgpuVideoFramePlaneTexture

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +sufficient, and should not be overridden without very good reason.

source§

impl Copy for WgpuVideoFramePlaneTexture

source§

impl Eq for WgpuVideoFramePlaneTexture

source§

impl StructuralEq for WgpuVideoFramePlaneTexture

source§

impl StructuralPartialEq for WgpuVideoFramePlaneTexture

Auto Trait Implementations§

§

impl RefUnwindSafe for WgpuVideoFramePlaneTexture

§

impl Send for WgpuVideoFramePlaneTexture

§

impl Sync for WgpuVideoFramePlaneTexture

§

impl Unpin for WgpuVideoFramePlaneTexture

§

impl UnwindSafe for WgpuVideoFramePlaneTexture

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere diff --git a/docs/macos_docs/crabgrab/feature/wgpu/index.html b/docs/macos_docs/crabgrab/feature/wgpu/index.html index d59db3b7..126012c9 100644 --- a/docs/macos_docs/crabgrab/feature/wgpu/index.html +++ b/docs/macos_docs/crabgrab/feature/wgpu/index.html @@ -1 +1 @@ -crabgrab::feature::wgpu - Rust

Module crabgrab::feature::wgpu

source ·

Enums

Traits

\ No newline at end of file +crabgrab::feature::wgpu - Rust

Module crabgrab::feature::wgpu

source ·

Enums

Traits

\ No newline at end of file diff --git a/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuCaptureConfigExt.html b/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuCaptureConfigExt.html index 50869f1f..b7d3b4ed 100644 --- a/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuCaptureConfigExt.html +++ b/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuCaptureConfigExt.html @@ -1,11 +1,11 @@ -WgpuCaptureConfigExt in crabgrab::feature::wgpu - Rust
pub trait WgpuCaptureConfigExt: Sized {
+WgpuCaptureConfigExt in crabgrab::feature::wgpu - Rust
pub trait WgpuCaptureConfigExt: Sized {
     // Required method
     fn with_wgpu_device(
         self,
         device: Arc<dyn AsRef<Device> + Send + Sync + 'static>
     ) -> Result<Self, String>;
 }
Expand description

A capture config which can be supplied with a Wgpu device

-

Required Methods§

Required Methods§

source

fn with_wgpu_device( self, device: Arc<dyn AsRef<Device> + Send + Sync + 'static> -) -> Result<Self, String>

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file +) -> Result<Self, String>

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuCaptureStreamExt.html b/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuCaptureStreamExt.html index ee2e111d..33193005 100644 --- a/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuCaptureStreamExt.html +++ b/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuCaptureStreamExt.html @@ -1,12 +1,12 @@ -WgpuCaptureStreamExt in crabgrab::feature::wgpu - Rust
pub trait WgpuCaptureStreamExt {
+WgpuCaptureStreamExt in crabgrab::feature::wgpu - Rust
pub trait WgpuCaptureStreamExt {
     // Required methods
     fn get_wgpu_device_wrapper(
         &self
     ) -> Option<Arc<dyn AsRef<Device> + Send + Sync + 'static>>;
     fn get_wgpu_device(&self) -> Option<&Device>;
 }
Expand description

A capture stream which may have had a wgpu device instance supplied to it

-

Required Methods§

Required Methods§

source

fn get_wgpu_device_wrapper( &self ) -> Option<Arc<dyn AsRef<Device> + Send + Sync + 'static>>

Gets the Wgpu device wrapper supplied to CaptureConfig::with_wgpu_device(..)

-
source

fn get_wgpu_device(&self) -> Option<&Device>

Gets the Wgpu device referenced by device wrapper supplied to CaptureConfig::with_wgpu_device(..)

-

Implementors§

\ No newline at end of file +
source

fn get_wgpu_device(&self) -> Option<&Device>

Gets the Wgpu device referenced by device wrapper supplied to CaptureConfig::with_wgpu_device(..)

+

Implementors§

\ No newline at end of file diff --git a/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuVideoFrameExt.html b/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuVideoFrameExt.html index 6e0ca78a..4de8b3fa 100644 --- a/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuVideoFrameExt.html +++ b/docs/macos_docs/crabgrab/feature/wgpu/trait.WgpuVideoFrameExt.html @@ -1,4 +1,4 @@ -WgpuVideoFrameExt in crabgrab::feature::wgpu - Rust
pub trait WgpuVideoFrameExt {
+WgpuVideoFrameExt in crabgrab::feature::wgpu - Rust
pub trait WgpuVideoFrameExt {
     // Required method
     fn get_texture(
         &self,
@@ -6,9 +6,9 @@
         label: Option<&'static str>
     ) -> Result<Texture, WgpuVideoFrameError>;
 }
Expand description

A video frame which can be used to create wpgu textures

-

Required Methods§

Required Methods§

source

fn get_texture( &self, plane: WgpuVideoFramePlaneTexture, label: Option<&'static str> ) -> Result<Texture, WgpuVideoFrameError>

Get the texture for the given plane of the video frame

-

Implementors§

\ No newline at end of file +

Implementors§

\ No newline at end of file diff --git a/docs/macos_docs/crabgrab/frame/struct.VideoFrame.html b/docs/macos_docs/crabgrab/frame/struct.VideoFrame.html index 82eebf44..ff37db8e 100644 --- a/docs/macos_docs/crabgrab/frame/struct.VideoFrame.html +++ b/docs/macos_docs/crabgrab/frame/struct.VideoFrame.html @@ -10,7 +10,7 @@ &self, plane: MetalVideoFramePlaneTexture ) -> Result<Texture, MacosVideoFrameError>
Get the texture for the given plane of the video frame
source§

impl VideoFrameBitmap for VideoFrame

source§

fn get_bitmap(&self) -> Result<FrameBitmap, VideoFrameBitmapError>

Create a bitmap image from this frame. This usually involves a memory transfer from VRAM to system RAM, -and is an expensive operation.
source§

impl WgpuVideoFrameExt for VideoFrame

source§

fn get_texture( +and is an expensive operation.

source§

impl WgpuVideoFrameExt for VideoFrame

source§

fn get_texture( &self, plane: WgpuVideoFramePlaneTexture, label: Option<&'static str> diff --git a/docs/macos_docs/crabgrab/index.html b/docs/macos_docs/crabgrab/index.html index e248800d..ba71e1de 100644 --- a/docs/macos_docs/crabgrab/index.html +++ b/docs/macos_docs/crabgrab/index.html @@ -21,10 +21,10 @@

Example// run our capture code in an async context let future = runtime.spawn(async { // ensure we have priveleges to capture content - if !CaptureStream::test_access(false) { - CaptureStream::request_access(false).await; - println!("Approve access and run again!"); - } + let token = match CaptureStream::test_access(false) { + Some(token) => token, + None => CaptureStream::request_access(false).await.expect("Expected capture access") + }; // create a filter for the windows we're interested in capturing let window_filter = CapturableWindowFilter { desktop_windows: false, @@ -45,7 +45,7 @@

Example// create a captuere config using the first supported pixel format let config = CaptureConfig::with_window(window, CaptureStream::supported_pixel_formats()[0]).unwrap(); // create a capture stream with an event handler callback - let mut stream = CaptureStream::new(config, |stream_event| { + let mut stream = CaptureStream::new(token, config, |stream_event| { match stream_event { Ok(event) => { match event { diff --git a/docs/macos_docs/src/crabgrab/feature/wgpu/mod.rs.html b/docs/macos_docs/src/crabgrab/feature/wgpu/mod.rs.html index 6b6993c5..23423487 100644 --- a/docs/macos_docs/src/crabgrab/feature/wgpu/mod.rs.html +++ b/docs/macos_docs/src/crabgrab/feature/wgpu/mod.rs.html @@ -311,7 +311,13 @@ 311 312 313 -

use std::sync::Arc;
+314
+315
+316
+317
+318
+
use std::ffi::c_void;
+use std::sync::Arc;
 use std::{error::Error, fmt::Display};
 
 use crate::prelude::{CaptureConfig, CaptureStream, VideoFrame};
@@ -364,7 +370,7 @@
         {
             unsafe {
                 if let Some(d3d11_device) = 
-                    AsRef::as_ref(&*device).as_hal::<wgpu::hal::api::Dx12, _, _>(move |device| {
+                    AsRef::<wgpu::Device>::as_ref(&*wgpu_device).as_hal::<wgpu::hal::api::Dx12, _, _>(move |device| {
                         device.map(|device| {
                             device.raw_device().AddRef();
                             let raw_device_ptr = device.raw_device().as_mut_ptr() as *mut c_void;
@@ -398,7 +404,7 @@
                         Ok(Self {
                             impl_capture_config: WindowsCaptureConfig {
                                 d3d11_device: Some(d3d11_device),
-                                wgpu_device: Some(device),
+                                wgpu_device: Some(wgpu_device),
                                 dxgi_adapter: Some(dxgi_adapter),
                                 ..self.impl_capture_config
                             },
@@ -616,12 +622,16 @@
 impl WgpuCaptureStreamExt for CaptureStream {
     fn get_wgpu_device(&self) -> Option<&wgpu::Device> {
         #[cfg(target_os = "macos")]
-        self.impl_capture_stream.wgpu_device.as_ref().map(|wgpu_device| AsRef::<wgpu::Device>::as_ref(wgpu_device.as_ref()))
+        { self.impl_capture_stream.wgpu_device.as_ref().map(|wgpu_device| AsRef::<wgpu::Device>::as_ref(wgpu_device.as_ref())) }
+        #[cfg(target_os = "windows")]
+        { self.impl_capture_stream.wgpu_device.as_ref().map(|wgpu_device| AsRef::<wgpu::Device>::as_ref(wgpu_device.as_ref())) }
     }
 
     fn get_wgpu_device_wrapper(&self) -> Option<Arc<dyn AsRef<wgpu::Device> + Send + Sync + 'static>> {
         #[cfg(target_os = "macos")]
-        self.impl_capture_stream.wgpu_device.clone()
+        { self.impl_capture_stream.wgpu_device.clone() }
+        #[cfg(target_os = "windows")]
+        { self.impl_capture_stream.wgpu_device.clone() }
     }
 }
 
\ No newline at end of file diff --git a/docs/macos_docs/src/crabgrab/lib.rs.html b/docs/macos_docs/src/crabgrab/lib.rs.html index 430be150..84bd71e2 100644 --- a/docs/macos_docs/src/crabgrab/lib.rs.html +++ b/docs/macos_docs/src/crabgrab/lib.rs.html @@ -116,10 +116,10 @@ //! // run our capture code in an async context //! let future = runtime.spawn(async { //! // ensure we have priveleges to capture content -//! if !CaptureStream::test_access(false) { -//! CaptureStream::request_access(false).await; -//! println!("Approve access and run again!"); -//! } +//! let token = match CaptureStream::test_access(false) { +//! Some(token) => token, +//! None => CaptureStream::request_access(false).await.expect("Expected capture access") +//! }; //! // create a filter for the windows we're interested in capturing //! let window_filter = CapturableWindowFilter { //! desktop_windows: false, @@ -140,7 +140,7 @@ //! // create a captuere config using the first supported pixel format //! let config = CaptureConfig::with_window(window, CaptureStream::supported_pixel_formats()[0]).unwrap(); //! // create a capture stream with an event handler callback -//! let mut stream = CaptureStream::new(config, |stream_event| { +//! let mut stream = CaptureStream::new(token, config, |stream_event| { //! match stream_event { //! Ok(event) => { //! match event {