From 5471a0018b0394327c0cd4f1f60bf326632b29f1 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Thu, 22 Jul 2021 20:09:34 +0200 Subject: [PATCH 1/2] libcamera: fix no-longer existent header inclusion The SPA plugin is including a header file, but this got renamed to to match the defined class name: ../spa/plugins/libcamera/libcamera_wrapper.cpp:52:10: fatal error: libcamera/buffer.h: No such file or directory 52 | #include | ^~~~~~~~~~~~~~~~~~~~ Fixes #1435 --- spa/plugins/libcamera/libcamera_wrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/libcamera/libcamera_wrapper.cpp b/spa/plugins/libcamera/libcamera_wrapper.cpp index 58c062412..f25922eb1 100644 --- a/spa/plugins/libcamera/libcamera_wrapper.cpp +++ b/spa/plugins/libcamera/libcamera_wrapper.cpp @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include -- 2.26.2 From 76cb5c1169b58b48a2921ccc3f61c713b297c07f Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Thu, 22 Jul 2021 20:17:09 +0200 Subject: [PATCH 2/2] libcamera: remove unused buffer variable in LibCamera::stop() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To fix build warning about a variable being unused in LibCamera::stop(): [1/2] Compiling C++ object spa/plugins/libcamera/libspa-libcamera.so.p/libcamera_wrapper.cpp.o ../spa/plugins/libcamera/libcamera_wrapper.cpp: In member function ‘void LibCamera::stop()’: ../spa/plugins/libcamera/libcamera_wrapper.cpp:531:58: warning: unused variable ‘buffer’ [-Wunused-variable] 531 | for (const std::unique_ptr &buffer : this->allocator_->buffers(stream)) { | ^~~~~~ --- spa/plugins/libcamera/libcamera_wrapper.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spa/plugins/libcamera/libcamera_wrapper.cpp b/spa/plugins/libcamera/libcamera_wrapper.cpp index f25922eb1..d58238d33 100644 --- a/spa/plugins/libcamera/libcamera_wrapper.cpp +++ b/spa/plugins/libcamera/libcamera_wrapper.cpp @@ -524,13 +524,12 @@ extern "C" { void LibCamera::stop() { this->disconnect(); - uint32_t bufIdx = 0; StreamConfiguration &cfg = this->config_->at(0); Stream *stream = cfg.stream(); + uint32_t nbuffers = this->allocator_->buffers(stream).size(); - for (const std::unique_ptr &buffer : this->allocator_->buffers(stream)) { + for (uint32_t bufIdx = 0; bufIdx < nbuffers; bufIdx++) { delete [] this->fd_[bufIdx]; - bufIdx++; } delete [] this->fd_; -- 2.26.2