libcamera: message: Add user message types
Reserve identifiers for user-defined message types and add an operation to the Message class to register the type identifiers. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
3e29a2d520
commit
fae053307d
3 changed files with 54 additions and 0 deletions
|
@ -52,6 +52,17 @@ class MessageTest : public Test
|
|||
protected:
|
||||
int run()
|
||||
{
|
||||
Message::Type msgType[2] = {
|
||||
Message::registerMessageType(),
|
||||
Message::registerMessageType(),
|
||||
};
|
||||
|
||||
if (msgType[0] != Message::UserMessage ||
|
||||
msgType[1] != Message::UserMessage + 1) {
|
||||
cout << "Failed to register message types" << endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
MessageReceiver receiver;
|
||||
receiver.moveToThread(&thread_);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue