From patchwork Wed Jun 19 11:05:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 1468 Return-Path: Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A9B46194F for ; Wed, 19 Jun 2019 13:04:43 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id A9AB9FF809; Wed, 19 Jun 2019 11:04:42 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 19 Jun 2019 13:05:44 +0200 Message-Id: <20190619110548.20742-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/4] libcamera: Introduce V4L2Device base class X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 11:04:43 -0000 Hello, compared to v4 I have address Laurent's comments and added two small cleanup patches. Relevant changes: - Rebased on top of latest master which includes Niklas' format enum - Make V4L2Device inherit Loggable and provide a logPrefix - Create V4L2Device with a deviceNode path to be open and a logPrefix - Fix V4L2VideoDevice::close() call to base class close - Remove call to close() in the base class destructor to avoid calling it twice - Add paramter direction to documentation of V4L2Device On top of this, I have rebase the v4l2 control support series which I'll resend right after this. Question: does it make sense to have V4L2DeviceFormat and V4L2SubdeviceFormat. I would be happy to unify those in a V4L2Format defined in the base class header. Thanks j Jacopo Mondi (4): libcamera: Rename V4L2Device to V4L2VideoDevice libcamera: Introduce V4L2Device base class libcamera: v4l2_videodevice: Update documentation libcamera: v4l2: Standardize return value checks include/libcamera/buffer.h | 2 +- src/libcamera/include/v4l2_device.h | 166 +-- src/libcamera/include/v4l2_subdevice.h | 9 +- src/libcamera/include/v4l2_videodevice.h | 183 +++ src/libcamera/meson.build | 2 + src/libcamera/pipeline/ipu3/ipu3.cpp | 24 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 6 +- src/libcamera/pipeline/uvcvideo.cpp | 6 +- src/libcamera/pipeline/vimc.cpp | 6 +- src/libcamera/v4l2_device.cpp | 1102 +---------------- src/libcamera/v4l2_subdevice.cpp | 88 +- src/libcamera/v4l2_videodevice.cpp | 1080 ++++++++++++++++ test/meson.build | 2 +- .../buffer_sharing.cpp | 18 +- .../capture_async.cpp | 6 +- .../double_open.cpp | 8 +- .../formats.cpp | 8 +- .../meson.build | 8 +- .../request_buffers.cpp | 6 +- .../stream_on_off.cpp | 6 +- .../v4l2_videodevice_test.cpp} | 8 +- .../v4l2_videodevice_test.h} | 8 +- 22 files changed, 1418 insertions(+), 1334 deletions(-) create mode 100644 src/libcamera/include/v4l2_videodevice.h create mode 100644 src/libcamera/v4l2_videodevice.cpp rename test/{v4l2_device => v4l2_videodevice}/buffer_sharing.cpp (90%) rename test/{v4l2_device => v4l2_videodevice}/capture_async.cpp (91%) rename test/{v4l2_device => v4l2_videodevice}/double_open.cpp (75%) rename test/{v4l2_device => v4l2_videodevice}/formats.cpp (85%) rename test/{v4l2_device => v4l2_videodevice}/meson.build (74%) rename test/{v4l2_device => v4l2_videodevice}/request_buffers.cpp (77%) rename test/{v4l2_device => v4l2_videodevice}/stream_on_off.cpp (78%) rename test/{v4l2_device/v4l2_device_test.cpp => v4l2_videodevice/v4l2_videodevice_test.cpp} (90%) rename test/{v4l2_device/v4l2_device_test.h => v4l2_videodevice/v4l2_videodevice_test.h} (81%) --- 2.21.0