|
@@ -34,6 +34,9 @@ grpcpc::grpcpc(std::string stryamlpath)
|
|
for(i=0;i<NUM_CAM;i++)
|
|
for(i=0;i<NUM_CAM;i++)
|
|
{
|
|
{
|
|
mpaPic[i] = iv::modulecomm::RegisterSend(mstrpicmsgname[i].data(),2000000,1);
|
|
mpaPic[i] = iv::modulecomm::RegisterSend(mstrpicmsgname[i].data(),2000000,1);
|
|
|
|
+ mnPicUpLatency[i] = 1000;
|
|
|
|
+ mnFrameRate[i] = 0;
|
|
|
|
+ mnPicDownLatency[i] = 1000;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -454,9 +457,12 @@ void grpcpc::threadpicdownload(int nCamPos)
|
|
if(reply.nres() == 1)
|
|
if(reply.nres() == 1)
|
|
{
|
|
{
|
|
std::cout<<nCamPos<<":pic time is "<<reply.npictime()<<std::endl;
|
|
std::cout<<nCamPos<<":pic time is "<<reply.npictime()<<std::endl;
|
|
- mMutexPic.lock();
|
|
|
|
|
|
+ mnPicUpLatency[nCamPos] = reply.npicuplatency();
|
|
|
|
+ mnFrameRate[nCamPos] = reply.npicframerate();
|
|
|
|
+ mnPicDownLatency[nCamPos] = QDateTime::currentMSecsSinceEpoch() - time1;
|
|
|
|
+ mMutexPic[nCamPos].lock();
|
|
iv::modulecomm::ModuleSendMsg(mpaPic[nCamPos],reply.xdata().data(),reply.xdata().size());
|
|
iv::modulecomm::ModuleSendMsg(mpaPic[nCamPos],reply.xdata().data(),reply.xdata().size());
|
|
- mMutexPic.unlock();
|
|
|
|
|
|
+ mMutexPic[nCamPos].unlock();
|
|
// iv::cloud::cloudmsg xmsg;
|
|
// iv::cloud::cloudmsg xmsg;
|
|
// if(xmsg.ParseFromArray(reply.xdata().data(),reply.xdata().size()))
|
|
// if(xmsg.ParseFromArray(reply.xdata().data(),reply.xdata().size()))
|
|
// {
|
|
// {
|
|
@@ -465,7 +471,7 @@ void grpcpc::threadpicdownload(int nCamPos)
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
|
|
|
|
|
+ std::this_thread::sleep_for(std::chrono::milliseconds(10*NUM_THREAD_PERCAM));
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
std::cout << status.error_code() << ": " << status.error_message()
|
|
std::cout << status.error_code() << ": " << status.error_message()
|
|
@@ -487,3 +493,21 @@ void grpcpc::threadpicdownload(int nCamPos)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+qint64 grpcpc::GetPicLatency(int nCamPos)
|
|
|
|
+{
|
|
|
|
+ if((nCamPos < 0)||(nCamPos >= NUM_CAM))return -1;
|
|
|
|
+ return mnPicUpLatency[nCamPos];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int grpcpc::GetFrameRate(int nCamPos)
|
|
|
|
+{
|
|
|
|
+ if((nCamPos < 0)||(nCamPos >= NUM_CAM))return -1;
|
|
|
|
+ return mnFrameRate[nCamPos];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+qint64 grpcpc::GetPicDownLatency(int nCamPos)
|
|
|
|
+{
|
|
|
|
+ if((nCamPos < 0)||(nCamPos >= NUM_CAM))return -1;
|
|
|
|
+ return mnPicDownLatency[nCamPos];
|
|
|
|
+}
|
|
|
|
+
|