{"id":12913,"url":"https://patchwork.libcamera.org/api/covers/12913/?format=json","web_url":"https://patchwork.libcamera.org/cover/12913/","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":"<20210712215645.30478-1-laurent.pinchart@ideasonboard.com>","date":"2021-07-12T21:56:15","name":"[libcamera-devel,v2,00/30] Multi-camera support in the cam application","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/12913/mbox/","series":[{"id":2229,"url":"https://patchwork.libcamera.org/api/series/2229/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2229","date":"2021-07-12T21:56:15","name":"Multi-camera support in the cam application","version":2,"mbox":"https://patchwork.libcamera.org/series/2229/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/12913/comments/","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 29A87C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 12 Jul 2021 21:57:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 59BE168529;\n\tMon, 12 Jul 2021 23:57:37 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DED9568513\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Jul 2021 23:57:35 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A843CC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Jul 2021 23:57:35 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LGyUddkf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1626127055;\n\tbh=dttNvdFUCooHHtm5r8mjjbtuPUXEqO1yHLUQ7lBvp7w=;\n\th=From:To:Subject:Date:From;\n\tb=LGyUddkfb+BiO8Oo0DgRwwDnNj02DHzEimYQARcsG0rj4YYVNLCzFEUNItPmex+Z0\n\tE43Rz/wUPbhVgWyjtNtQnBjJDuzquH0Ic6MDXny1eViiOv02Fge1xshTcOd1BxKOT3\n\t+tBl2OQKEN62QWos9VinbigvMHIuo44woh604WZg=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 13 Jul 2021 00:56:15 +0300","Message-Id":"<20210712215645.30478-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 00/30] Multi-camera support in the cam\n\tapplication","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hello,\n\nThis patch series adds multi-camera support to the cam application,\nallowing it to capture streams from different cameras at the same time.\nWhile this can be used with any cameras, it is most useful to test\nconcurrent usage of different cameras belonging to the same pipeline\nhandler, as multiple cam instances can be run in parallel to capture\nfrom cameras belonging to different pipeline handlers.\n\nThe patch series starts with a rework of the options parser to support\nparent-child relationships in options, allowing for syntaxes such as\n\ncam -c1 -C20 -c2 -C30\n\nto capture 20 and 30 frames from cameras 1 and 2 respectively. The\nsecond part of the series reworks the cam application to slowly move\ntowards multi-camera support, with the last patch flipping the switch.\n\nI've tested this successfully with cameras belonging to different\npipeline handler instances. The PipelineHandler::lock() function\ncurrently prevents concurrent usage of cameras belonging to the same\npipeline handler. While this will need to be addressed in order to get\nthe full potential from multi-camera support in cam, the cam application\nis expected to work the same way regardless of whether the cameras\nbelong to the same or different pipeline handlers.\n\nCompared to v1, this version incorporates small fixes to address review\ncomments. Thanks Kieran for the review of v1, only \"[PATCH v2 11/30]\ncam: options: Avoid copies of OptionvValue and KeyValueParser::Options\"\nis missing your tag.\n\nA test branch with all the patches applied is available from\n\nhttps://git.libcamera.org/libcamera/pinchartl/libcamera.git/log/?h=cam/multi-cam\n\nLaurent Pinchart (30):\n  cam: options: Make KeyValueParser::usage() private\n  cam: options: Move Option struct to options.cpp\n  cam: options: Document the options parser API\n  cam: options: Move OptionValue class after OptionsParser\n  cam: options: Add optionName() function to Option structure\n  cam: options: Slit OptionsParser::usage() in two functions\n  cam: options: Disable copy for parsers\n  cam: options: Move key string left in usage() for key-value parser\n  cam: options: Support parent-child relationship between options\n  cam: options: Drop some OptionValue cast operators\n  cam: options: Avoid copies of OptionvValue and KeyValueParser::Options\n  cam: Rename Capture to CameraSession\n  cam: camera_session: Access event loop through global instance\n  cam: Move event loop exit from CameraSession to CamApp\n  cam: Move event loop execution from CameraSession to CamApp\n  cam: camera_session: Use std::unique_ptr<> to manage class members\n  cam: Store camera session pointer in CamApp class\n  cam: Move CameraConfiguration creation to CameraSession class\n  cam: Move camera acquire to the CameraSession class\n  cam: Use std::unique_ptr<> to manage CameraManager\n  cam: Drop unneeded error check and message\n  cam: Make CamApp::cameraName() static\n  cam: Move camera session creation and monitoring setup to run()\n  cam: Move printing of camera information to CameraSession class\n  cam: Move session_ member variable to a local variable in run()\n    function\n  cam: Reorganize run() function and merge the two event loops\n  cam: Allow specifying directories in the --file option\n  cam: Make camera-related options sub-options of OptCamera\n  cam: Add camera index to file name of capture frames\n  cam: Support using multiple cameras concurrently\n\n src/cam/buffer_writer.cpp  |   7 +-\n src/cam/buffer_writer.h    |   2 +-\n src/cam/camera_session.cpp | 345 ++++++++++++++++++\n src/cam/camera_session.h   |  76 ++++\n src/cam/capture.cpp        | 241 -------------\n src/cam/capture.h          |  55 ---\n src/cam/main.cpp           | 312 ++++++----------\n src/cam/meson.build        |   2 +-\n src/cam/options.cpp        | 708 +++++++++++++++++++++++++++++++++----\n src/cam/options.h          |  97 ++---\n src/cam/stream_options.cpp |   3 +-\n 11 files changed, 1228 insertions(+), 620 deletions(-)\n create mode 100644 src/cam/camera_session.cpp\n create mode 100644 src/cam/camera_session.h\n delete mode 100644 src/cam/capture.cpp\n delete mode 100644 src/cam/capture.h"}