Patch Detail
Show a patch.
GET /api/1.1/patches/13582/?format=api
{ "id": 13582, "url": "https://patchwork.libcamera.org/api/1.1/patches/13582/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13582/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210831093439.853586-4-hiroh@chromium.org>", "date": "2021-08-31T09:34:39", "name": "[libcamera-devel,v3,3/3] android: camera_device: Configure one stream for identical stream requests", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "d47c874d12ec08ae018e499ec868edccf5e1eeff", "submitter": { "id": 63, "url": "https://patchwork.libcamera.org/api/1.1/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/13582/mbox/", "series": [ { "id": 2427, "url": "https://patchwork.libcamera.org/api/1.1/series/2427/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2427", "date": "2021-08-31T09:34:36", "name": "android: Request one stream for identica stream requests", "version": 3, "mbox": "https://patchwork.libcamera.org/series/2427/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13582/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13582/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 AC171BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 31 Aug 2021 09:34:53 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6531869174;\n\tTue, 31 Aug 2021 11:34:53 +0200 (CEST)", "from mail-pf1-x432.google.com (mail-pf1-x432.google.com\n\t[IPv6:2607:f8b0:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 656A66916F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 31 Aug 2021 11:34:51 +0200 (CEST)", "by mail-pf1-x432.google.com with SMTP id 7so14464002pfl.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 31 Aug 2021 02:34:51 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:3c62:aba4:18ea:5441])\n\tby smtp.gmail.com with ESMTPSA id\n\tw5sm19787885pgp.79.2021.08.31.02.34.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 31 Aug 2021 02:34:49 -0700 (PDT)" ], "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=\"NxRCMWfu\"; 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=kfdDR7CMTSehSAbQHQbZcEcBqDud9VmKWl34D7lM/4g=;\n\tb=NxRCMWfur2v91WZVM6YfMJlmMg1e/q6pt9Y+eAAz+Gi3oziNX8DCqZY8XMCLK7Gtxn\n\terl8zYApTYMbm3VLrUCyoaTuCPWe9tAVqsa3ekPV75kU7wXtg0yvuxLAnbXVD2VTbY2E\n\tzD0Mi3I0umOxMcmOPewXFGryjDp0zswkuZt0c=", "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=kfdDR7CMTSehSAbQHQbZcEcBqDud9VmKWl34D7lM/4g=;\n\tb=RWPDVxZvSAifzs9prPl/iBlW9FDH8y57e15VAm5LBm9wfrrqS5AGALDGvmnSg0PFK6\n\t57uWjbBR9UUP5ync/CKCQ3XHqYoi72odX15AuZXbaBJ3aN6kU1d2zsl7Q+N25ImIOUZx\n\tgzQoxUQ3YcysyuvSSdIUihpBcku0C8T0swK9biQZkp3g2o5M/f53TBfjrS27bOGqV/a3\n\tnCzNokXbZHHVd0qS+2CGuBUZ8vKI/JIGe2h8h2yS0azn0hzN3vr/5fhYR5NNNhfN8bVY\n\txwC0PTEMFoSi64rFzuwBXl36aDEzb+eKJF53D9sn0EdFzyyOZsN2TcI3pcxpGHX31qqI\n\tEnNg==", "X-Gm-Message-State": "AOAM531fwqulHhFVPpi3aML06v4ioXEJnvMxoBHBKXiBOoHjowvgUUNA\n\tL3ICrFKtaIuAcFU7UdqrCkRVj20a1LtrSA==", "X-Google-Smtp-Source": "ABdhPJwqep0jFIVNhV/wHJ9PTBy6/sN/mfLHM7q99WHhOnPCcc02RC5DrU3tYhsdGwyjg3h5vpUYog==", "X-Received": "by 2002:aa7:9e4d:0:b0:3f8:6326:a038 with SMTP id\n\tz13-20020aa79e4d000000b003f86326a038mr17696249pfq.73.1630402489624; \n\tTue, 31 Aug 2021 02:34:49 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 31 Aug 2021 18:34:39 +0900", "Message-Id": "<20210831093439.853586-4-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.33.0.259.gc128427fd7-goog", "In-Reply-To": "<20210831093439.853586-1-hiroh@chromium.org>", "References": "<20210831093439.853586-1-hiroh@chromium.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 3/3] android: camera_device: Configure\n\tone stream for identical stream requests", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "An Android HAL client may request identical stream requests. It is\nredundant that a native camera device produces a separate stream for\neach of the identical requests.\nConfigure camera one stream configuration for the identical stream\nrequests.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 28 +++++++++++++++++++++++-----\n 1 file changed, 23 insertions(+), 5 deletions(-)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 74a95a2a..1cb4e675 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -618,14 +618,32 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n \t\t\tcontinue;\n \t\t}\n \n+\t\t/* This stream will be produced by hardware. */\n+\t\tstream->usage |= GRALLOC_USAGE_HW_CAMERA_WRITE;\n+\n+\t\t/*\n+\t\t * If a CameraStream with the same size and format of the\n+\t\t * current stream has already been requested, associate the two.\n+\t\t */\n+\t\tauto iter = std::find_if(\n+\t\t\tstreamConfigs.begin(), streamConfigs.end(),\n+\t\t\t[size, format](const Camera3StreamConfig &streamConfig) {\n+\t\t\t\treturn streamConfig.config.size == size &&\n+\t\t\t\t streamConfig.config.pixelFormat == format;\n+\t\t\t});\n+\t\tif (iter != streamConfigs.end()) {\n+\t\t\t/* Add usage to copy the buffer in streams[0] to stream. */\n+\t\t\titer->streams[0].stream->usage |= GRALLOC_USAGE_SW_READ_OFTEN;\n+\t\t\tstream->usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;\n+\t\t\titer->streams.push_back({ stream, CameraStream::Type::Mapped });\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tCamera3StreamConfig streamConfig;\n \t\tstreamConfig.streams = { { stream, CameraStream::Type::Direct } };\n \t\tstreamConfig.config.size = size;\n \t\tstreamConfig.config.pixelFormat = format;\n \t\tstreamConfigs.push_back(std::move(streamConfig));\n-\n-\t\t/* This stream will be produced by hardware. */\n-\t\tstream->usage |= GRALLOC_USAGE_HW_CAMERA_WRITE;\n \t}\n \n \t/* Now handle the MJPEG streams, adding a new stream if required. */\n@@ -1144,12 +1162,12 @@ void CameraDevice::requestComplete(Request *request)\n \t\tresultMetadata = std::make_unique<CameraMetadata>(0, 0);\n \t}\n \n-\t/* Handle any JPEG compression. */\n+\t/* Handle post-processing. */\n \tfor (camera3_stream_buffer_t &buffer : descriptor.buffers_) {\n \t\tCameraStream *cameraStream =\n \t\t\tstatic_cast<CameraStream *>(buffer.stream->priv);\n \n-\t\tif (cameraStream->camera3Stream().format != HAL_PIXEL_FORMAT_BLOB)\n+\t\tif (cameraStream->type() == CameraStream::Type::Direct)\n \t\t\tcontinue;\n \n \t\tFrameBuffer *src = request->findBuffer(cameraStream->stream());\n", "prefixes": [ "libcamera-devel", "v3", "3/3" ] }