WindowsCommunityToolkit
WindowsCommunityToolkit copied to clipboard
CameraPreview's FrameArrived Event Inconsistent Firing
Describe the bug
I'm using the CameraPreview control on a WASDK 1.2/WinUI 3 desktop application. I've followed all the documentations and the sample on the toolkit app. When I build and run my app, the CameraPreview does its job of previewing the camera live feed for 1 - 2 seconds, then afterwards, upon checking with the debugger, the FrameArrived event will stop firing. MediaPlayerElement is already present and working as of WASDK 1.2.230118.102.
The CameraPreview.cs file inside the toolkit needs to be updated to remove the TODO: WinUI3 commented-out-codes.
Regression
No response
Reproducible in sample app?
- [ ] This bug can be reproduced in the sample app.
Steps to reproduce
Create a WASDK 1.2/WinUI 3 desktop packed app using VS 2022.
Add the necessary toolkit NuGet packages for the CameraPreview.
On the MainWindow.xaml.cs file, write the code to hook to CameraPreview's FrameArrived event.
See the screenshots for more info.
Expected behavior
CameraPreview.FrameArrived event should fire in a consistent manner, thus resulting in a continuous and real-time preview of the camera.
Screenshots
MainWindow.xaml:
MainWindow.xaml.cs:
Windows Build Number
- [ ] Windows 10 1809 (Build 17763)
- [ ] Windows 10 1903 (Build 18362)
- [ ] Windows 10 1909 (Build 18363)
- [ ] Windows 10 2004 (Build 19041)
- [ ] Windows 10 20H2 (Build 19042)
- [ ] Windows 10 21H1 (Build 19043)
- [ ] Windows 11 21H2 (Build 22000)
- [X] Other (specify)
Other Windows Build number
22H2
App minimum and target SDK version
- [ ] Windows 10, version 1809 (Build 17763)
- [ ] Windows 10, version 1903 (Build 18362)
- [ ] Windows 10, version 1909 (Build 18363)
- [ ] Windows 10, version 2004 (Build 19041)
- [ ] Other (specify)
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
No response
Device form factor
Desktop
Nuget packages
No response
Additional context
No response
Help us help you
Yes, but only if others can assist.