From 03fcc154eb0599e02276c9f64fce46b643104e20 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Thu, 7 Feb 2019 20:56:08 +0000 Subject: libcamera: v4l2_device: Simplify exportBuffers() exportBuffers() can only operate on an existing BufferPool allocation. The pool identifies its size through its .count() method. Passing a count in to the exportBuffers() call is redundant and can be incorrect if the value is not the same as the BufferPool size. Simplify the function and remove the unnecessary argument, correcting all uses throughout the code base. While we're here, remove the createBuffers() helper from the V4L2DeviceTest which only served to obfuscate which pool the buffers were being allocated for. Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- test/v4l2_device/capture_async.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/v4l2_device/capture_async.cpp') diff --git a/test/v4l2_device/capture_async.cpp b/test/v4l2_device/capture_async.cpp index ba37c973..511368d6 100644 --- a/test/v4l2_device/capture_async.cpp +++ b/test/v4l2_device/capture_async.cpp @@ -38,9 +38,9 @@ protected: Timer timeout; int ret; - createBuffers(bufferCount); + pool_.createBuffers(bufferCount); - ret = dev_->exportBuffers(bufferCount, &pool_); + ret = dev_->exportBuffers(&pool_); if (ret) return TestFail; -- cgit v1.2.1