{"id":11142,"url":"https://patchwork.libcamera.org/api/1.1/patches/11142/?format=json","web_url":"https://patchwork.libcamera.org/patch/11142/","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":"<20210204100541.657503-5-hiroh@chromium.org>","date":"2021-02-04T10:05:39","name":"[libcamera-devel,RFC,4/6] android: camera_device: Implement toString() in Camera3StreamConfig","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"b07ed652917c98702664b6480bf5887b1c04221b","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11142/mbox/","series":[{"id":1650,"url":"https://patchwork.libcamera.org/api/1.1/series/1650/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1650","date":"2021-02-04T10:05:35","name":"Support stream mapping in Android HAL adaptation layer","version":1,"mbox":"https://patchwork.libcamera.org/series/1650/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11142/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11142/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 5A702BD162\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Feb 2021 10:05:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 278C86143D;\n\tThu,  4 Feb 2021 11:05:59 +0100 (CET)","from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com\n\t[IPv6:2607:f8b0:4864:20::52d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AFFAF61402\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Feb 2021 11:05:56 +0100 (CET)","by mail-pg1-x52d.google.com with SMTP id i7so1741538pgc.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 04 Feb 2021 02:05:56 -0800 (PST)","from hiroh.c.googlers.com.com\n\t(128.141.236.35.bc.googleusercontent.com. [35.236.141.128])\n\tby smtp.gmail.com with ESMTPSA id\n\tj9sm5808418pgb.47.2021.02.04.02.05.53\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 04 Feb 2021 02:05:54 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"DKcfUn8Q\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=MXSqpr9JOnO1UjiOWF8Ii2WAsULHhudnBjado3OF8Ys=;\n\tb=DKcfUn8Q812/OXWA7nkOjvzi4BTpmhvL285pZ4E3vaF1Vcr1AASSg+nbx7j51D20EY\n\tE5vV3QEVuGXS1Or3ZMSeTdncP1QS6ohia+POv0kKDyybK7QIFLya3IBuEjH0j1Lperth\n\tLN/pTiaAS4nLN1PNMofE6zaYc3EkJkZk8Vfho=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=MXSqpr9JOnO1UjiOWF8Ii2WAsULHhudnBjado3OF8Ys=;\n\tb=qPw8nwQ6ddhDAOw/TWbYvP9qCRXeeew9qpLyyE/27qz4FMh3Nv6zUGx/KagqhsECFT\n\tr63r4qRvHtyGNEMGppMyJ83nfQtfvvjTdmGrmqWvpNve06FVEmLVel7z6X33hqQV3qBK\n\tckXKR2Cbks37cnvAW0OnZA3xzzAoaalN7YG+ioULZp6VsXU8WKt1CudD0eH2nW3WYPRL\n\tkZK2oeGl5jxZnPfLvWaQ9yKBpFFYF4Nsv4NRWcOsubZSRI6ulRd3yOmkxxx8+a/2bNi4\n\t5I8FWsno3rAR8vmofG9yNdEVXa7QrSBVzdPy8JOOwxIpeeCpFEOqnlhYRSCTc8E65Bc4\n\tH1YA==","X-Gm-Message-State":"AOAM532GebaPcfOL4OHrH33WvMeSbrW2CVHhbk2rApWdgGkXr2df9jB5\n\tMkCBarmn1N8YK+XYzYCHyu7XBvD4ntxbhTtr","X-Google-Smtp-Source":"ABdhPJzIr0NUkcQA6A9WWJlB5dFzi6W/PgKsJnQa3xaB7JJah6nPuYcxmjCk5uKdcnbMUt5hqCdZHA==","X-Received":"by 2002:a62:1755:0:b029:1cb:4985:4cf8 with SMTP id\n\t82-20020a6217550000b02901cb49854cf8mr7631415pfx.9.1612433155161; \n\tThu, 04 Feb 2021 02:05:55 -0800 (PST)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu,  4 Feb 2021 10:05:39 +0000","Message-Id":"<20210204100541.657503-5-hiroh@chromium.org>","X-Mailer":"git-send-email 2.30.0.365.g02bc693789-goog","In-Reply-To":"<20210204100541.657503-1-hiroh@chromium.org>","References":"<20210204100541.657503-1-hiroh@chromium.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [RFC PATCH 4/6] android: camera_device: Implement\n\ttoString() in Camera3StreamConfig","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>","Cc":"hanlinchen@chromium.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This adds toString() function in Camera3StreamConfig\nand Camera3StreamConfig::Camera3Stream for logging.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/camera_device.cpp | 38 +++++++++++++++++++++++++++++++++--\n 1 file changed, 36 insertions(+), 2 deletions(-)\n\n--\n2.30.0.365.g02bc693789-goog","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 752e17ba..93dfbcdb 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -140,14 +140,48 @@ const std::map<int, const Camera3Format> camera3FormatsMap = {\n  */\n struct Camera3StreamConfig {\n \tstruct Camera3Stream {\n-\t\tcamera3_stream_t *stream;\n-\t\tCameraStream::Type type;\n+\t\tCamera3Stream(camera3_stream_t *stream, CameraStream::Type type)\n+\t\t\t: stream(stream), type(type) {}\n+\n+\t\tstd::string toString() const;\n+\n+\t\tcamera3_stream_t *stream = nullptr;\n+\t\tCameraStream::Type type = CameraStream::Type::Direct;\n \t};\n\n+\tstd::string toString() const;\n+\n \tstd::vector<Camera3Stream> streams;\n \tStreamConfiguration config;\n };\n\n+std::string Camera3StreamConfig::Camera3Stream::toString() const {\n+\tstd::ostringstream os;\n+\tos << \"format: \" << utils::hex(stream->format)\n+\t    << \", size:\" << stream->width << \"x\" << stream->height;\n+\tos << \", type: \";\n+\tswitch (type) {\n+\tcase CameraStream::Type::Direct:\n+\t\tos << \"Direct\"; break;\n+\tcase CameraStream::Type::Internal:\n+\t\tos << \"Internal\"; break;\n+\tcase CameraStream::Type::Mapped:\n+\t\tos << \"Mapped\"; break;\n+\t}\n+\n+\treturn os.str();\n+}\n+\n+std::string Camera3StreamConfig::toString() const {\n+\tstd::ostringstream os;\n+\tfor (size_t i = 0; i < streams.size(); ++i) {\n+\t\tos << \"Stream #\" << i << \": \" << streams[i].toString() << \"}, \";\n+\t}\n+\n+\tos << \"config: \" << config.toString();\n+\treturn os.str();\n+}\n+\n /*\n  * Reorder the configurations so that libcamera::Camera can accept them as much\n  * as possible. The sort rule is as follows.\n","prefixes":["libcamera-devel","RFC","4/6"]}