Skip to content

Commit

Permalink
Ensure only color streams are used (#2549)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotMorten authored Feb 21, 2025
1 parent 337cbf6 commit 0a4dd43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CommunityToolkit.Maui.Camera/CameraManager.windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected virtual async partial Task PlatformStartCameraPreview(CancellationToke

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

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

if (frameSource is not null)
{
Expand Down Expand Up @@ -204,4 +204,4 @@ protected async Task PlatformUpdateResolution(Size resolution, CancellationToken
await mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.Photo, filteredPropertiesList.First()).AsTask(token);
}
}
}
}

0 comments on commit 0a4dd43

Please sign in to comment.