From 00cce8c05216e86a4ada4b01a0d5dacfca533649 Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Fri, 5 Dec 2025 17:41:07 +0100 Subject: [PATCH] package/libcamera-apps: fix build Buildroot commit 95c385e2d6b92e7afa2d1fac84ecf2dabfb81d25 in -next branch bumped libcamera to version 0.6.0 which breaks the build: ../core/options.cpp:405:44: error: conversion from 'std::basic_string_view' to non-scalar type 'const std::string' {aka 'const std::__cxx11::basic_string'} requested 405 | const std::string cam_id = *cameras[camera]->properties().get(libcamera::properties::Model); Added upstream patch, included since version 1.10.0, to fix the problem. Please note that since version 1.9.1 this package is incompatible with the current version of ffmpeg used in buildroot so bumping it is not an option atm: https://github.com/raspberrypi/rpicam-apps/commit/cbe9921eeddd8e1c2e5798102f485baea5de3f65 Signed-off-by: Bernd Kuhls [Julien: fix Buildroot commit id of libcamera bump] Signed-off-by: Julien Olivain --- ...ore-Switch-libcamera-string-controls.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 package/libcamera-apps/0002-core-Switch-libcamera-string-controls.patch diff --git a/package/libcamera-apps/0002-core-Switch-libcamera-string-controls.patch b/package/libcamera-apps/0002-core-Switch-libcamera-string-controls.patch new file mode 100644 index 0000000000..fcebffe3da --- /dev/null +++ b/package/libcamera-apps/0002-core-Switch-libcamera-string-controls.patch @@ -0,0 +1,46 @@ +From f3011b5fae183a463630b4168626dfefe9b4c74e Mon Sep 17 00:00:00 2001 +From: Naushir Patuck +Date: Thu, 16 Oct 2025 14:45:33 +0100 +Subject: [PATCH] core: Switch libcamera string controls to use + std::string_view + +This is a change to the libcamera API, switch to std::string_view from +std::string. + +Signed-off-by: Naushir Patuck + +Upstream: https://github.com/raspberrypi/rpicam-apps/commit/f3011b5fae183a463630b4168626dfefe9b4c74e + +Signed-off-by: Bernd Kuhls +--- + core/options.cpp | 2 +- + core/rpicam_app.cpp | 3 +-- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/core/options.cpp b/core/options.cpp +index cf704c2a..d3296548 100644 +--- a/core/options.cpp ++++ b/core/options.cpp +@@ -418,7 +418,7 @@ bool OptsInternal::Parse(boost::program_options::variables_map &vm, RPiCamApp *a + std::vector> cameras = app->GetCameras(); + if (camera < cameras.size()) + { +- const std::string cam_id = *cameras[camera]->properties().get(libcamera::properties::Model); ++ const std::string_view cam_id = *cameras[camera]->properties().get(libcamera::properties::Model); + + if (cam_id.find("imx708") != std::string::npos) + { +diff --git a/core/rpicam_app.cpp b/core/rpicam_app.cpp +index 9e5a2d0c..0f0b5ffa 100644 +--- a/core/rpicam_app.cpp ++++ b/core/rpicam_app.cpp +@@ -128,8 +128,7 @@ std::string const &RPiCamApp::CameraId() const + + std::string RPiCamApp::CameraModel() const + { +- auto model = camera_->properties().get(properties::Model); +- return model ? *model : camera_->id(); ++ return std::string(camera_->properties().get(properties::Model).value_or(camera_->id())); + } + + void RPiCamApp::OpenCamera()