From patchwork Tue Mar 30 05:25:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11784 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 752DBC32F0 for ; Tue, 30 Mar 2021 05:25:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2F3C36878D; Tue, 30 Mar 2021 07:25:38 +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="YPRBJECO"; dkim-atps=neutral Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4EEEF602D7 for ; Tue, 30 Mar 2021 07:25:35 +0200 (CEST) Received: by mail-pf1-x430.google.com with SMTP id v10so6013036pfn.5 for ; Mon, 29 Mar 2021 22:25:35 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=gVOz5jVRMv2He7b+Ik480Ku/8IyMwqhHk6RVu2nSBAE=; b=YPRBJECOgk6oBmnYpt6bCjtCtrD7CeDx6bJhBkYt/47hS2xce/YTqGTJhlOChlV++I hPwY3xmLfBJoM7l8yvUOHQITsY1H6cfKOlKvfkBzezoA8OLJ5JPIVFPlSP4RQPxSXRy8 7JUZHxdw1hBRRDo7GiY1xKhQExhobcW9pCZjM= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gVOz5jVRMv2He7b+Ik480Ku/8IyMwqhHk6RVu2nSBAE=; b=c8OQglgnpK5XYY60FFT3AOsRguI8lewdrZTIXz0RJX/XVTKsNCDDxeRdusvXFmabzi ZvhQtX5jCjtqLEajjvK3v3wrIN67AVetoyIvS4/OBs/KqFeKuGVB4fCbPCX78q7cSKQv B8ge84p33x+09/6qGmbVykHXOulSq+K2QVEqTQaqTEzeOMMY066rnk5/kKTrJd3PoXWN dHVdSzrVTeIWHBsw8XMvGFmn/YBtOvvFUoJ7AGRTawNn0gQa+acYTiTMEDk+DZ9uedcU g/uJZnHarNsEEIbkNXmSvHTjzixHXlMmBNJ/hxjrhr3st8Twyxv04Us5ta6utzW3pklm Xe1w== X-Gm-Message-State: AOAM532vbXEL7eUaGpXzADPz5WGK1yEelXvRTonpYz7Xwrg/AUj1htEo PQX4LK6mca9Cxm1WGW/yBqLv4H+Y0t699A== X-Google-Smtp-Source: ABdhPJzKF862Pl+SD7yCMeO6d5McPzeIbSfo6++Ptd1kDJg2IOnRn1Kx5lKXkejmGoXZPHcJKn/1jg== X-Received: by 2002:a62:6883:0:b029:220:4426:449c with SMTP id d125-20020a6268830000b02902204426449cmr25257365pfc.14.1617081933782; Mon, 29 Mar 2021 22:25:33 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:c112:2822:484f:486]) by smtp.gmail.com with ESMTPSA id u79sm19726006pfc.207.2021.03.29.22.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 22:25:33 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 30 Mar 2021 14:25:21 +0900 Message-Id: <20210330052521.381550-5-hiroh@chromium.org> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210330052521.381550-1-hiroh@chromium.org> References: <20210330052521.381550-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/4] android: CameraDevice: Deny non ROTATION_0 stream configuration 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" libcamera doesn't handle crop_rotate_scale_degrees. Therefore, if it is requested, that is, crop_rotate_scale_degrees is not CAMERA3_STREAM_ROTATION_0, the configuration should fail. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/android/camera_device.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index e0eaa3b5..344522ba 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1657,6 +1657,18 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) if (!format.isValid()) return -EINVAL; + /* \todo Support rotation. */ + if (stream->rotation != CAMERA3_STREAM_ROTATION_0) { + LOG(HAL, Error) << "Rotation is not supported"; + return -EINVAL; + } +#if defined(CHROMEOS) + if (stream->crop_rotate_scale_degrees != CAMERA3_STREAM_ROTATION_0) { + LOG(HAL, Error) << "Rotation is not supported"; + return -EINVAL; + } +#endif + /* Defer handling of MJPEG streams until all others are known. */ if (stream->format == HAL_PIXEL_FORMAT_BLOB) { if (jpegStream) {