| Related |
show
-
[libcamera-devel,v3,00/33] Multi-camera support in the cam application
-
[libcamera-devel,v3,01/33] cam: options: Make KeyValueParser::usage() private
-
[libcamera-devel,v3,02/33] cam: options: Move Option struct to options.cpp
-
[libcamera-devel,v3,03/33] cam: options: Document the options parser API
-
[libcamera-devel,v3,04/33] cam: options: Move OptionValue class after OptionsParser
-
[libcamera-devel,v3,05/33] cam: options: Add optionName() function to Option structure
-
[libcamera-devel,v3,06/33] cam: options: Slit OptionsParser::usage() in two functions
-
[libcamera-devel,v3,07/33] cam: options: Disable copy for parsers
-
[libcamera-devel,v3,08/33] cam: options: Move key string left in usage() for key-value parser
-
[libcamera-devel,v3,09/33] cam: options: Support parent-child relationship between options
-
[libcamera-devel,v3,10/33] cam: options: Drop some OptionValue cast operators
-
[libcamera-devel,v3,11/33] cam: options: Add empty() function to OptionValue class
-
[libcamera-devel,v3,12/33] cam: stream_options: Use OptionValue::empty() to test if option is set
-
[libcamera-devel,v3,13/33] cam: options: Avoid copies of OptionvValue and KeyValueParser::Options
-
[libcamera-devel,v3,14/33] cam: options: Fail parsing when non-option arguments are found
-
[libcamera-devel,v3,15/33] cam: Rename Capture to CameraSession
-
[libcamera-devel,v3,16/33] cam: camera_session: Access event loop through global instance
-
[libcamera-devel,v3,17/33] cam: Move event loop exit from CameraSession to CamApp
-
[libcamera-devel,v3,18/33] cam: Move event loop execution from CameraSession to CamApp
-
[libcamera-devel,v3,19/33] cam: camera_session: Use std::unique_ptr<> to manage class members
-
[libcamera-devel,v3,20/33] cam: Store camera session pointer in CamApp class
-
[libcamera-devel,v3,21/33] cam: Move CameraConfiguration creation to CameraSession class
-
[libcamera-devel,v3,22/33] cam: Move camera acquire to the CameraSession class
-
[libcamera-devel,v3,23/33] cam: Use std::unique_ptr<> to manage CameraManager
-
[libcamera-devel,v3,24/33] cam: Drop unneeded error check and message
-
[libcamera-devel,v3,25/33] cam: Make CamApp::cameraName() static
-
[libcamera-devel,v3,26/33] cam: Move camera session creation and monitoring setup to run()
-
[libcamera-devel,v3,27/33] cam: Move printing of camera information to CameraSession class
-
[libcamera-devel,v3,28/33] cam: Move session_ member variable to a local variable in run() function
-
[libcamera-devel,v3,29/33] cam: Reorganize run() function and merge the two event loops
-
[libcamera-devel,v3,30/33] cam: Allow specifying directories in the --file option
-
[libcamera-devel,v3,31/33] cam: Make camera-related options sub-options of OptCamera
-
[libcamera-devel,v3,32/33] cam: Add camera index to file name of capture frames
-
[libcamera-devel,v3,33/33] cam: Support using multiple cameras concurrently
|
Hello, This patch series adds multi-camera support to the cam application, allowing it to capture streams from different cameras at the same time. While this can be used with any cameras, it is most useful to test concurrent usage of different cameras belonging to the same pipeline handler, as multiple cam instances can be run in parallel to capture from cameras belonging to different pipeline handlers. The patch series starts with a rework of the options parser to support parent-child relationships in options, allowing for syntaxes such as cam -c1 -C20 -c2 -C30 to capture 20 and 30 frames from cameras 1 and 2 respectively. The second part of the series reworks the cam application to slowly move towards multi-camera support, with the last patch flipping the switch. I've tested this successfully with cameras belonging to different pipeline handler instances. The PipelineHandler::lock() function currently prevents concurrent usage of cameras belonging to the same pipeline handler. While this will need to be addressed in order to get the full potential from multi-camera support in cam, the cam application is expected to work the same way regardless of whether the cameras belong to the same or different pipeline handlers. Compared to v2, this version fixes an embarassing bug caused by an assert added at the last minute. The fix is in patch 12/33, with 11/33 adding a small new API extension to support it. Patch 13/33 is also new, and catches a common user error. Compared to v1, this version incorporates small fixes to address review comments. Thanks Kieran for the review of v1, only "[PATCH v2 11/30] cam: options: Avoid copies of OptionvValue and KeyValueParser::Options" is missing your tag. A test branch with all the patches applied is available from https://git.libcamera.org/libcamera/pinchartl/libcamera.git/log/?h=cam/multi-cam Laurent Pinchart (33): cam: options: Make KeyValueParser::usage() private cam: options: Move Option struct to options.cpp cam: options: Document the options parser API cam: options: Move OptionValue class after OptionsParser cam: options: Add optionName() function to Option structure cam: options: Slit OptionsParser::usage() in two functions cam: options: Disable copy for parsers cam: options: Move key string left in usage() for key-value parser cam: options: Support parent-child relationship between options cam: options: Drop some OptionValue cast operators cam: options: Add empty() function to OptionValue class cam: stream_options: Use OptionValue::empty() to test if option is set cam: options: Avoid copies of OptionvValue and KeyValueParser::Options cam: options: Fail parsing when non-option arguments are found cam: Rename Capture to CameraSession cam: camera_session: Access event loop through global instance cam: Move event loop exit from CameraSession to CamApp cam: Move event loop execution from CameraSession to CamApp cam: camera_session: Use std::unique_ptr<> to manage class members cam: Store camera session pointer in CamApp class cam: Move CameraConfiguration creation to CameraSession class cam: Move camera acquire to the CameraSession class cam: Use std::unique_ptr<> to manage CameraManager cam: Drop unneeded error check and message cam: Make CamApp::cameraName() static cam: Move camera session creation and monitoring setup to run() cam: Move printing of camera information to CameraSession class cam: Move session_ member variable to a local variable in run() function cam: Reorganize run() function and merge the two event loops cam: Allow specifying directories in the --file option cam: Make camera-related options sub-options of OptCamera cam: Add camera index to file name of capture frames cam: Support using multiple cameras concurrently src/cam/buffer_writer.cpp | 7 +- src/cam/buffer_writer.h | 2 +- src/cam/camera_session.cpp | 345 ++++++++++++++++++ src/cam/camera_session.h | 76 ++++ src/cam/capture.cpp | 241 ------------- src/cam/capture.h | 55 --- src/cam/main.cpp | 312 ++++++---------- src/cam/meson.build | 2 +- src/cam/options.cpp | 722 +++++++++++++++++++++++++++++++++---- src/cam/options.h | 98 ++--- src/cam/stream_options.cpp | 15 +- 11 files changed, 1249 insertions(+), 626 deletions(-) create mode 100644 src/cam/camera_session.cpp create mode 100644 src/cam/camera_session.h delete mode 100644 src/cam/capture.cpp delete mode 100644 src/cam/capture.h