From patchwork Sat Sep 12 10:11:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 9587 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 C8410C3B5B for ; Sat, 12 Sep 2020 10:08:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A5E8E62DFF; Sat, 12 Sep 2020 12:08:07 +0200 (CEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B279062D27 for ; Sat, 12 Sep 2020 12:08:06 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 0CC351BF206; Sat, 12 Sep 2020 10:08:04 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Sat, 12 Sep 2020 12:11:26 +0200 Message-Id: <20200912101129.12625-8-jacopo@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200912101129.12625-1-jacopo@jmondi.org> References: <20200912101129.12625-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 07/10] android: camera_device: Use Android format 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: , Cc: hanlinchen@chromium.org Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When iterating the camera3_stream_t received from the Android camera framework to identify the MJPEG streams, the format check was performed on the CameraStream created when iterating the non-MJPEG streams and not on the format actually requested by Android. As the next patches will remove the creation of CameraStream instances for MJPEG streams, use the camera3_stream format to prepare for that. Reviewed-by: Hirokazu Honda Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index e2c73ff4c4ce..af2905007b28 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1211,7 +1211,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) stream->priv = static_cast(&streams_[i]); /* Defer handling of MJPEG streams until all others are known. */ - if (format == formats::MJPEG) + if (stream->format == HAL_PIXEL_FORMAT_BLOB) continue; StreamConfiguration streamConfiguration; @@ -1228,7 +1228,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) camera3_stream_t *stream = stream_list->streams[i]; bool match = false; - if (streams_[i].format != formats::MJPEG) + if (stream->format != HAL_PIXEL_FORMAT_BLOB) continue; /* Search for a compatible stream */