本文整理汇总了C++中QQueue::first方法的典型用法代码示例。如果您正苦于以下问题:C++ QQueue::first方法的具体用法?C++ QQueue::first怎么用?C++ QQueue::first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQueue
的用法示例。
在下文中一共展示了QQueue::first方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
void GuiInterface::run()
{
//while consumer is not stopped, grab info and emit signal for eng screen to update display
while(!stoppedConsumer)
{
//lock mutex
mutex.lock();
////qDebug()<<"Gui thread running" <<endl;
if(!msg.isEmpty())
{
//get data from queue
dataGathered.x = msg.first().x;
dataGathered.y = msg.first().y;
dataGathered.z = msg.first().z;
dataGathered.R0 = msg.first().R0;
dataGathered.R1 = msg.first().R1;
dataGathered.R2 = msg.first().R2;
dataGathered.R3 = msg.first().R3;
dataGathered.roll = msg.first().roll;
dataGathered.pitch = msg.first().pitch;
dataGathered.yaw = msg.first().yaw;
dataGathered.reqNode = msg.first().reqNode;
dataGathered.mError = msg.first().mError;
dataGathered.status = msg.first().status;
//emit signal for eng screen to update display
//sleep(1000);
emit display(dataGathered.x, dataGathered.y, dataGathered.z, dataGathered.R0, dataGathered.R1, dataGathered.R2,
dataGathered.R3,dataGathered.roll, dataGathered.pitch,dataGathered.yaw, dataGathered.mError,dataGathered.status);
//will also emit a signal for logging data -- this allows for an easy way to get the data to the engineering screen
emit logSignal(dataGathered.x, dataGathered.y, dataGathered.z, dataGathered.R0, dataGathered.R1, dataGathered.R2,
dataGathered.R3,dataGathered.roll, dataGathered.pitch,dataGathered.yaw, dataGathered.reqNode
, dataGathered.mError,dataGathered.status);
emit emitPositionData(dataGathered.x, dataGathered.y, dataGathered.z);
}
mutex.unlock();
}
stoppedConsumer = false;
//unlock the mutex, so the producer has another turn
}
示例2: addFramesToDeinterlace
int DeintFilter::addFramesToDeinterlace(QQueue< FrameBuffer > &framesQueue, bool checkSize)
{
while (!framesQueue.isEmpty())
{
VideoFrame *videoFrame = VideoFrame::fromData(framesQueue.first().data);
if (((deintFlags & AutoDeinterlace) && !videoFrame->interlaced) || (checkSize && !videoFrame->data_size))
break;
internalQueue.enqueue(framesQueue.dequeue());
}
return framesQueue.isEmpty();
}
示例3: main
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
FrameReader r;
r.setMedia(a.arguments().last());
QQueue<qint64> t;
int count = 0;
qint64 t0 = QDateTime::currentMSecsSinceEpoch();
while (r.readMore()) {
while (r.hasEnoughVideoFrames()) {
const VideoFrame f = r.getVideoFrame(); //TODO: if eof
if (!f)
continue;
count++;
//r.readMore();
const qint64 now = QDateTime::currentMSecsSinceEpoch();
const qint64 dt = now - t0;
t.enqueue(now);
printf("decode @%.3f count: %d, elapsed: %lld, fps: %.1f/%.1f\r", f.timestamp(), count, dt, count*1000.0/dt, t.size()*1000.0/(now - t.first()));fflush(0);
if (t.size() > 10)
t.dequeue();
}
}
while (r.hasVideoFrame()) {
const VideoFrame f = r.getVideoFrame();
qDebug("pts: %.3f", f.timestamp());
}
qDebug("read done");
return 0;
}