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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
This commit is contained in:
@@ -34,7 +34,7 @@ public:
|
||||
bool enabled() const { return enabled_; }
|
||||
void setEnabled(bool enable);
|
||||
|
||||
Signal<EventNotifier *> activated;
|
||||
Signal<> activated;
|
||||
|
||||
protected:
|
||||
void message(Message *msg) override;
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
|
||||
bool isRunning();
|
||||
|
||||
Signal<Thread *> finished;
|
||||
Signal<> finished;
|
||||
|
||||
static Thread *current();
|
||||
static pid_t currentId();
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
|
||||
std::chrono::steady_clock::time_point deadline() const { return deadline_; }
|
||||
|
||||
Signal<Timer *> timeout;
|
||||
Signal<> timeout;
|
||||
|
||||
protected:
|
||||
void message(Message *msg) override;
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
|
||||
Signal<Request *, FrameBuffer *> bufferCompleted;
|
||||
Signal<Request *> requestCompleted;
|
||||
Signal<Camera *> disconnected;
|
||||
Signal<> disconnected;
|
||||
|
||||
int acquire();
|
||||
int release();
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
std::string lookupDeviceNode(dev_t devnum);
|
||||
|
||||
int addV4L2Device(dev_t devnum);
|
||||
void udevNotify(EventNotifier *notifier);
|
||||
void udevNotify();
|
||||
|
||||
struct udev *udev_;
|
||||
struct udev_monitor *monitor_;
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
bool done;
|
||||
};
|
||||
|
||||
void readyRead(IPCUnixSocket *socket);
|
||||
void readyRead();
|
||||
int call(const IPCUnixSocket::Payload &message,
|
||||
IPCUnixSocket::Payload *response, uint32_t seq);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
int send(const Payload &payload);
|
||||
int receive(Payload *payload);
|
||||
|
||||
Signal<IPCUnixSocket *> readyRead;
|
||||
Signal<> readyRead;
|
||||
|
||||
private:
|
||||
struct Header {
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
int sendData(const void *buffer, size_t length, const int32_t *fds, unsigned int num);
|
||||
int recvData(void *buffer, size_t length, int32_t *fds, unsigned int num);
|
||||
|
||||
void dataNotifier(EventNotifier *notifier);
|
||||
void dataNotifier();
|
||||
|
||||
int fd_;
|
||||
bool headerReceived_;
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
MediaLink *link(const MediaPad *source, const MediaPad *sink);
|
||||
int disableLinks();
|
||||
|
||||
Signal<MediaDevice *> disconnected;
|
||||
Signal<> disconnected;
|
||||
|
||||
protected:
|
||||
std::string logPrefix() const override;
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
|
||||
void kill();
|
||||
|
||||
Signal<Process *, enum ExitStatus, int> finished;
|
||||
Signal<enum ExitStatus, int> finished;
|
||||
|
||||
private:
|
||||
void closeAllFdsExcept(const std::vector<int> &fds);
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
private:
|
||||
static ProcessManager *self_;
|
||||
|
||||
void sighandler(EventNotifier *notifier);
|
||||
void sighandler();
|
||||
|
||||
std::list<Process *> processes_;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
void updateControls(ControlList *ctrls,
|
||||
Span<const v4l2_ext_control> v4l2Ctrls);
|
||||
|
||||
void eventAvailable(EventNotifier *notifier);
|
||||
void eventAvailable();
|
||||
|
||||
std::map<unsigned int, struct v4l2_query_ext_ctrl> controlInfo_;
|
||||
std::vector<std::unique_ptr<ControlId>> controlIds_;
|
||||
|
||||
@@ -238,7 +238,7 @@ private:
|
||||
std::unique_ptr<FrameBuffer> createBuffer(unsigned int index);
|
||||
FileDescriptor exportDmabufFd(unsigned int index, unsigned int plane);
|
||||
|
||||
void bufferAvailable(EventNotifier *notifier);
|
||||
void bufferAvailable();
|
||||
FrameBuffer *dequeueBuffer();
|
||||
|
||||
V4L2Capability caps_;
|
||||
|
||||
Reference in New Issue
Block a user