fix: typo in CameraService

This commit is contained in:
2025-12-19 09:32:12 +03:00
parent e1a5363ae3
commit 18a50b745d
+3 -4
View File
@@ -13,7 +13,7 @@ public class CameraService : IDisposable
public const int MAP_SHARED = 0x0001; public const int MAP_SHARED = 0x0001;
[DllImport("libc", SetLastError = true)] public static extern IntPtr mmap(IntPtr address, ulong length, int prot, int flags, int fd, ulong offset); [DllImport("libc", SetLastError = true)] public static extern IntPtr mmap(IntPtr address, ulong length, int prot, int flags, int fd, ulong offset);
[DllImport("libc", SetLastError = true)] public static extern int mumap(IntPtr address, ulong length); [DllImport("libc", SetLastError = true)] public static extern int munmap(IntPtr address, ulong length);
} }
private sealed class MappedBuffer private sealed class MappedBuffer
{ {
@@ -115,9 +115,9 @@ public class CameraService : IDisposable
CameraSelect(effectiveCancellationToken); CameraSelect(effectiveCancellationToken);
CameraAcquire(effectiveCancellationToken); CameraAcquire(effectiveCancellationToken);
CameraConfigure(effectiveCancellationToken); CameraConfigure(effectiveCancellationToken);
CameraStart(effectiveCancellationToken);
FrameBuffersAllocate(effectiveCancellationToken); FrameBuffersAllocate(effectiveCancellationToken);
ImageCaptureFrameBuffersMap(effectiveCancellationToken); ImageCaptureFrameBuffersMap(effectiveCancellationToken);
CameraStart(effectiveCancellationToken);
} }
catch (Exception e) catch (Exception e)
{ {
@@ -244,7 +244,6 @@ public class CameraService : IDisposable
_frameBufferAllocator = new FrameBufferAllocator(_camera); _frameBufferAllocator = new FrameBufferAllocator(_camera);
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
int result = _frameBufferAllocator.Allocate(_viewFinderStream); int result = _frameBufferAllocator.Allocate(_viewFinderStream);
@@ -443,7 +442,7 @@ public class CameraService : IDisposable
if (_state.HasFlag(State.ImageCaptureFrameBuffersMapped) && _mappedBuffers is not null) if (_state.HasFlag(State.ImageCaptureFrameBuffersMapped) && _mappedBuffers is not null)
{ {
foreach (var buffer in _mappedBuffers) foreach (var buffer in _mappedBuffers)
LibC.mumap(buffer.Address, buffer.Length); LibC.munmap(buffer.Address, buffer.Length);
_mappedBuffers.Clear(); _mappedBuffers.Clear();
} }
if (_state.HasFlag(State.ViewFinderFrameBufferAllocated) && _viewFinderStream is not null) if (_state.HasFlag(State.ViewFinderFrameBufferAllocated) && _viewFinderStream is not null)