Implement libcamera based camera#229
Conversation
…e image capture configuration
There was a problem hiding this comment.
Pull request overview
This pull request implements libcamera-based camera support as an alternative camera backend for the photobooth application. The implementation provides a Qt-integrated interface to libcamera, supporting camera enumeration, preview streaming, and still image capture.
Key changes:
- Added LibcameraDevice and LibCameraWorker classes for libcamera integration with Qt threading
- Integrated libcamera camera device into QML UI with state-based camera source selection
- Added libcamera and dependencies to Flatpak build manifest
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libcameracamera.h | Declares LibcameraDevice and LibCameraWorker classes with threading support |
| src/libcameracamera.cpp | Implements libcamera camera operations, preview streaming, and still capture |
| src/main.cpp | Registers LibcameraDevice QML type |
| qml/content/CameraSource.qml | Adds Libcamera state and integrates libcamera device into camera source logic |
| qml/SettingsMenu.qml | Adds libcamera devices to camera selection list |
| qml/Application.qml | Instantiates global libcamera instance |
| qtbooth.pro | Adds libcamera source files and pkg-config dependency |
| io.github.saeugetier.photobooth.json | Adds libcamera build configuration with Python dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@saeugetier I've opened a new pull request, #238, to work on those changes. Once the pull request is ready, I'll request review from you. |
…fferToImage Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@saeugetier I've opened a new pull request, #239, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Fix libcamera id reference scope issues in CameraSource and SettingsMenu
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 23 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (role == StreamRole::Viewfinder) { | ||
| unsigned int defaultWidth = cfg.size.width; | ||
| unsigned int defaultHeight = cfg.size.height; | ||
| float aspectRatio = static_cast<float>(defaultWidth) / defaultHeight; | ||
|
|
||
| std::vector<PixelFormat> pixelFormats = cfg.formats().pixelformats(); | ||
| // Search for the best available pixel format in order of preference | ||
| PixelFormat selectedFormat = formats::RGB888; // fallback | ||
| bool formatFound = false; | ||
|
|
||
| // Priority order: BGR888, RGB888, YUYV, MJPEG, YUV420 | ||
| std::vector<PixelFormat> preferredFormats = { | ||
| formats::RGB888, | ||
| formats::BGR888, | ||
| formats::YUYV, | ||
| formats::MJPEG, | ||
| formats::YUV420 | ||
| }; |
There was a problem hiding this comment.
The comment describing the preferred pixel format order (BGR888, RGB888, YUYV, MJPEG, YUV420) does not match the actual order in preferredFormats (which starts with RGB888 and then BGR888). To avoid confusion for future maintainers, update the comment to reflect the actual priority or adjust the vector to match the documented order.
| | Backend | Camera Types | Notes | | ||
| |---------|-------------|-------| | ||
| | **V4L2** | USB Webcams, capture cards | Standard Linux video interface | | ||
| | **libcamera** | Raspberry Pi Camera Modules | Pi Camera v1/v2/v3, HQ Camera | | ||
| | **GPhoto2** | DSLR, mirrorless cameras | See [supported cameras](http://www.gphoto.org/proj/libgphoto2/support.php) | |
There was a problem hiding this comment.
Each table row currently starts with two pipe characters, which creates an extra empty column in Markdown renderers; standard Markdown tables should start with a single leading pipe (e.g. | Backend | Camera Types | Notes |). Remove the redundant leading pipe on each row so the table renders with the intended three columns.
| | Backend | Camera Types | Notes | | ||
| |---------|-------------|-------| | ||
| | V4L2 | USB Webcams, capture cards | Standard Linux video interface | | ||
| | libcamera | Raspberry Pi Camera Modules | Pi Camera v1/v2/v3, HQ Camera | | ||
| | GPhoto2 | DSLR, mirrorless cameras | See [supported cameras](http://www.gphoto.org/proj/libgphoto2/support.php) | |
There was a problem hiding this comment.
Similar to docs/index.md, the extra leading pipe on each table row introduces an unintended empty column when rendered; for a three-column table, each line should start with a single |. Adjust the table rows to use a single leading pipe so the table layout matches the text.
No description provided.