{"id":11829,"url":"https://patchwork.libcamera.org/api/patches/11829/?format=json","web_url":"https://patchwork.libcamera.org/patch/11829/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20210403131828.1591652-1-hiroh@chromium.org>","date":"2021-04-03T13:18:28","name":"[libcamera-devel] android: CameraDevice: Deny if the streams is empty","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"32d8b217eaacaa04b4a5b7613d90e1e31947066d","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11829/mbox/","series":[{"id":1886,"url":"https://patchwork.libcamera.org/api/series/1886/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1886","date":"2021-04-03T13:18:28","name":"[libcamera-devel] android: CameraDevice: Deny if the streams is empty","version":1,"mbox":"https://patchwork.libcamera.org/series/1886/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11829/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11829/checks/","tags":{},"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 31B87BD695\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  3 Apr 2021 13:18:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9CCCC602E6;\n\tSat,  3 Apr 2021 15:18:38 +0200 (CEST)","from mail-pg1-x532.google.com (mail-pg1-x532.google.com\n\t[IPv6:2607:f8b0:4864:20::532])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A6922602CF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Apr 2021 15:18:36 +0200 (CEST)","by mail-pg1-x532.google.com with SMTP id p12so1196140pgj.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 03 Apr 2021 06:18:36 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:d1f5:1b96:f027:f646])\n\tby smtp.gmail.com with ESMTPSA id\n\tm7sm11380819pfd.52.2021.04.03.06.18.33\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 03 Apr 2021 06:18:34 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"E/FGB+bM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=FRYwpVwp47U1QWe3DEdYTBnq/3J1MCNkAkBcVyEVTEU=;\n\tb=E/FGB+bMznCyo98UZpHZgUMyUTKNKv1qT/Dx/7Mhr+9QdOS5JDwUODh+1cOAmCGrQy\n\t9McNdproX5Bx98fLhFTgvxwyL3JCZ865SbcbWWFfgVnCbdBEvZR6z1WRWhb+mEZ48hwM\n\tafQ6tBrAhhrPNDlfeRgNy6FsKGVdfLS1ap8t8=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=FRYwpVwp47U1QWe3DEdYTBnq/3J1MCNkAkBcVyEVTEU=;\n\tb=slbNeBor+lamruEk10ndSmwYo/RCSP1AoOBQEvFc98Jd4y06u/JYalP3/Jhcu8pD7Y\n\t1h8dUUXWmRSiNxSIhPU40NA2hqlY+PseEWZWI+D9JHustIfZFVuUSrU8wvJT1MQfbkak\n\tdTUe2QW9qRAQJd22k1xsJjJkObSqKDTM2lBvBIVeTMqo/A84+Mt4wZBF+YsaWVfA/uTK\n\tzPftBT3TQW7NB6r94utJ1coU4EtyRXF8UcLnce4oZa1U3an806owLyeeQQb7qYQBv42p\n\t+0xf4CI3h7BcCEDBg+waz8lpteOzWHn9CDKmFxRZa0H5Ok088+GSihjwa6lTmMdsAJ1D\n\tfJUQ==","X-Gm-Message-State":"AOAM533YUIZXx3rxE2XiVbJIhGa62c0rdL1MmG+LQ9v9bkInYV7kcZKk\n\t9fu8p0ls49QgocBlatesrrcagYFCpv7oBQ==","X-Google-Smtp-Source":"ABdhPJx3oKgd89OTs+rMU/xb5NHTAjuwfJ/qD4cwTMl9/z7cJ/poUBL4ySQ+3SgiZkCXvYdv2TezsQ==","X-Received":"by 2002:a63:925a:: with SMTP id\n\ts26mr15062689pgn.216.1617455914977; \n\tSat, 03 Apr 2021 06:18:34 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat,  3 Apr 2021 22:18:28 +0900","Message-Id":"<20210403131828.1591652-1-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.0.208.g409f899ff0-goog","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH] android: CameraDevice: Deny if the\n\tstreams is empty","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This checks if the number of streams is zero on configuration\nand then returns -EINVAL.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/camera_device.cpp | 5 +++++\n 1 file changed, 5 insertions(+)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex eb327978..f175ce53 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1554,6 +1554,11 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n \t\trunning_ = false;\n \t}\n \n+\tif (stream_list->num_streams == 0) {\n+\t\tLOG(HAL, Error) << \"Empty stream configuration\";\n+\t\treturn -EINVAL;\n+\t}\n+\n \t/*\n \t * Generate an empty configuration, and construct a StreamConfiguration\n \t * for each camera3_stream to add to it.\n","prefixes":["libcamera-devel"]}