Skip to content

Add camera source picker to CaptureElementPreview sample#2189

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/camera-capture-allow-picking-camera
Draft

Add camera source picker to CaptureElementPreview sample#2189
Copilot wants to merge 2 commits into
mainfrom
copilot/camera-capture-allow-picking-camera

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 1, 2026

On devices with multiple cameras (e.g., Razer Blade with IR camera), the sample always selected groups.First() which often isn't the expected RGB camera.

Adds a ComboBox to the Options panel listing available MediaFrameSourceGroup devices by DisplayName, allowing the user to switch cameras at runtime.

  • XAML: Added ComboBox with DisplayMemberPath="DisplayName" and SelectionChanged handler
  • Code-behind: Extracted StartCapture(MediaFrameSourceGroup) from StartCaptureElement() so camera init is reusable on selection change; properly disposes previous MediaCapture before switching
  • Sample code files: Updated inline and standalone sample text files to reflect the new pattern

Copilot AI linked an issue Jun 1, 2026 that may be closed by this pull request
Allow users to select which camera device to use instead of always
defaulting to the first available camera. This addresses the issue
where devices with multiple cameras (e.g., IR camera as default)
would not show the expected camera feed.

Changes:
- Added ComboBox to Options panel for camera source selection
- Refactored capture logic into StartCapture method for reuse
- Added SelectionChanged handler to switch cameras
- Properly disposes previous MediaCapture when switching
- Updated sample code text files to reflect new functionality
Copilot AI changed the title [WIP] Enhance camera capture to allow selecting camera Add camera source picker to CaptureElementPreview sample Jun 1, 2026
Copilot AI requested a review from niels9001 June 1, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Camera capture should allow picking camera

2 participants