Skip to content

Commit d7219a1

Browse files
committed
Changed debug output instead of console.
1 parent 394fbf3 commit d7219a1

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

FlashCap.Core/Devices/AVFoundationDevice.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
////////////////////////////////////////////////////////////////////////////
99

1010
using System;
11+
using System.Diagnostics;
1112
using System.Linq;
1213
using System.Runtime.InteropServices;
1314
using System.Threading;
@@ -175,7 +176,7 @@ public VideoBufferHandler(AVFoundationDevice device)
175176

176177
public override void DidDropSampleBuffer(IntPtr captureOutput, IntPtr sampleBuffer, IntPtr connection)
177178
{
178-
Console.WriteLine("Dropped");
179+
Debug.WriteLine("Dropped");
179180
var valid = CMSampleBufferIsValid(sampleBuffer);
180181
}
181182

FlashCap.Core/Internal/AVFoundation/AVCaptureVideoDataOutput.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
////////////////////////////////////////////////////////////////////////////
99

1010
using System;
11+
using System.Diagnostics;
1112
using System.Runtime.InteropServices;
1213
using FlashCap.Devices;
1314
using static FlashCap.Internal.NativeMethods_AVFoundation;
@@ -95,7 +96,7 @@ public void SetSampleBufferDelegate(AVFoundationDevice.VideoBufferHandler sample
9596

9697
if (sampleBufferDelegate == null)
9798
{
98-
Console.WriteLine("AVCaptureVideoDataOutputSampleBufferDelegate is null");
99+
Debug.WriteLine("AVCaptureVideoDataOutputSampleBufferDelegate is null");
99100
return;
100101
}
101102

FlashCap.Core/Internal/AVFoundation/LibAVFoundation.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
////////////////////////////////////////////////////////////////////////////
99

1010
using System;
11+
using System.Diagnostics;
1112
using System.Runtime.InteropServices;
1213
using System.Linq;
1314
using static FlashCap.Internal.NativeMethods_AVFoundation;
@@ -188,8 +189,7 @@ public unsafe void LockForConfiguration()
188189
if (errorHandle != IntPtr.Zero)
189190
{
190191
using var error = new LibObjC.NSError(errorHandle, retain: true);
191-
Console.WriteLine(error.Error);
192-
throw new InvalidOperationException(/* error.FailureReason */);
192+
throw new InvalidOperationException(error.Error);
193193
}
194194
}
195195

@@ -358,8 +358,7 @@ private static unsafe IntPtr FromDevice(AVCaptureDevice device)
358358
if (errorHandle != IntPtr.Zero)
359359
{
360360
using var error = new LibObjC.NSError(errorHandle, retain: false);
361-
Console.WriteLine(error.Error);
362-
throw new InvalidOperationException(/* error.FailureReason */);
361+
throw new InvalidOperationException(error.Error);
363362
}
364363

365364
return inputHandle;
@@ -404,7 +403,7 @@ static AVCaptureVideoDataOutputSampleBuffer()
404403
{
405404
4 => 2,
406405
8 => 3,
407-
_ => throw new NotSupportedException("The current arhitecture isn't supported.")
406+
_ => throw new NotSupportedException("The current architecture isn't supported.")
408407
},
409408
types: "^v");
410409

0 commit comments

Comments
 (0)