pipewire/pipewire-fix-libcamera-build.patch
Antonio Larrosa 9c37676767 Accepting request 908411 from home:fcrozat:branches:multimedia:libs
- Add patch pipewire-fix-libcamera-build.patch: fix build with
  latest libcamera.
- Do no build libcamera support on Leap 15.3 or lower (too old
  libcamera) and change name of BuildRequires from camera to
  libcamera.
- Update minimal version for alsa buildrequires.

OBS-URL: https://build.opensuse.org/request/show/908411
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pipewire?expand=0&rev=11
2021-07-27 06:18:49 +00:00

79 lines
2.9 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 5471a0018b0394327c0cd4f1f60bf326632b29f1 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Thu, 22 Jul 2021 20:09:34 +0200
Subject: [PATCH 1/2] libcamera: fix no-longer existent <libcamera/buffer.h>
header inclusion
The SPA plugin is including a <libcamera/buffer.h> header file, but this
got renamed to <libcamera/framebuffer.h> 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 <libcamera/buffer.h>
| ^~~~~~~~~~~~~~~~~~~~
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 <libcamera/camera_manager.h>
#include <libcamera/request.h>
#include <libcamera/framebuffer_allocator.h>
-#include <libcamera/buffer.h>
+#include <libcamera/framebuffer.h>
#include <libcamera/property_ids.h>
#include <libcamera/controls.h>
--
2.26.2
From 76cb5c1169b58b48a2921ccc3f61c713b297c07f Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
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<FrameBuffer> &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<FrameBuffer> &buffer : this->allocator_->buffers(stream)) {
+ for (uint32_t bufIdx = 0; bufIdx < nbuffers; bufIdx++) {
delete [] this->fd_[bufIdx];
- bufIdx++;
}
delete [] this->fd_;
--
2.26.2