From patchwork Sat Apr 3 13:10:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11828 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 0AA88C0DA3 for ; Sat, 3 Apr 2021 13:10:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B28F268798; Sat, 3 Apr 2021 15:10:28 +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="FzOruzt3"; dkim-atps=neutral Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 59B7168791 for ; Sat, 3 Apr 2021 15:10:27 +0200 (CEST) Received: by mail-pl1-x636.google.com with SMTP id t5so1698701plg.9 for ; Sat, 03 Apr 2021 06:10:27 -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=mNIc070cnoO6de/trc4kKmm+W/FgPNJRZXCbAsx3nNY=; b=FzOruzt3IJzWrPxDbawKMbqjoYD7W4jfc+0EaVqwNO3OFTMNpX8U3qP5vfsWfhxV88 h5ykwqPkT/q20nzj+3b2sW/PfZiMM+/pbA/f+QHkrkgBZgRSGiZCrLpHzZyGzmWHrWwZ WiTE46GSkgPN3WsHpWRTDvHtDoxa/+LuvyGEU= 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=mNIc070cnoO6de/trc4kKmm+W/FgPNJRZXCbAsx3nNY=; b=gR/qCrLzErKXikASQ3B7ldifbYjb2laSI2fnXFlrmBu86Z3p/OZpLYe0+V3AijMeN4 K+68hPhYjQD6ouq06sxXMa1amsCx3vtoclS22AFHAbyj9G2C8IVlbXqtfnjNKpDejgTR qO0CXqQZYgYrxUMc9BfeaKkqUL+FtglrkrBe2QLnpZmEve6cJzUJeLhTeLmRPrZQtWVR ckNs11NDazRLzth29UUiDCvQyHt7x1ous2diLF0waHdrGXkYDAc9qqKebipsksMUZw9I UbNyXpYjWzzZNImDyt9D/dYy4loDOQiWTf2w7s53jlzp9ndXdus6YZE7caLyi62nRvOh F5/w== X-Gm-Message-State: AOAM530R6mWYPhApGJuDPVMHaHM1K/q08EdhcxZ2aDOnkD035JcYZhXE GeAZ5h7VZTWuVmRaTJDpTSHUJ3cxCSfNvA== X-Google-Smtp-Source: ABdhPJwd0x6mqoSZuqsnXiNkDRQCNIgVlTJ51SM5Q9mJMKn4D56wpWaaFpLBy9Jfkjh8w0AjF/coJw== X-Received: by 2002:a17:903:22d1:b029:e7:1052:a979 with SMTP id y17-20020a17090322d1b02900e71052a979mr16729357plg.16.1617455425772; Sat, 03 Apr 2021 06:10:25 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:d1f5:1b96:f027:f646]) by smtp.gmail.com with ESMTPSA id h6sm11303271pfb.157.2021.04.03.06.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Apr 2021 06:10:25 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Sat, 3 Apr 2021 22:10:15 +0900 Message-Id: <20210403131015.1590399-4-hiroh@chromium.org> X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog In-Reply-To: <20210403131015.1590399-1-hiroh@chromium.org> References: <20210403131015.1590399-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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 ddac56da..2c8f76e7 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1656,6 +1656,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(OS_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) {