Explorar el Código

change h264view_civetweb.

yuchuli hace 2 años
padre
commit
8ab2c9b056

+ 6 - 0
src/tool/h264view_civetweb/h264view_civetweb.xml

@@ -0,0 +1,6 @@
+<xml>	
+	<node name="h264view_civetweb">
+		<param name="framename" value="h264front" />
+		<param name="Port" value="6123" />
+	</node>
+</xml>

+ 7 - 5
src/tool/h264view_civetweb/main.cpp

@@ -40,6 +40,7 @@ void * gpa;
 
 void Listenpic(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
 {
+    std::cout<<"listen pic."<<std::endl;
     if(nSize<1000)return;
     iv::vision::rawpic pic;
     if(false == pic.ParseFromArray(strdata,nSize))
@@ -67,7 +68,7 @@ void threadgetpic()
     {
         int nindex = gph264decode->GetUpdatedIndex(10);
         if(nindex<0)continue;
-//        std::cout<<" recv a yuv."<<std::endl;
+        std::cout<<" recv a yuv."<<std::endl;
         iv::framedecodebuf * pbuf =  gph264decode->LockReadBuff(nindex);
         int cy = pbuf->frameheight;
         int cx = pbuf->framewidth;
@@ -347,6 +348,7 @@ class h264picHandler : public CivetWebSocketHandler {
 
 void Listenframe(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
 {
+    std::cout<<" listen frame."<<std::endl;
     if(nSize<1000)return;
     gpwsh264front->BroadData(strdata,nSize);
 
@@ -360,12 +362,12 @@ int main(int argc, char *argv[])
 
     std::thread * pthreadpic = new std::thread(threadgetpic);
 
-    iv::xmlparam::Xmlparam xp("./picview_civetweb.xml");
-    std::string strmsgname =  xp.GetParam("imagemsgname","picfront");
+    iv::xmlparam::Xmlparam xp("./h264view_civetweb.xml");
+    std::string strmsgname =  xp.GetParam("framename","h264front");
     std::string strport = xp.GetParam("Port","6123");
-    gpa = iv::modulecomm::RegisterRecv(strmsgname.data(),Listenpic);
+ //   gpa = iv::modulecomm::RegisterRecv(strmsgname.data(),Listenpic);
 
-    void * pah264 = iv::modulecomm::RegisterRecv("h264front",Listenframe);
+    void * pah264 = iv::modulecomm::RegisterRecv(strmsgname.data(),Listenframe);
 
     mg_init_library(0);
 

+ 0 - 6
src/tool/h264view_civetweb/picview_civetweb.xml

@@ -1,6 +0,0 @@
-<xml>	
-	<node name="picview_civetweb">
-		<param name="imagemsgname" value="image00" />
-		<param name="Port" value="6123" />
-	</node>
-</xml>