{"id":9130,"url":"https://patchwork.libcamera.org/api/patches/9130/?format=json","web_url":"https://patchwork.libcamera.org/patch/9130/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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-2-niklas.soderlund@ragnatech.se>","date":"2020-08-01T10:14:25","name":"[libcamera-devel,v3,1/3] android: camera_device: Prepare for none-mandatory formats","commit_ref":"8c1fedcb782f4f3f5b23d30ab90f3db43a693b9a","pull_url":null,"state":"accepted","archived":false,"hash":"e0b4b8b5a4fc05d28b1a6c4d8a9ecb258fa3a120","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9130/mbox/","series":[{"id":1175,"url":"https://patchwork.libcamera.org/api/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/9130/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9130/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 190B6BD86F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 Aug 2020 10:15:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B7C8E61F80;\n\tSat,  1 Aug 2020 12:15:11 +0200 (CEST)","from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0B2B761970\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Aug 2020 12:15:10 +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 b0ed7b8f-d3df-11ea-86ee-0050569116f7;\n\tSat, 01 Aug 2020 12:13:49 +0200 (CEST)"],"X-Halon-ID":"b0ed7b8f-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:25 +0200","Message-Id":"<20200801101427.1540331-2-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 1/3] android: camera_device: Prepare\n\tfor none-mandatory formats","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":"When probing what formats a libcamera Camera supports we want to allow\nto probe for not mandatory formats. Add a new flag to indicate if a\nformat in camera3FormatsMap is mandatory or not.\n\nAll current defined formats are mandatory.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex b49d6681e5a52d32..8028d3e12bda1316 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -46,6 +46,7 @@ const std::vector<Size> camera3Resolutions = {\n  */\n struct Camera3Format {\n \tstd::vector<PixelFormat> libcameraFormats;\n+\tbool mandatory;\n \tconst char *name;\n };\n \n@@ -57,11 +58,13 @@ const std::map<int, const Camera3Format> camera3FormatsMap = {\n \t{\n \t\tHAL_PIXEL_FORMAT_BLOB, {\n \t\t\t{ formats::MJPEG },\n+\t\t\ttrue,\n \t\t\t\"BLOB\"\n \t\t}\n \t}, {\n \t\tHAL_PIXEL_FORMAT_YCbCr_420_888, {\n \t\t\t{ formats::NV12, formats::NV21 },\n+\t\t\ttrue,\n \t\t\t\"YCbCr_420_888\"\n \t\t}\n \t}, {\n@@ -71,6 +74,7 @@ const std::map<int, const Camera3Format> camera3FormatsMap = {\n \t\t */\n \t\tHAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, {\n \t\t\t{ formats::NV12, formats::NV21 },\n+\t\t\ttrue,\n \t\t\t\"IMPLEMENTATION_DEFINED\"\n \t\t}\n \t},\n@@ -281,7 +285,7 @@ int CameraDevice::initializeStreamConfigurations()\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n-\t\tif (!mappedFormat.isValid()) {\n+\t\tif (camera3Format.mandatory && !mappedFormat.isValid()) {\n \t\t\tLOG(HAL, Error) << \"Failed to map Android format \"\n \t\t\t\t\t<< camera3Format.name << \" (\"\n \t\t\t\t\t<< utils::hex(androidFormat) << \")\";\n","prefixes":["libcamera-devel","v3","1/3"]}