From patchwork Mon Oct 28 02:25:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 2260 Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 683956017C for ; Mon, 28 Oct 2019 03:25:46 +0100 (CET) X-Halon-ID: 3bb6f269-f92a-11e9-903a-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from localhost.localdomain (unknown [93.2.121.143]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 3bb6f269-f92a-11e9-903a-005056917f90; Mon, 28 Oct 2019 03:25:43 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 28 Oct 2019 03:25:13 +0100 Message-Id: <20191028022525.796995-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC 00/12] libcamera: Rework buffer API 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: , X-List-Received-Date: Mon, 28 Oct 2019 02:25:46 -0000 Hi, This is the RFC for the new buffer API, it is posted without documentation just to measure if they are going in the right direction. I'm hoping for review of the code that touches cam, qcam and pipeline handlers to judge if the new API is easy and neat to use for developers. I'm sure the inner plumbing can be reviewed in a potential v1 where proper documentation will be available. I'm sorry for the large patches at the end, but as the rework touches pretty much every part of the code base it's hard to break it down. If anyone spot any obvious way to break it down even further please let me know and I will work on it for v1. This series depends on the buffer cleanup series [1]. 1. [PATCH 00/10] libcamera: Fixes found while working on new buffer API Niklas Söderlund (12): test: camera: buffer_import: Remove test libcamera: pipelines: Explicitly allocate streams libcamera: pipeline: Add helper to find request from buffer libcamera: pipelines: Switch to helper to resolve request from buffer libcamera: buffer: Remove request tracking libcamera: stream: Add prototypes for new interface libcamera: buffer: Add dedicated container for buffer information libcamera: buffer: Add a buffer allocator libcamera: v4l2_videodevice: Add a buffer cache class libcamera: buffer: Store buffer information in separate container libcamera: buffer: Switch to new buffer API libcamera: buffer: Clean up after buffer API switch include/ipa/ipa_interface.h | 2 +- include/libcamera/buffer.h | 90 ++-- include/libcamera/request.h | 8 +- include/libcamera/stream.h | 21 +- src/cam/buffer_writer.cpp | 12 +- src/cam/buffer_writer.h | 4 +- src/cam/capture.cpp | 53 ++- src/cam/capture.h | 3 +- src/ipa/rkisp1/rkisp1.cpp | 14 +- src/libcamera/buffer.cpp | 325 ++++--------- src/libcamera/camera.cpp | 47 +- src/libcamera/include/pipeline_handler.h | 5 +- src/libcamera/include/v4l2_videodevice.h | 56 ++- src/libcamera/pipeline/ipu3/ipu3.cpp | 269 ++++------- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 131 +++--- src/libcamera/pipeline/uvcvideo.cpp | 35 +- src/libcamera/pipeline/vimc.cpp | 36 +- src/libcamera/pipeline_handler.cpp | 15 +- src/libcamera/request.cpp | 22 +- src/libcamera/stream.cpp | 241 ---------- src/libcamera/v4l2_videodevice.cpp | 367 ++++++++------- src/qcam/main_window.cpp | 61 ++- src/qcam/main_window.h | 5 +- test/camera/buffer_import.cpp | 432 ------------------ test/camera/capture.cpp | 33 +- test/camera/meson.build | 1 - test/camera/statemachine.cpp | 12 +- test/v4l2_videodevice/buffer_sharing.cpp | 36 +- test/v4l2_videodevice/capture_async.cpp | 16 +- test/v4l2_videodevice/request_buffers.cpp | 11 +- test/v4l2_videodevice/stream_on_off.cpp | 6 +- test/v4l2_videodevice/v4l2_m2mdevice.cpp | 44 +- test/v4l2_videodevice/v4l2_videodevice_test.h | 2 +- 33 files changed, 749 insertions(+), 1666 deletions(-) delete mode 100644 test/camera/buffer_import.cpp