Skip to content

Commit 93c85ce

Browse files
committed
Merge branch 'develop'
2 parents 854186a + a99a6d4 commit 93c85ce

File tree

57 files changed

+3072
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3072
-833
lines changed

.github/workflows/build.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on: [push]
44

55
jobs:
66
build:
7-
runs-on: windows-latest
7+
runs-on: ubuntu-latest
88
steps:
99

1010
#-----------------------------------------------------------------------
1111
# Checkout
1212

13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
1616
# lfs: true
@@ -20,16 +20,16 @@ jobs:
2020
- name: Extract branch name
2121
id: extract_branch_name
2222
run: |
23-
$branch_name=$(git name-rev --name-only --exclude=tags/* HEAD)
23+
export branch_name=`git name-rev --name-only --exclude=tags/* HEAD`
2424
echo "Detected current branch: ${branch_name}"
25-
echo "::set-output name=branch_name::${branch_name}"
25+
echo "branch_name=${branch_name}" >> $GITHUB_OUTPUT
2626
2727
#-----------------------------------------------------------------------
2828
# Setup environments
2929
# Setup environments
3030

3131
- name: Setup .NET
32-
uses: actions/setup-dotnet@v3
32+
uses: actions/setup-dotnet@v4
3333
with:
3434
dotnet-version: |
3535
2.2.x
@@ -66,14 +66,14 @@ jobs:
6666
- name: Deploy NuGet package (develop/ref1)
6767
if: startsWith( github.ref, 'refs/tags/' )
6868
run: |
69-
dotnet nuget push artifacts\FlashCap.*.nupkg --source ref1
70-
dotnet nuget push artifacts\FSharp.FlashCap.*.nupkg --source ref1
69+
dotnet nuget push artifacts/FlashCap.*.nupkg --source ref1
70+
dotnet nuget push artifacts/FSharp.FlashCap.*.nupkg --source ref1
7171
7272
#-----------------------------------------------------------------------
7373
# Deploy packages (main)
7474

7575
#- name: Deploy NuGet package (main/ref2)
7676
# if: (startsWith( github.ref, 'refs/tags/' )) && (endsWith(steps.extract_branch_name.outputs.branch_name, 'main'))
7777
# run: |
78-
# dotnet nuget push artifacts\FlashCap.*.nupkg --source ref1
79-
# dotnet nuget push artifacts\FSharp.FlashCap.*.nupkg --source ref1
78+
# dotnet nuget push artifacts/FlashCap.*.nupkg --source ref1
79+
# dotnet nuget push artifacts/FSharp.FlashCap.*.nupkg --source ref1

FSharp.FlashCap/CaptureDeviceDescriptorExtension.fs

Lines changed: 12 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module public CaptureDeviceDescriptorExtension =
3939
?ct: CancellationToken) : Async<CaptureDevice> =
4040
self.InternalOpenWithFrameProcessorAsync(
4141
characteristics, TranscodeFormats.Auto,
42-
new DelegatedQueuingProcessor(pixelBufferArrived, 1),
42+
new DelegatedQueuingProcessor(pixelBufferArrived, 1, self.defaultBufferPool),
4343
asCT ct) |> Async.AwaitTask
4444

4545
member self.openDevice(
@@ -50,7 +50,7 @@ module public CaptureDeviceDescriptorExtension =
5050
self.InternalOpenWithFrameProcessorAsync(
5151
characteristics,
5252
transcodeFormat,
53-
new DelegatedQueuingProcessor(pixelBufferArrived, 1),
53+
new DelegatedQueuingProcessor(pixelBufferArrived, 1, self.defaultBufferPool),
5454
asCT ct) |> Async.AwaitTask
5555

5656
member self.openDevice(
@@ -64,8 +64,8 @@ module public CaptureDeviceDescriptorExtension =
6464
characteristics,
6565
transcodeFormat,
6666
(match isScattering with
67-
| true -> (new DelegatedScatteringProcessor(pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)
68-
| false -> (new DelegatedQueuingProcessor(pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)),
67+
| true -> (new DelegatedScatteringProcessor(pixelBufferArrived, maxQueuingFrames, self.defaultBufferPool) :> FrameProcessor)
68+
| false -> (new DelegatedQueuingProcessor(pixelBufferArrived, maxQueuingFrames, self.defaultBufferPool) :> FrameProcessor)),
6969
asCT ct) |> Async.AwaitTask
7070

7171
//////////////////////////////////////////////////////////////////////////////////
@@ -77,7 +77,7 @@ module public CaptureDeviceDescriptorExtension =
7777
self.InternalOpenWithFrameProcessorAsync(
7878
characteristics,
7979
TranscodeFormats.Auto,
80-
new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, 1),
80+
new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, 1, self.defaultBufferPool),
8181
asCT ct) |> Async.AwaitTask
8282

8383
member self.openDevice(
@@ -88,7 +88,7 @@ module public CaptureDeviceDescriptorExtension =
8888
self.InternalOpenWithFrameProcessorAsync(
8989
characteristics,
9090
transcodeFormat,
91-
new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, 1),
91+
new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, 1, self.defaultBufferPool),
9292
asCT ct) |> Async.AwaitTask
9393

9494
member self.openDevice(
@@ -102,8 +102,8 @@ module public CaptureDeviceDescriptorExtension =
102102
characteristics,
103103
transcodeFormat,
104104
(match isScattering with
105-
| true -> (new DelegatedScatteringTaskProcessor(asTask pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)
106-
| false -> (new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)),
105+
| true -> (new DelegatedScatteringTaskProcessor(asTask pixelBufferArrived, maxQueuingFrames, self.defaultBufferPool) :> FrameProcessor)
106+
| false -> (new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, maxQueuingFrames, self.defaultBufferPool) :> FrameProcessor)),
107107
asCT ct) |> Async.AwaitTask
108108

109109
//////////////////////////////////////////////////////////////////////////////////
@@ -116,7 +116,7 @@ module public CaptureDeviceDescriptorExtension =
116116
characteristics,
117117
TranscodeFormats.Auto,
118118
(new DelegatedQueuingProcessor(
119-
new PixelBufferArrivedDelegate(observerProxy.OnPixelBufferArrived), 1)), asCT ct) |> Async.AwaitTask
119+
new PixelBufferArrivedDelegate(observerProxy.OnPixelBufferArrived), 1, self.defaultBufferPool)), asCT ct) |> Async.AwaitTask
120120
return new ObservableCaptureDevice(captureDevice, observerProxy)
121121
}
122122

@@ -129,7 +129,7 @@ module public CaptureDeviceDescriptorExtension =
129129
characteristics,
130130
transcodeFormat,
131131
(new DelegatedQueuingProcessor(
132-
new PixelBufferArrivedDelegate(observerProxy.OnPixelBufferArrived), 1)), asCT ct) |> Async.AwaitTask
132+
new PixelBufferArrivedDelegate(observerProxy.OnPixelBufferArrived), 1, self.defaultBufferPool)), asCT ct) |> Async.AwaitTask
133133
return new ObservableCaptureDevice(captureDevice, observerProxy)
134134
}
135135

@@ -145,8 +145,8 @@ module public CaptureDeviceDescriptorExtension =
145145
characteristics,
146146
transcodeFormat,
147147
(match isScattering with
148-
| true -> (new DelegatedScatteringProcessor(pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)
149-
| false -> (new DelegatedQueuingProcessor(pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)), asCT ct) |> Async.AwaitTask
148+
| true -> (new DelegatedScatteringProcessor(pixelBufferArrived, maxQueuingFrames, self.defaultBufferPool) :> FrameProcessor)
149+
| false -> (new DelegatedQueuingProcessor(pixelBufferArrived, maxQueuingFrames, self.defaultBufferPool) :> FrameProcessor)), asCT ct) |> Async.AwaitTask
150150
return new ObservableCaptureDevice(captureDevice, observerProxy)
151151
}
152152

@@ -168,163 +168,3 @@ module public CaptureDeviceDescriptorExtension =
168168
characteristics,
169169
transcodeFormat,
170170
asCT ct) |> Async.AwaitTask
171-
172-
//////////////////////////////////////////////////////////////////////////////////
173-
174-
[<Obsolete("This function is obsoleted, please use `openDevice` instead.")>]
175-
[<EditorBrowsable(EditorBrowsableState.Never)>]
176-
member self.openAsync(
177-
characteristics: VideoCharacteristics,
178-
pixelBufferArrived: PixelBufferScope -> unit,
179-
?ct: CancellationToken) : Async<CaptureDevice> =
180-
self.InternalOpenWithFrameProcessorAsync(
181-
characteristics, TranscodeFormats.Auto,
182-
new DelegatedQueuingProcessor(pixelBufferArrived, 1),
183-
asCT ct) |> Async.AwaitTask
184-
185-
[<Obsolete("This function is obsoleted, please use `openDevice` instead.")>]
186-
[<EditorBrowsable(EditorBrowsableState.Never)>]
187-
member self.openAsync(
188-
characteristics: VideoCharacteristics,
189-
transcodeIfYUV: bool,
190-
pixelBufferArrived: PixelBufferScope -> unit,
191-
?ct: CancellationToken) : Async<CaptureDevice> =
192-
self.InternalOpenWithFrameProcessorAsync(
193-
characteristics,
194-
toFormat transcodeIfYUV,
195-
new DelegatedQueuingProcessor(pixelBufferArrived, 1),
196-
asCT ct) |> Async.AwaitTask
197-
198-
[<Obsolete("This function is obsoleted, please use `openDevice` instead.")>]
199-
[<EditorBrowsable(EditorBrowsableState.Never)>]
200-
member self.openAsync(
201-
characteristics: VideoCharacteristics,
202-
transcodeIfYUV: bool,
203-
isScattering: bool,
204-
maxQueuingFrames: int,
205-
pixelBufferArrived: PixelBufferScope -> unit,
206-
?ct: CancellationToken) : Async<CaptureDevice> =
207-
self.InternalOpenWithFrameProcessorAsync(
208-
characteristics,
209-
toFormat transcodeIfYUV,
210-
(match isScattering with
211-
| true -> (new DelegatedScatteringProcessor(pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)
212-
| false -> (new DelegatedQueuingProcessor(pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)),
213-
asCT ct) |> Async.AwaitTask
214-
215-
//////////////////////////////////////////////////////////////////////////////////
216-
217-
[<Obsolete("This function is obsoleted, please use `openDevice` instead.")>]
218-
[<EditorBrowsable(EditorBrowsableState.Never)>]
219-
member self.openAsync(
220-
characteristics: VideoCharacteristics,
221-
pixelBufferArrived: PixelBufferScope -> Async<unit>,
222-
?ct: CancellationToken) : Async<CaptureDevice> =
223-
self.InternalOpenWithFrameProcessorAsync(
224-
characteristics,
225-
TranscodeFormats.Auto,
226-
new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, 1),
227-
asCT ct) |> Async.AwaitTask
228-
229-
[<Obsolete("This function is obsoleted, please use `openDevice` instead.")>]
230-
[<EditorBrowsable(EditorBrowsableState.Never)>]
231-
member self.openAsync(
232-
characteristics: VideoCharacteristics,
233-
transcodeIfYUV: bool,
234-
pixelBufferArrived: PixelBufferScope -> Async<unit>,
235-
?ct: CancellationToken) : Async<CaptureDevice> =
236-
self.InternalOpenWithFrameProcessorAsync(
237-
characteristics,
238-
toFormat transcodeIfYUV,
239-
new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, 1),
240-
asCT ct) |> Async.AwaitTask
241-
242-
[<Obsolete("This function is obsoleted, please use `openDevice` instead.")>]
243-
[<EditorBrowsable(EditorBrowsableState.Never)>]
244-
member self.openAsync(
245-
characteristics: VideoCharacteristics,
246-
transcodeIfYUV: bool,
247-
isScattering: bool,
248-
maxQueuingFrames: int,
249-
pixelBufferArrived: PixelBufferScope -> Async<unit>,
250-
?ct: CancellationToken) : Async<CaptureDevice> =
251-
self.InternalOpenWithFrameProcessorAsync(
252-
characteristics,
253-
toFormat transcodeIfYUV,
254-
(match isScattering with
255-
| true -> (new DelegatedScatteringTaskProcessor(asTask pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)
256-
| false -> (new DelegatedQueuingTaskProcessor(asTask pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)),
257-
asCT ct) |> Async.AwaitTask
258-
259-
//////////////////////////////////////////////////////////////////////////////////
260-
261-
[<Obsolete("This function is obsoleted, please use `asObservable` instead.")>]
262-
[<EditorBrowsable(EditorBrowsableState.Never)>]
263-
member self.asObservableAsync(
264-
characteristics: VideoCharacteristics,
265-
?ct: CancellationToken) : Async<ObservableCaptureDevice> = async {
266-
let observerProxy = new ObservableCaptureDevice.ObserverProxy()
267-
let! captureDevice = self.InternalOpenWithFrameProcessorAsync(
268-
characteristics,
269-
TranscodeFormats.Auto,
270-
(new DelegatedQueuingProcessor(
271-
new PixelBufferArrivedDelegate(observerProxy.OnPixelBufferArrived), 1)), asCT ct) |> Async.AwaitTask
272-
return new ObservableCaptureDevice(captureDevice, observerProxy)
273-
}
274-
275-
[<Obsolete("This function is obsoleted, please use `asObservable` instead.")>]
276-
[<EditorBrowsable(EditorBrowsableState.Never)>]
277-
member self.asObservableAsync(
278-
characteristics: VideoCharacteristics,
279-
transcodeIfYUV: bool,
280-
?ct: CancellationToken) : Async<ObservableCaptureDevice> = async {
281-
let observerProxy = new ObservableCaptureDevice.ObserverProxy()
282-
let! captureDevice = self.InternalOpenWithFrameProcessorAsync(
283-
characteristics,
284-
toFormat transcodeIfYUV,
285-
(new DelegatedQueuingProcessor(
286-
new PixelBufferArrivedDelegate(observerProxy.OnPixelBufferArrived), 1)), asCT ct) |> Async.AwaitTask
287-
return new ObservableCaptureDevice(captureDevice, observerProxy)
288-
}
289-
290-
[<Obsolete("This function is obsoleted, please use `asObservable` instead.")>]
291-
[<EditorBrowsable(EditorBrowsableState.Never)>]
292-
member self.asObservableAsync(
293-
characteristics: VideoCharacteristics,
294-
transcodeIfYUV: bool,
295-
isScattering: bool,
296-
maxQueuingFrames: int,
297-
?ct: CancellationToken) : Async<ObservableCaptureDevice> = async {
298-
let observerProxy = new ObservableCaptureDevice.ObserverProxy()
299-
let pixelBufferArrived = new PixelBufferArrivedDelegate(observerProxy.OnPixelBufferArrived)
300-
let! captureDevice = self.InternalOpenWithFrameProcessorAsync(
301-
characteristics,
302-
toFormat transcodeIfYUV,
303-
(match isScattering with
304-
| true -> (new DelegatedScatteringProcessor(pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)
305-
| false -> (new DelegatedQueuingProcessor(pixelBufferArrived, maxQueuingFrames) :> FrameProcessor)), asCT ct) |> Async.AwaitTask
306-
return new ObservableCaptureDevice(captureDevice, observerProxy)
307-
}
308-
309-
//////////////////////////////////////////////////////////////////////////////////
310-
311-
[<Obsolete("This function is obsoleted, please use `takeOneShot` instead.")>]
312-
[<EditorBrowsable(EditorBrowsableState.Never)>]
313-
member self.takeOneShotAsync(
314-
characteristics: VideoCharacteristics,
315-
?ct: CancellationToken) : Async<byte[]> =
316-
self.InternalTakeOneShotAsync(
317-
characteristics,
318-
TranscodeFormats.Auto,
319-
asCT ct) |> Async.AwaitTask
320-
321-
[<Obsolete("This function is obsoleted, please use `takeOneShot` instead.")>]
322-
[<EditorBrowsable(EditorBrowsableState.Never)>]
323-
member self.takeOneShotAsync(
324-
characteristics: VideoCharacteristics,
325-
transcodeIfYUV: bool,
326-
?ct: CancellationToken) : Async<byte[]> =
327-
self.InternalTakeOneShotAsync(
328-
characteristics,
329-
toFormat transcodeIfYUV,
330-
asCT ct) |> Async.AwaitTask

FSharp.FlashCap/CaptureDeviceExtension.fs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,3 @@ module public CaptureDeviceExtension =
2525

2626
member self.showPropertyPage(parentWindow: nativeint, ?ct: CancellationToken) =
2727
self.InternalShowPropertyPageAsync(parentWindow, asCT ct) |> Async.AwaitTask
28-
29-
[<Obsolete("This function is obsoleted, please use `start` instead.")>]
30-
member self.startAsync(?ct: CancellationToken) =
31-
self.InternalStartAsync(asCT ct) |> Async.AwaitTask
32-
33-
[<Obsolete("This function is obsoleted, please use `stop` instead.")>]
34-
member self.stopAsync(?ct: CancellationToken) =
35-
self.InternalStopAsync(asCT ct) |> Async.AwaitTask

FSharp.FlashCap/ObservableCaptureDeviceExtension.fs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,5 @@ module public ObservableCaptureDeviceExtension =
2323
member self.stop(?ct: CancellationToken) =
2424
self.InternalStopAsync(asCT ct) |> Async.AwaitTask
2525

26-
[<Obsolete("This function is obsoleted, please use `start` instead.")>]
27-
member self.startAsync(?ct: CancellationToken) =
28-
self.InternalStartAsync(asCT ct) |> Async.AwaitTask
29-
30-
[<Obsolete("This function is obsoleted, please use `stop` instead.")>]
31-
member self.stopAsync(?ct: CancellationToken) =
32-
self.InternalStopAsync(asCT ct) |> Async.AwaitTask
33-
3426
member self.subscribe(observer: IObserver<PixelBufferScope>) =
3527
self.InternalSubscribe(observer)

0 commit comments

Comments
 (0)