Skip to content

Commit 0a4dd43

Browse files
authored
Ensure only color streams are used (#2549)
1 parent 337cbf6 commit 0a4dd43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CommunityToolkit.Maui.Camera/CameraManager.windows.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected virtual async partial Task PlatformStartCameraPreview(CancellationToke
151151

152152
await mediaCapture.InitializeCameraForCameraView(cameraView.SelectedCamera.DeviceId, token);
153153

154-
frameSource = mediaCapture.FrameSources.FirstOrDefault(source => source.Value.Info.MediaStreamType == MediaStreamType.VideoRecord).Value;
154+
frameSource = mediaCapture.FrameSources.FirstOrDefault(source => source.Value.Info.MediaStreamType == MediaStreamType.VideoRecord && source.Value.Info.SourceKind == MediaFrameSourceKind.Color).Value;
155155

156156
if (frameSource is not null)
157157
{
@@ -204,4 +204,4 @@ protected async Task PlatformUpdateResolution(Size resolution, CancellationToken
204204
await mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.Photo, filteredPropertiesList.First()).AsTask(token);
205205
}
206206
}
207-
}
207+
}

0 commit comments

Comments
 (0)