diff options
| author | Khem Raj <raj.khem@gmail.com> | 2023-01-24 01:24:47 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-01-25 08:57:42 -0800 |
| commit | d8381620cdd763a7306603de529e6c9709c8b906 (patch) | |
| tree | 7c76774e04862f36cf4d85d653ec6237770aa2ce /meta-multimedia | |
| parent | 05ef2b65700f1a9d9b0bf22f0f04f954c2800828 (diff) | |
| download | meta-openembedded-d8381620cdd763a7306603de529e6c9709c8b906.tar.gz | |
libcamera: Fix build with gcc-13
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia')
| -rw-r--r-- | meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-file_sink.cpp-Avoid-dangling-reference.patch | 46 | ||||
| -rw-r--r-- | meta-multimedia/recipes-multimedia/libcamera/libcamera_0.0.1.bb | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-file_sink.cpp-Avoid-dangling-reference.patch b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-file_sink.cpp-Avoid-dangling-reference.patch new file mode 100644 index 0000000000..5aa6ee8d3c --- /dev/null +++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-file_sink.cpp-Avoid-dangling-reference.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From 0e97896e6a09957f27125957d00b5150ec90b2e9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 24 Jan 2023 01:18:25 -0800 | ||
| 4 | Subject: [PATCH] file_sink.cpp: Avoid dangling-reference | ||
| 5 | |||
| 6 | Fixes following errors with gcc-13 | ||
| 7 | |||
| 8 | ../git/src/cam/file_sink.cpp:92:45: error: possibly dangling reference to a temporary [-Werror=dangling-reference] | ||
| 9 | 92 | const FrameMetadata::Plane &meta = buffer->metadata().planes()[i]; | ||
| 10 | | ^~~~ | ||
| 11 | ../git/src/cam/file_sink.cpp:92:81: note: the temporary was destroyed at the end of the full expression '(& buffer->libcamera::FrameBuffer::metadata())->libcamera::FrameMetadata::planes().libcamera::Span<const libcamera::FrameMetadata::Plane>::operator[](i)' | ||
| 12 | 92 | const FrameMetadata::Plane &meta = buffer->metadata().planes()[i]; | ||
| 13 | | ^ | ||
| 14 | cc1plus: all warnings being treated as errors | ||
| 15 | |||
| 16 | Upstream-Status: Submitted [https://lists.libcamera.org/pipermail/libcamera-devel/2023-January/036575.html] | ||
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 18 | --- | ||
| 19 | src/cam/file_sink.cpp | 8 ++++---- | ||
| 20 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/src/cam/file_sink.cpp b/src/cam/file_sink.cpp | ||
| 23 | index 45213d4a..897c4b37 100644 | ||
| 24 | --- a/src/cam/file_sink.cpp | ||
| 25 | +++ b/src/cam/file_sink.cpp | ||
| 26 | @@ -89,13 +89,13 @@ void FileSink::writeBuffer(const Stream *stream, FrameBuffer *buffer) | ||
| 27 | Image *image = mappedBuffers_[buffer].get(); | ||
| 28 | |||
| 29 | for (unsigned int i = 0; i < buffer->planes().size(); ++i) { | ||
| 30 | - const FrameMetadata::Plane &meta = buffer->metadata().planes()[i]; | ||
| 31 | + unsigned int bytesused = buffer->metadata().planes()[i].bytesused; | ||
| 32 | |||
| 33 | Span<uint8_t> data = image->data(i); | ||
| 34 | - unsigned int length = std::min<unsigned int>(meta.bytesused, data.size()); | ||
| 35 | + unsigned int length = std::min<unsigned int>(bytesused, data.size()); | ||
| 36 | |||
| 37 | - if (meta.bytesused > data.size()) | ||
| 38 | - std::cerr << "payload size " << meta.bytesused | ||
| 39 | + if (bytesused > data.size()) | ||
| 40 | + std::cerr << "payload size " << bytesused | ||
| 41 | << " larger than plane size " << data.size() | ||
| 42 | << std::endl; | ||
| 43 | |||
| 44 | -- | ||
| 45 | 2.39.1 | ||
| 46 | |||
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.0.1.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.0.1.bb index 483fe1507e..46f058f2ea 100644 --- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.0.1.bb +++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.0.1.bb | |||
| @@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "\ | |||
| 10 | 10 | ||
| 11 | SRC_URI = " \ | 11 | SRC_URI = " \ |
| 12 | git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master \ | 12 | git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master \ |
| 13 | file://0001-file_sink.cpp-Avoid-dangling-reference.patch \ | ||
| 13 | " | 14 | " |
| 14 | 15 | ||
| 15 | SRCREV = "a83aed77df1258e469c0eb42d9cb4f1938db53f2" | 16 | SRCREV = "a83aed77df1258e469c0eb42d9cb4f1938db53f2" |
