From patchwork Sun Jul 4 23:28:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12802 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 B8F0BC0100 for ; Sun, 4 Jul 2021 23:29:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 293486850B; Mon, 5 Jul 2021 01:29:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YERfuQw5"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F06BB60285 for ; Mon, 5 Jul 2021 01:29:01 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 69350E7; Mon, 5 Jul 2021 01:29:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1625441341; bh=Bip7QMWvgsgEfg0YGDcZpQdqFG1HCI4yAHYz1J8U+p8=; h=From:To:Cc:Subject:Date:From; b=YERfuQw55bUwFmmAIkIqQZWQzgUqWhrsXELZOcLF/rfb/JYeCBFBVrYr3qREXAKun J8eJIXcmFM93gtqTFyv7+ZL2f5u1LZMPeC6Br8DcSZ+iJs7cjSSoA129yi9VLWGbam hwQmyHqzdMCEM+7krf75jA9ISF17q8XsKBtelFrg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 5 Jul 2021 02:28:14 +0300 Message-Id: <20210704232817.8205-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/3] libcamera: Make Framebuffer class Extensible 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" Hello, This small patch series makes the FrameBuffer class inherit from Extensible, for two reasons: - FrameBuffer being such a cornerstone of the libcamera API, it will most likely need to be extended after stabilizing the public API. Making the class Extensible prepares for this. - There's a todo item to hide the FrameBuffer::setRequest() function from the public API, as it's meant to be called internally only. Patch 3/3 showcases how internal functions can be hidden from the public API by moving them to the Private data class. The second reason is what I'm most interested here, as I'd like to get feedback on the concepts. In particular, it depends on patch 1/3 that makes it possible to expose the Private data class to users internal to libcamera. I expect possible bikeshedding on names, as the existing Private class name may be seen as misleading when it exposes public (in the C++ sense) data to users within libcamera. Patch 2/3 is just a drive-by fix. Laurent Pinchart (3): libcamera: base: class: Expose Extensible private data to other classes libcamera: buffer: Rename buffer.h to framebuffer.h libcamera: framebuffer: Make FrameBuffer class Extensible include/libcamera/base/class.h | 14 +++++- include/libcamera/{buffer.h => framebuffer.h} | 16 +++---- .../internal/{buffer.h => framebuffer.h} | 23 +++++++-- .../libcamera/internal/ipa_data_serializer.h | 2 +- include/libcamera/internal/meson.build | 2 +- .../libcamera/internal/tracepoints/request.tp | 2 +- include/libcamera/internal/v4l2_videodevice.h | 2 +- include/libcamera/ipa/ipa_interface.h | 2 +- include/libcamera/meson.build | 2 +- include/libcamera/stream.h | 2 +- src/android/camera_device.h | 4 +- src/android/camera_stream.h | 4 +- src/android/camera_worker.h | 2 +- src/android/jpeg/encoder.h | 2 +- src/android/jpeg/encoder_libjpeg.h | 2 +- src/android/jpeg/post_processor_jpeg.h | 2 +- src/android/jpeg/thumbnailer.h | 2 +- src/android/mm/generic_camera_buffer.cpp | 2 +- src/android/post_processor.h | 4 +- src/cam/buffer_writer.h | 2 +- src/cam/capture.h | 2 +- src/ipa/ipu3/ipu3.cpp | 4 +- src/ipa/raspberrypi/raspberrypi.cpp | 4 +- src/ipa/rkisp1/rkisp1.cpp | 2 +- src/libcamera/{buffer.cpp => framebuffer.cpp} | 48 +++++++++++-------- src/libcamera/framebuffer_allocator.cpp | 2 +- src/libcamera/meson.build | 2 +- src/libcamera/pipeline/ipu3/cio2.cpp | 3 +- src/libcamera/pipeline/ipu3/frames.cpp | 7 +-- .../pipeline/raspberrypi/raspberrypi.cpp | 2 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +- src/libcamera/pipeline/simple/converter.cpp | 2 +- src/libcamera/pipeline_handler.cpp | 2 +- src/libcamera/request.cpp | 9 ++-- src/qcam/dng_writer.h | 2 +- src/qcam/main_window.h | 2 +- src/qcam/viewfinder.h | 2 +- src/qcam/viewfinder_gl.h | 2 +- src/qcam/viewfinder_qt.h | 2 +- src/v4l2/v4l2_camera.h | 2 +- test/mapped-buffer.cpp | 2 +- test/v4l2_subdevice/v4l2_subdevice_test.h | 2 +- test/v4l2_videodevice/buffer_sharing.cpp | 2 +- test/v4l2_videodevice/capture_async.cpp | 2 +- test/v4l2_videodevice/v4l2_m2mdevice.cpp | 2 +- test/v4l2_videodevice/v4l2_videodevice_test.h | 2 +- 46 files changed, 121 insertions(+), 87 deletions(-) rename include/libcamera/{buffer.h => framebuffer.h} (80%) rename include/libcamera/internal/{buffer.h => framebuffer.h} (63%) rename src/libcamera/{buffer.cpp => framebuffer.cpp} (94%)