libcamera: thread: Support selective message dispatch to thread

Extend the current dispatchMessages() to support dispatching of
selective messsages according to the Message::Type passed in
the function argument. dispatchMessages() can now be called
explicitly to force deliver selected type's message to the
thread for processing (typically when event loop is not
running).

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Umang Jain
2020-07-31 18:14:14 +00:00
committed by Laurent Pinchart
parent 6042ded8e7
commit 3fe7c1cdb4
2 changed files with 28 additions and 10 deletions
+2 -1
View File
@@ -14,6 +14,7 @@
#include <libcamera/signal.h>
#include "libcamera/internal/message.h"
#include "libcamera/internal/utils.h"
namespace libcamera {
@@ -47,7 +48,7 @@ public:
EventDispatcher *eventDispatcher();
void setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher);
void dispatchMessages();
void dispatchMessages(Message::Type type = Message::Type::None);
protected:
int exec();