From patchwork Thu Feb 7 21:21:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 543 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 732FC610B2 for ; Thu, 7 Feb 2019 22:21:27 +0100 (CET) Received: from localhost.localdomain (unknown [149.254.234.206]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8EC7CF9; Thu, 7 Feb 2019 22:21:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1549574486; bh=t3mQ1yWjo1CIjwOWUK25YFqlptkjskermB6NfSJm+lU=; h=From:To:Cc:Subject:Date:From; b=PED/kp2yN1tGRbtDDLjSbp/O3NvvpXsaV10+16uCQUNxbShI+kH1tWrkALaz2VrJW PTaz0w3doCbHZolZlcaWLBMrWrJlXZwfE4TPt9unZrvGsEsGxilyW8qisjwcN7kly7 WVnwjH4kETn8pB/YIS45sBYM4EQ+mXfOhF2vmn5U= From: Kieran Bingham To: LibCamera Devel Date: Thu, 7 Feb 2019 21:21:14 +0000 Message-Id: <20190207212119.30299-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/5] libcamera: Buffer Sharing 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: Thu, 07 Feb 2019 21:21:27 -0000 Extend the V4L2Device to support buffers provided by other V4L2Devices and externally provided BufferPools. To facilitate testing of the importBuffers, the media_device is extended with a helper to simplify finding the default entity. This makes identifying the default video node clearer. The test to validate the buffer sharing is currently incredibly specific, requiring a Logitech BRIO uvcvideo web camera, for the simple reason that it was convenient for me. I expect that this shall be updated to identify a virtual device for testing, however I do not currently have the facility to load VIMC (easily) on my laptop. This update has highlighted that the exportBuffers function was being passed the bufferCount redundantly as we expect the BufferPool to provide this sizing information for us, and so it was simplified. And finally, now that we have multiple V4L2Devices running in parallel, identifying which LOG output belongs to which device is impossible, thus a V4L2DEVICE_LOG(severity) helper is added which prepends the V4L2 VideoNode for each message. Kieran Bingham (5): libcamera: media_device: Provide the default entity libcamera: v4l2_device: importBuffers support test: v4l2_device: Provide buffer sharing test libcamera: v4l2_device: Simplify exportBuffers() libcamera: v4l2_device: Provide V4L2 Log helper src/libcamera/include/media_device.h | 1 + src/libcamera/include/v4l2_device.h | 3 +- src/libcamera/media_device.cpp | 15 +++ src/libcamera/pipeline/ipu3/ipu3.cpp | 3 +- src/libcamera/pipeline/uvcvideo.cpp | 12 +- src/libcamera/pipeline/vimc.cpp | 2 +- src/libcamera/v4l2_device.cpp | 104 ++++++++++----- test/v4l2_device/buffer_sharing.cpp | 178 ++++++++++++++++++++++++++ test/v4l2_device/capture_async.cpp | 4 +- test/v4l2_device/meson.build | 1 + test/v4l2_device/request_buffers.cpp | 4 +- test/v4l2_device/stream_on_off.cpp | 4 +- test/v4l2_device/v4l2_device_test.cpp | 12 +- test/v4l2_device/v4l2_device_test.h | 2 - 14 files changed, 289 insertions(+), 56 deletions(-) create mode 100644 test/v4l2_device/buffer_sharing.cpp