diff options
| -rw-r--r-- | meta-multimedia/recipes-multimedia/libcamera/libcamera.bb | 7 | ||||
| -rw-r--r-- | meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-uvcvideo-Use-auto-variable-to-avoid-range-loop-warni.patch | 38 |
2 files changed, 42 insertions, 3 deletions
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb index 5505626d3e..b05df32102 100644 --- a/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb +++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb | |||
| @@ -10,15 +10,16 @@ LIC_FILES_CHKSUM = "\ | |||
| 10 | 10 | ||
| 11 | SRC_URI = " \ | 11 | SRC_URI = " \ |
| 12 | git://linuxtv.org/libcamera.git;protocol=git \ | 12 | git://linuxtv.org/libcamera.git;protocol=git \ |
| 13 | file://0001-uvcvideo-Use-auto-variable-to-avoid-range-loop-warni.patch \ | ||
| 13 | " | 14 | " |
| 14 | 15 | ||
| 15 | SRCREV = "1e8c91b65695449c5246d17ba7dc439c8058b781" | 16 | SRCREV = "f490a87fd339fc7443f5d8467ba56a35c750a5f7" |
| 16 | 17 | ||
| 17 | PV = "202008+git${SRCPV}" | 18 | PV = "202102+git${SRCPV}" |
| 18 | 19 | ||
| 19 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
| 20 | 21 | ||
| 21 | DEPENDS = "python3-pyyaml-native udev gnutls boost chrpath-native" | 22 | DEPENDS = "python3-pyyaml-native python3-jinja2-native python3-ply-native python3-jinja2-native udev gnutls boost chrpath-native" |
| 22 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}" | 23 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}" |
| 23 | 24 | ||
| 24 | PACKAGES =+ "${PN}-gst" | 25 | PACKAGES =+ "${PN}-gst" |
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-uvcvideo-Use-auto-variable-to-avoid-range-loop-warni.patch b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-uvcvideo-Use-auto-variable-to-avoid-range-loop-warni.patch new file mode 100644 index 0000000000..4ca412c695 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-uvcvideo-Use-auto-variable-to-avoid-range-loop-warni.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From 767267ef69c001870d41caf9c60dd7fec89b0a13 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 3 Mar 2021 15:11:46 -0800 | ||
| 4 | Subject: [PATCH] uvcvideo: Use auto variable to avoid range loop warnings | ||
| 5 | |||
| 6 | With c++17 loop range bases are defined where copy is obvious since | ||
| 7 | iterator returns a copy and not reference, gcc11 will emit a warning | ||
| 8 | about this | ||
| 9 | |||
| 10 | uvcvideo.cpp:432:33: error: loop variable 'name' of type 'const string&' {aka 'const std::__cxx11::basic_string<cha | ||
| 11 | r>&'} binds to a temporary constructed from type 'const char* const' [-Werror=range-loop-construct] | ||
| 12 | | 432 | for (const std::string &name : { "idVendor", "idProduct" }) { | ||
| 13 | | | ^~~~ | ||
| 14 | |||
| 15 | Therefore making it explicit is better | ||
| 16 | |||
| 17 | Upstream-Status: Submitted [https://lists.libcamera.org/pipermail/libcamera-devel/2021-March/017966.html] | ||
| 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 19 | --- | ||
| 20 | src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 +- | ||
| 21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 22 | |||
| 23 | diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | ||
| 24 | index 031f96e2..ef23ece7 100644 | ||
| 25 | --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | ||
| 26 | +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | ||
| 27 | @@ -429,7 +429,7 @@ std::string PipelineHandlerUVC::generateId(const UVCCameraData *data) | ||
| 28 | |||
| 29 | /* Creata a device ID from the USB devices vendor and product ID. */ | ||
| 30 | std::string deviceId; | ||
| 31 | - for (const std::string &name : { "idVendor", "idProduct" }) { | ||
| 32 | + for (const auto name : { "idVendor", "idProduct" }) { | ||
| 33 | std::ifstream file(path + "/../" + name); | ||
| 34 | |||
| 35 | if (!file.is_open()) | ||
| 36 | -- | ||
| 37 | 2.30.1 | ||
| 38 | |||
