From patchwork Mon Apr 26 03:02:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12107 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id CFDB6BDC91 for ; Mon, 26 Apr 2021 03:02:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0737468881; Mon, 26 Apr 2021 05:02:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lnE2uELy"; dkim-atps=neutral Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5931E605BD for ; Mon, 26 Apr 2021 05:02:32 +0200 (CEST) Received: by mail-pf1-x42d.google.com with SMTP id q2so6036456pfk.9 for ; Sun, 25 Apr 2021 20:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wL4y5vpF1628BgbYGtyNF4JqIvnn2Qlk2KsQFYCqwnY=; b=lnE2uELyg6RMPNAOqb0d72798FOj9/3A63ipHx6k+0uxNjxEsMvxoo0Ka46mdd2jLE GTVd9nw5XNBulxMg7+ExlALlbOd4PrGdwWSPCXQSaVhOUAwoJkiECMkJQ/9vfAzBe0BF aBpKUHdGCXdfXI+6e0CNbDMeLib2EVOft+6OE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wL4y5vpF1628BgbYGtyNF4JqIvnn2Qlk2KsQFYCqwnY=; b=ZIAVr/If05SBM3cX3NRm4gr9WHl8Zsy0A7rTb3GyQ2W46l3KjdPMkF0ITaciWDRql+ AagolS6DkOhaLQ/13PMEzYQfFC1mzti3QXUOwHTU4q3JPQSB55K8JAK2vWCEiigPuSpL hlOqGMWjDyOLfFpct5jzagHFzlOrV5417Wux40Zb9vEzuzgTvTdNES0GUCgIkJhzar5i 5MxviS9KXhOAjokYwWFmtFVMG0tJzmkhD6daHd8A4CtyJ8oQC6TUILTGkjjn/b9+uCz7 h5oMnLKSJGSzLT+hwq6jhnWy9udlGssaXOtl8nho7Mp6CFJKr9iABqTlB9J5tuQjoNur vFCA== X-Gm-Message-State: AOAM5328hLloAfJnQt/xor9hSCWmCfIRe+74jyj1qaR7Q7148Ykyp8lo pCQaUDbevBVYvCUB+L9DIPgvW02mu7/UlQ== X-Google-Smtp-Source: ABdhPJwhaC9WnfKyB1zQBok2kyjFHvWTGsI+irV+U+hfY4ia2EordAWSGRYSYbkiJJi0Cnl2KFlr0g== X-Received: by 2002:a65:6242:: with SMTP id q2mr15064915pgv.277.1619406150332; Sun, 25 Apr 2021 20:02:30 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:56d0:a14c:fac3:5bc3]) by smtp.gmail.com with ESMTPSA id p126sm9966561pga.86.2021.04.25.20.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Apr 2021 20:02:29 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 26 Apr 2021 12:02:24 +0900 Message-Id: <20210426030224.2255533-1-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.498.g6c1eba8ee3d-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] android: CameraDevice: Skip post processings to unsuccessful buffers X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This skips executing post processings to unsuccessful buffers as they are meaningless. Signed-off-by: Hirokazu Honda --- src/android/camera_device.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index a71aee2f..abb06810 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -2064,6 +2064,9 @@ void CameraDevice::requestComplete(Request *request) /* Handle any JPEG compression. */ for (camera3_stream_buffer_t &buffer : descriptor.buffers_) { + if (status == CAMERA3_BUFFER_STATUS_ERROR) + continue; + CameraStream *cameraStream = static_cast(buffer.stream->priv); @@ -2076,6 +2079,12 @@ void CameraDevice::requestComplete(Request *request) continue; } + if (src->metadata().status != FrameMetadata::FrameSuccess) { + LOG(HAL, Debug) << "Skip post-processing because the " + << "buffer is not filled successfully"; + continue; + } + int ret = cameraStream->process(*src, *buffer.buffer, descriptor.settings_,