From 3335d5a504374166f749a267ba1e1d803a0ed1f6 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 27 Aug 2021 04:45:28 +0300 Subject: libcamera: Drop emitter object pointer from signal arguments Many signals used in internal and public APIs carry the emitter pointer as a signal argument. This was done to allow slots connected to multiple signal instances to differentiate between emitters. While starting from a good intention of facilitating the implementation of slots, it turned out to be a bad API design as the signal isn't meant to know what it will be connected to, and thus shouldn't carry parameters that are solely meant to support a use case specific to the connected slot. These pointers turn out to be unused in all slots but one. In the only case where it is needed, it can be obtained by wrapping the slot in a lambda function when connecting the signal. Do so, and drop the emitter pointer from all signals. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/libcamera/v4l2_device.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libcamera/v4l2_device.cpp') diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 951592c6..9c783c9c 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -705,12 +705,11 @@ void V4L2Device::updateControls(ControlList *ctrls, /** * \brief Slot to handle V4L2 events from the V4L2 device - * \param[in] notifier The event notifier * * When this slot is called, a V4L2 event is available to be dequeued from the * device. */ -void V4L2Device::eventAvailable([[maybe_unused]] EventNotifier *notifier) +void V4L2Device::eventAvailable() { struct v4l2_event event{}; int ret = ioctl(VIDIOC_DQEVENT, &event); -- cgit v1.2.1