27 mStreamerInterface(streamerInterface)
29 this->setObjectName(
"imagereceiver worker");
34 if (!this->attemptInitialize())
37 mImageStreamer.reset();
44 bool ImageReceiverThread::attemptInitialize()
47 QDomElement element = xmlFile.
getElement(
"video");
48 mImageStreamer = mStreamerInterface->createStreamer(element);
57 mSender.reset(
new DirectlyLinkedSender());
62 mImageStreamer->startStreaming(mSender);
72 mImageStreamer->stopStreaming();
74 mImageStreamer.reset();
81 void ImageReceiverThread::addImageToQueueSlot()
86 void ImageReceiverThread::addSonixStatusToQueueSlot()
94 this->reportFPS(imgMsg->getUid());
104 QMutexLocker sentry(&mImageMutex);
105 mMutexedImageMessageQueue.push_back(imgMsg);
113 QMutexLocker sentry(&mSonixStatusMutex);
114 mMutexedSonixStatusMessageQueue.push_back(msg);
121 QMutexLocker sentry(&mImageMutex);
122 if (mMutexedImageMessageQueue.empty())
124 ImagePtr retval = mMutexedImageMessageQueue.front();
125 mMutexedImageMessageQueue.pop_front();
132 QMutexLocker sentry(&mSonixStatusMutex);
133 if (mMutexedSonixStatusMessageQueue.empty())
136 mMutexedSonixStatusMessageQueue.pop_front();
140 void ImageReceiverThread::reportFPS(QString streamUid)
143 if (!mFPSTimer.count(streamUid))
146 mFPSTimer[streamUid]->reset(timeout);
152 if (logger->intervalPassed())
154 emit
fps(streamUid, logger->getFPS());
155 logger->reset(timeout);
166 if (!mStreamerInterface)
168 return mStreamerInterface->getName();