|
@@ -13,6 +13,11 @@ grpcpc::grpcpc(std::string stryamlpath)
|
|
|
|
|
|
ggrpcpc = this;
|
|
|
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void grpcpc::StartRTSP()
|
|
|
+{
|
|
|
int i;
|
|
|
|
|
|
if(mbUseRTSP == false)
|
|
@@ -121,6 +126,7 @@ int grpcpc::Consumeh264frame(int ncampos,iv::h264rawframedata & xframe,int nwait
|
|
|
|
|
|
int grpcpc::SetCtrlMsg(std::string strmsgname,char * strdata,int ndatasize)
|
|
|
{
|
|
|
+ // std::cout<<" set ctrl msg: "<<strmsgname<<std::endl;
|
|
|
mmutexctrlmsg.lock();
|
|
|
if(mvectorctrlmsg.size() == 0)
|
|
|
{
|
|
@@ -255,17 +261,26 @@ void grpcpc::run()
|
|
|
while(!QThread::isInterruptionRequested())
|
|
|
{
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
|
|
+
|
|
|
if(abs(xTime.elapsed()-nlastsend)<ninterval)
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
+ std::cout<<"nlastsend: "<<nlastsend<<std::endl;
|
|
|
|
|
|
bool bImportant = false;
|
|
|
int nkeeptime = 0;
|
|
|
|
|
|
iv::cloud::cloudmsg xmsg;
|
|
|
xmsg.clear_xclouddata();
|
|
|
- GetCtrlMsg(xmsg);
|
|
|
+ int nctrlrtn = GetCtrlMsg(xmsg);
|
|
|
+ if(nctrlrtn == 1)
|
|
|
+ {
|
|
|
+ if(xmsg.xclouddata_size() > 0)
|
|
|
+ std::cout<<" msgname: "<<xmsg.xclouddata(0).msgname()<<std::endl;
|
|
|
+ std::cout<<" ctrl code: "<<gstrctrlMD5<<std::endl;
|
|
|
+ }
|
|
|
+ std::cout<<"nctrlrtn: "<<nctrlrtn<<std::endl;
|
|
|
xmsg.set_xtime(QDateTime::currentMSecsSinceEpoch());
|
|
|
nlastsend = xTime.elapsed();
|
|
|
|
|
@@ -332,9 +347,12 @@ void grpcpc::run()
|
|
|
// qDebug("nlasttime is %ld",nlasttime);//1607905685318
|
|
|
nid++;
|
|
|
// The actual RPC.
|
|
|
+// QTime xTime1;
|
|
|
+// xTime1.start();
|
|
|
Status status = stub_->queryctrl(&context, request, &xreply);
|
|
|
if (status.ok()) {
|
|
|
- // std::cout<<nid<<" query successfully, res is "<<xreply.nres()<<std::endl;
|
|
|
+// std::cout<<" query time: "<<xTime1.elapsed()<<std::endl;
|
|
|
+ std::cout<<nid<<" query successfully, res is "<<xreply.nres()<<std::endl;
|
|
|
if(xreply.nres() == 1)
|
|
|
{
|
|
|
|