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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
3e354b00b4
commit
03fcc154eb
9 changed files with 16 additions and 22 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ protected:
|
|||
*/
|
||||
const unsigned int bufferCount = 8;
|
||||
|
||||
createBuffers(bufferCount);
|
||||
pool_.createBuffers(bufferCount);
|
||||
|
||||
int ret = dev_->exportBuffers(bufferCount, &pool_);
|
||||
int ret = dev_->exportBuffers(&pool_);
|
||||
if (ret)
|
||||
return TestFail;
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ protected:
|
|||
{
|
||||
const unsigned int bufferCount = 8;
|
||||
|
||||
createBuffers(bufferCount);
|
||||
pool_.createBuffers(bufferCount);
|
||||
|
||||
int ret = dev_->exportBuffers(bufferCount, &pool_);
|
||||
int ret = dev_->exportBuffers(&pool_);
|
||||
if (ret)
|
||||
return TestFail;
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@ class V4L2DeviceTest : public Test
|
|||
public:
|
||||
V4L2DeviceTest() : dev_(nullptr){};
|
||||
|
||||
void createBuffers(unsigned int qty) { pool_.createBuffers(qty); }
|
||||
|
||||
protected:
|
||||
int init();
|
||||
void cleanup();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue