48 mStreamerInterface(streamerInterface)
50 this->setObjectName(
"imagereceiver worker");
55 if (!this->attemptInitialize())
58 mImageStreamer.reset();
65 bool ImageReceiverThread::attemptInitialize()
68 QDomElement element = xmlFile.
getElement(
"video");
69 mImageStreamer = mStreamerInterface->createStreamer(element);
76 mSender.reset(
new DirectlyLinkedSender());
81 mImageStreamer->startStreaming(mSender);
91 mImageStreamer->stopStreaming();
93 mImageStreamer.reset();
100 void ImageReceiverThread::addImageToQueueSlot()
105 void ImageReceiverThread::addSonixStatusToQueueSlot()
113 this->reportFPS(imgMsg->getUid());
123 QMutexLocker sentry(&mImageMutex);
124 mMutexedImageMessageQueue.push_back(imgMsg);
132 QMutexLocker sentry(&mSonixStatusMutex);
133 mMutexedSonixStatusMessageQueue.push_back(msg);
140 QMutexLocker sentry(&mImageMutex);
141 if (mMutexedImageMessageQueue.empty())
143 ImagePtr retval = mMutexedImageMessageQueue.front();
144 mMutexedImageMessageQueue.pop_front();
151 QMutexLocker sentry(&mSonixStatusMutex);
152 if (mMutexedSonixStatusMessageQueue.empty())
155 mMutexedSonixStatusMessageQueue.pop_front();
159 void ImageReceiverThread::reportFPS(QString streamUid)
162 if (!mFPSTimer.count(streamUid))
165 mFPSTimer[streamUid]->reset(timeout);
171 if (logger->intervalPassed())
173 emit
fps(streamUid, logger->getFPS());
174 logger->reset(timeout);
185 if (!mStreamerInterface)
187 return mStreamerInterface->getName();
cxResource_EXPORT ProfilePtr profile()
void fps(QString, double)
boost::shared_ptr< class Image > ImagePtr
QDomElement getElement()
return the current element
virtual ImagePtr getLastImageMessage()
void sonixStatusReceived()
boost::shared_ptr< class CyclicActionLogger > CyclicActionLoggerPtr
void addSonixStatusToQueue(ProbeDefinitionPtr msg)
add the message to a thread-safe queue
virtual QString hostDescription() const
ImageReceiverThread(StreamerServicePtr streamerInterface, QObject *parent=NULL)
virtual ProbeDefinitionPtr getLastSonixStatusMessage()
boost::shared_ptr< class StreamerService > StreamerServicePtr
void addImageToQueue(ImagePtr imgMsg)
boost::shared_ptr< class ProbeDefinition > ProbeDefinitionPtr
Helper class for xml files used to store ssc/cx data.