forked from kekyo/FlashCap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObservableCaptureDeviceExtension.fs
More file actions
35 lines (26 loc) · 1.22 KB
/
Copy pathObservableCaptureDeviceExtension.fs
File metadata and controls
35 lines (26 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
////////////////////////////////////////////////////////////////////////////
//
// FlashCap - Independent camera capture library.
// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud)
//
// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0
//
////////////////////////////////////////////////////////////////////////////
namespace FlashCap
open System
open System.Threading
[<AutoOpen>]
module public ObservableCaptureDeviceExtension =
type public ObservableCaptureDevice with
member self.startAsync(?ct: CancellationToken) =
self.InternalStartAsync(asCT ct) |> Async.AwaitTask
member self.stopAsync(?ct: CancellationToken) =
self.InternalStopAsync(asCT ct) |> Async.AwaitTask
[<Obsolete("start method will be deprecated. Switch to use startAsync method.")>]
member self.start() =
self.InternalStartAsync(CancellationToken()) |> ignore
[<Obsolete("stop method will be deprecated. Switch to use stopAsync method.")>]
member self.stop() =
self.InternalStopAsync(CancellationToken()) |> ignore
member self.subscribe(observer: IObserver<PixelBufferScope>) =
self.InternalSubscribe(observer)