{"id":17086,"url":"https://patchwork.libcamera.org/api/1.1/covers/17086/?format=json","web_url":"https://patchwork.libcamera.org/cover/17086/","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":"<20220812090838.1784703-1-hanlinchen@chromium.org>","date":"2022-08-12T09:08:31","name":"[libcamera-devel,v2,0/7] Implement Android Partial Result Featrue","submitter":{"id":98,"url":"https://patchwork.libcamera.org/api/1.1/people/98/?format=json","name":"Hanlin Chen","email":"hanlinchen@chromium.org"},"mbox":"https://patchwork.libcamera.org/cover/17086/mbox/","series":[{"id":3408,"url":"https://patchwork.libcamera.org/api/1.1/series/3408/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3408","date":"2022-08-12T09:08:31","name":"Implement Android Partial Result Featrue","version":2,"mbox":"https://patchwork.libcamera.org/series/3408/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/17086/comments/","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 70140C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Aug 2022 09:08:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E146763327;\n\tFri, 12 Aug 2022 11:08:46 +0200 (CEST)","from mail-pg1-x536.google.com (mail-pg1-x536.google.com\n\t[IPv6:2607:f8b0:4864:20::536])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5F48663326\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Aug 2022 11:08:45 +0200 (CEST)","by mail-pg1-x536.google.com with SMTP id q16so323653pgq.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Aug 2022 02:08:45 -0700 (PDT)","from localhost ([2401:fa00:1:17:1705:d284:d114:2e24])\n\tby smtp.gmail.com with UTF8SMTPSA id\n\tkb7-20020a17090ae7c700b001f56a5e5d2fsm15839434pjb.2.2022.08.12.02.08.42\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tFri, 12 Aug 2022 02:08:43 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660295326;\n\tbh=29yAFgEUXgO/HQGbpev1YLTzXJFLwiDR8/fWXyc8Vwo=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=1ZvKG30TjpaWscM5nwLWznFBMM00uVJVWC+dWeNQlr2xYrdaQH4P/OsjWpJeqisTE\n\tsnovQkatw6TACOb5eZcmPK/+4kfjAwaMUOPirZkMQTijsnDbGA2SAfb6ls34+s5X1i\n\tqaCzop0SraT3JNATgQwCO/u6D1Dlr7lskbquswH+fkitYpwcbf+NJbJ1Qj7//RfwRc\n\tiADYi4uqjgwi4+PDJm+0nZAySSaRq//dqIiTJVbBIEdmZVlI/x6u5RsHEkfM8UAN+T\n\tmdvt4Wy0uq0J2AHdxIHO3wXxTDjOjyCdeRIBhKrWTInTS8rlPU922lTqVwgKbxlwEQ\n\tNousRt0CpLgjw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc;\n\tbh=bNaNPCkZcVjd2jXt2ZOgjr0tUGshs+CpLx3V6pvqums=;\n\tb=biwKdXhbn9YI8quZH8mIhjQRsobOnzSVcx65n6S5Vvmzq9R6IpMxJ598EDODy9HmEb\n\t0rbh62E6yL7hIydFnwwLBReCq3KU47R4oMY5czyZgwj+SJbVIYRmnCWwUPtsan5tmsmi\n\tzydbUvSMOhPh3s+4DK4wKeV/u0Vti3t1pySdY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"biwKdXhb\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc;\n\tbh=bNaNPCkZcVjd2jXt2ZOgjr0tUGshs+CpLx3V6pvqums=;\n\tb=3QYD4dHKuzyDaWT+r0bWvAhvZL3S7kdFzU1OnGX9PeV/sTiwcEkSwa6U4wGWjfdplh\n\tdJ4RzCqp7p97AlElpVNtY3GZ8XLHkcH9D1DNwOEmr8XqEQLpEy/CGxnWUeUPpJLfe1Wh\n\tXuDRMJk6jNuYzKU9ufFOFZbdriZZkppmBR7ptobZ2dSqqTVPU8jpOn3gTZypAetztUR1\n\tZuYEwgmzZbY+c67jeP76ufHnkfiTVUSJMDXIo7ELT4Dji9CaK/19xEDjF0RODiUbZAnP\n\tBjCNjUkiNfNdHcXt6VVZr520yHwEFyLDMcbczt+io5+6daCKv2BQGQ8Ybu/vFgrp39z3\n\t+xZg==","X-Gm-Message-State":"ACgBeo0OV6WK7pDcDCgIRj/1A2C4hUCRJQ8D4GbubYCTXIU8l7BWIXz7\n\tuS0YNlFJ3JOuoR44UvTDzGJ5aZ2M9KgVKg==","X-Google-Smtp-Source":"AA6agR7iqi8+HPn8kW3V5iRBBz7BJnoPzV1Xu3iRNnNFiSjDMQgjnZsHDT9b1BS5+tv/BM3RQ1UbeA==","X-Received":"by 2002:a63:318a:0:b0:41c:b82a:dc6d with SMTP id\n\tx132-20020a63318a000000b0041cb82adc6dmr2417373pgx.319.1660295323465; \n\tFri, 12 Aug 2022 02:08:43 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 12 Aug 2022 17:08:31 +0800","Message-Id":"<20220812090838.1784703-1-hanlinchen@chromium.org>","X-Mailer":"git-send-email 2.37.1.595.g718a3a8f04-goog","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 0/7] Implement Android Partial Result\n\tFeatrue","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>","From":"Han-Lin Chen via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Han-Lin Chen <hanlinchen@chromium.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hi,\n\nThe series is to implement Android partial result feature, which allows\npipeline handler returns early buffers and metadata back to application before\nrequest completed.\n\nThe feature is as a preparation of implementing the following description of\nAndroid camera3 spec:\n\n* The order of returning metadata and buffers for a single result does not\n* matter, but buffers for a given stream must be returned in FIFO order. So\n* the buffer for request 5 for stream A must always be returned before the\n* buffer for request 6 for stream A. This also applies to the result\n* metadata; the metadata for request 5 must be returned before the metadata\n* for request 6.\n*\n* However, different streams are independent of each other, so it is\n* acceptable and expected that the buffer for request 5 for stream A may be\n* returned after the buffer for request 6 for stream B is. And it is\n* acceptable that the result metadata for request 6 for stream B is\n* returned before the buffer for request 5 for stream A is.\n\nThe spec is critical for ZSL implementation, because the still capture\ncan be return in an order independent to pending preview requests. This will\nenhance still capture performance by:\n1. Use cached raw frame for still capture, skip pending sensor exposure.\n2. Skip pending preview requests and return still capture concurently.\n2. HAL can pick 3A stable raw frame, so the application doesn't need to\nwait for the process of stablizing 3A (by AEPrecapture and AFTrigger).\n\nBecause Android relies on metadata to process buffer properly, bufferCompleted\nsignal is not sufficient to report partial result to framework. The\npatch series allows returning metadata earlier for pipeline handler and\nrefactor Android adaptor to return partial result as soon as possible.\n\nV2:\n  1. Add patch to for flush() waiting for all requests done before\n  return.\n  2. Change the final result returns in its o submission order.\n  3. Reorganize the reuturning order of the results to meet Android's\n  requirement that the buffers of the same stream returns in FIFO.\n\nHan-Lin Chen (7):\n  libcamera: Camera: Add RequestCompletionMode to configure the\n    completion order\n  libcamera: Camera: Add signals for completion of metadata and partial\n    result\n  libcamera: ipu3: returning partial results\n  android: Move StreamBuffer out of Camera3RequestDescriptor\n  android: Add JpegExifMetadata to store tags setting into Exif\n  android: Implement partial result feature based on\n    partialResultCompleted signal\n  android: function flush() waits for all requests completed before\n    return\n\n include/libcamera/camera.h                    |  10 +\n include/libcamera/internal/camera.h           |   4 +\n include/libcamera/internal/pipeline_handler.h |   4 +\n include/libcamera/request.h                   |  40 +\n src/android/camera_capabilities.cpp           |   2 +-\n src/android/camera_capabilities.h             |   2 +\n src/android/camera_device.cpp                 | 884 ++++++++++++------\n src/android/camera_device.h                   |  45 +-\n src/android/camera_request.cpp                |  90 +-\n src/android/camera_request.h                  | 104 ++-\n src/android/camera_stream.cpp                 |  18 +-\n src/android/camera_stream.h                   |  10 +-\n src/android/jpeg/post_processor_jpeg.cpp      |  17 +-\n src/android/jpeg/post_processor_jpeg.h        |   2 +-\n src/android/post_processor.h                  |   4 +-\n src/android/yuv/post_processor_yuv.cpp        |   2 +-\n src/android/yuv/post_processor_yuv.h          |   2 +-\n src/ipa/ipu3/ipu3.cpp                         |   2 -\n src/libcamera/camera.cpp                      |  78 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp          |  65 +-\n src/libcamera/pipeline_handler.cpp            | 141 ++-\n src/libcamera/request.cpp                     | 170 +++-\n 22 files changed, 1278 insertions(+), 418 deletions(-)"}