libcamera: v4l2_videodevice: Pass FileDescriptor to open()

The V4L2VideoDevice::open() function that takes an open file handle
duplicates it internally, and leaves the original handle untouched. This
is documented but not enforced through language constructs. Fix it by
passing a FileDescriptor to the function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Laurent Pinchart
2021-11-29 20:14:14 +02:00
parent a62a886a7d
commit 415ac12399
2 changed files with 10 additions and 14 deletions
@@ -184,7 +184,7 @@ public:
~V4L2VideoDevice();
int open();
int open(int handle, enum v4l2_buf_type type);
int open(FileDescriptor handle, enum v4l2_buf_type type);
void close();
const char *driverName() const { return caps_.driver(); }