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);
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();
boost::shared_ptr< class CyclicActionLogger > CyclicActionLoggerPtr
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()
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.
Namespace for all CustusX production code.