{"id":9132,"url":"https://patchwork.libcamera.org/api/1.1/patches/9132/?format=json","web_url":"https://patchwork.libcamera.org/patch/9132/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200801101427.1540331-4-niklas.soderlund@ragnatech.se>","date":"2020-08-01T10:14:27","name":"[libcamera-devel,v3,3/3] android: camera_device: Report RAW capability if supported","commit_ref":"7876d631d930a761e42ed1b16b1aa35216f7d6a5","pull_url":null,"state":"accepted","archived":false,"hash":"97082a2395d36a24334b25659d0fc3054172f3a4","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9132/mbox/","series":[{"id":1175,"url":"https://patchwork.libcamera.org/api/1.1/series/1175/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1175","date":"2020-08-01T10:14:24","name":"android: camera_device: Add RAW support","version":3,"mbox":"https://patchwork.libcamera.org/series/1175/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9132/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9132/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 69F85BD879\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 Aug 2020 10:15:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2897961F83;\n\tSat,  1 Aug 2020 12:15:13 +0200 (CEST)","from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 67DB161F24\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Aug 2020 12:15:11 +0200 (CEST)","from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de\n\t[79.202.46.202]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid b20bea5e-d3df-11ea-86ee-0050569116f7;\n\tSat, 01 Aug 2020 12:13:50 +0200 (CEST)"],"X-Halon-ID":"b20bea5e-d3df-11ea-86ee-0050569116f7","Authorized-sender":"niklas@soderlund.pp.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat,  1 Aug 2020 12:14:27 +0200","Message-Id":"<20200801101427.1540331-4-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200801101427.1540331-1-niklas.soderlund@ragnatech.se>","References":"<20200801101427.1540331-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 3/3] android: camera_device: Report RAW\n\tcapability if supported","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Probe the libcamera Camera for RAW support and if supported report RAW\ncapability in the static metadata reported to Android.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n* Changes since v2\n- Check that generateConfiguration() return a configuration that is not\n  empty.\n---\n src/android/camera_device.cpp | 12 ++++++++++++\n 1 file changed, 12 insertions(+)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex b7b6cb19426d8760..b5206fd623c62b23 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -15,6 +15,7 @@\n #include <libcamera/formats.h>\n #include <libcamera/property_ids.h>\n \n+#include \"libcamera/internal/formats.h\"\n #include \"libcamera/internal/log.h\"\n #include \"libcamera/internal/utils.h\"\n \n@@ -755,6 +756,17 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \tstd::vector<uint8_t> availableCapabilities = {\n \t\tANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE,\n \t};\n+\n+\t/* Report if camera supports RAW. */\n+\tstd::unique_ptr<CameraConfiguration> cameraConfig =\n+\t\tcamera_->generateConfiguration({ StillCaptureRaw });\n+\tif (cameraConfig && !cameraConfig->empty()) {\n+\t\tconst PixelFormatInfo &info =\n+\t\t\tPixelFormatInfo::info(cameraConfig->at(0).pixelFormat);\n+\t\tif (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW)\n+\t\t\tavailableCapabilities.push_back(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW);\n+\t}\n+\n \tstaticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CAPABILITIES,\n \t\t\t\t  availableCapabilities.data(),\n \t\t\t\t  availableCapabilities.size());\n","prefixes":["libcamera-devel","v3","3/3"]}