Get deviceHandle used by VideoCapture()


I’m using VideoCapture() with V4L2 API to grab frames from a camera device.

Ideally I would like to get access to the deviceHandle member so that I can set some parameters directly with ioctl() without using the VideoCapture.set() function.
An alternative would be to open the device again and get a new device handler but I would like to avoid having multiple file descriptors for a same device.

Is there a way to access it ? I was expecting to get access to them through the icap protected member with a new class inheriting from VideoCapture(), but it seems that it’s not hidden there.

Is there a reason why I should not try to access it ?

Thanks for your help.

probably none, and whoever wrote the code hadn’t anticipated the need to access those values.

you could check the issues on github for an existing one, or add a new issue to describe your goal and suggested changes.

1 Like