AravisProject / aravis

A vision library for genicam based cameras
GNU Lesser General Public License v2.1
913 stars 338 forks source link

Add Device Removal Callback #735

Open Dennis10231 opened 2 years ago

Dennis10231 commented 2 years ago

Is your feature request related to a problem? Please describe. It would be nice if Aravis would support a callback in case a camera gets removed (unplugged, ...).

Describe the solution you'd like Libusb supports libusb_hotplug_register_callback() with the event type LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT. This can be used to directly detect the USB event. For GigE, a missed heartbeat could trigger the same. Similar to the StreamGrabber callback, a user pointer would be nice.

Additional context This is a common feature in several camera SDKs and Aravis should support it as well.

EmmanuelP commented 2 years ago

Like control-lost signal ?

https://github.com/AravisProject/aravis/blob/0df6d6aa9eb54454ac821c8db5e58a02a5e5f2a4/src/arvcameratest.c#L655-L656

This signal is not documented yet, and we should provide a ArvCamera helper.