summaryrefslogtreecommitdiffstats
path: root/src/plugins/generic/tuiotouch/qtuiohandler.cpp
diff options
context:
space:
mode:
authorAriel Molina <ariel@edis.mx>2016-02-10 14:44:53 -0600
committerAriel Molina R <ariel@edis.mx>2016-02-11 23:12:59 +0000
commit3fa7035b53a30b9aaa8566045ed157898bdcd06b (patch)
treeda6863037c284844707ebfa46281800ac63f0de8 /src/plugins/generic/tuiotouch/qtuiohandler.cpp
parent5d8354e63aa37a660ac9c621276c0e87e47e0d32 (diff)
Fixed bug preventing parsing of unbundled TUIO messages
Unbundled TUIO messages were being ignored. TUIO protocol defaults to bundled but states it should work with any Open Sound Control (OSC) implementation. Unbundled handling was already in place, just fixed the logic to make it work. Change-Id: I6d91449bd2069ac891e493fb7f50c010bcc3e8be Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/plugins/generic/tuiotouch/qtuiohandler.cpp')
-rw-r--r--src/plugins/generic/tuiotouch/qtuiohandler.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp
index 2b42889cb1..7ed268c2d4 100644
--- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp
+++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp
@@ -129,10 +129,6 @@ void QTuioHandler::processPackets()
if (size != datagram.size())
datagram.resize(size);
- QOscBundle bundle(datagram);
- if (!bundle.isValid())
- continue;
-
// "A typical TUIO bundle will contain an initial ALIVE message,
// followed by an arbitrary number of SET messages that can fit into the
// actual bundle capacity and a concluding FSEQ message. A minimal TUIO
@@ -140,7 +136,19 @@ void QTuioHandler::processPackets()
// messages. The FSEQ frame ID is incremented for each delivered bundle,
// while redundant bundles can be marked using the frame sequence ID
// -1."
- QList<QOscMessage> messages = bundle.messages();
+ QList<QOscMessage> messages;
+
+ QOscBundle bundle(datagram);
+ if (bundle.isValid()) {
+ messages = bundle.messages();
+ } else {
+ QOscMessage msg(datagram);
+ if (!msg.isValid()) {
+ qCWarning(lcTuioSet) << "Got invalid datagram.";
+ continue;
+ }
+ messages.push_back(msg);
+ }
foreach (const QOscMessage &message, messages) {
if (message.addressPattern() != "/tuio/2Dcur") {