Skip to content

Implement libcamera based camera#229

Merged
saeugetier merged 129 commits into
developfrom
192-direct-support-of-raspberry-pi-cameras-via-libcamera
Jan 27, 2026
Merged

Implement libcamera based camera#229
saeugetier merged 129 commits into
developfrom
192-direct-support-of-raspberry-pi-cameras-via-libcamera

Conversation

@saeugetier

Copy link
Copy Markdown
Owner

No description provided.

@saeugetier saeugetier linked an issue Dec 2, 2025 that may be closed by this pull request
@saeugetier saeugetier changed the base branch from master to develop December 2, 2025 20:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/libcameracamera.cpp Outdated
Comment thread src/libcameracamera.cpp Outdated
Comment thread src/libcameracamera.cpp Outdated
Comment thread src/libcameracamera.cpp Outdated
Comment thread src/libcameracamera.cpp Outdated
Comment thread src/libcameracamera.cpp Outdated
Comment thread src/libcameracamera.cpp Outdated
Comment thread qml/content/CameraSource.qml Outdated
Comment thread src/libcameracamera.cpp Outdated
Comment thread src/libcameracamera.h Outdated

Copilot AI commented Jan 8, 2026

Copy link
Copy Markdown

@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.

Copilot AI and others added 3 commits January 8, 2026 22:02
…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>
saeugetier and others added 5 commits January 27, 2026 08:39
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>

Copilot AI commented Jan 27, 2026

Copy link
Copy Markdown

@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.

saeugetier and others added 13 commits January 27, 2026 19:46
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>
@saeugetier saeugetier added this to the Click milestone Jan 27, 2026
@saeugetier saeugetier requested a review from Copilot January 27, 2026 21:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/libcameracamera.cpp
Comment thread src/libcameracamera.cpp
Comment on lines +741 to +758
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
};

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread docs/index.md
Comment on lines +7 to +11
| 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) |

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +66 to +70
| 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) |

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@saeugetier saeugetier merged commit ae9c7b1 into develop Jan 27, 2026
2 checks passed
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.

Direct support of Raspberry Pi cameras via libcamera

3 participants