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);
60 mImageStreamer->startStreaming(mSender);
70 mImageStreamer->stopStreaming();
72 mImageStreamer.reset();
79 void ImageReceiverThread::addImageToQueueSlot()
84 void ImageReceiverThread::addSonixStatusToQueueSlot()
92 this->reportFPS(imgMsg->getUid());
102 QMutexLocker sentry(&mImageMutex);
103 mMutexedImageMessageQueue.push_back(imgMsg);
111 QMutexLocker sentry(&mSonixStatusMutex);
112 mMutexedSonixStatusMessageQueue.push_back(msg);
119 QMutexLocker sentry(&mImageMutex);
120 if (mMutexedImageMessageQueue.empty())
122 ImagePtr retval = mMutexedImageMessageQueue.front();
123 mMutexedImageMessageQueue.pop_front();
130 QMutexLocker sentry(&mSonixStatusMutex);
131 if (mMutexedSonixStatusMessageQueue.empty())
134 mMutexedSonixStatusMessageQueue.pop_front();
138 void ImageReceiverThread::reportFPS(QString streamUid)
141 if (!mFPSTimer.count(streamUid))
144 mFPSTimer[streamUid]->reset(timeout);
150 if (logger->intervalPassed())
152 emit
fps(streamUid, logger->getFPS());
153 logger->reset(timeout);
164 if (!mStreamerInterface)
166 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.