Procházet zdrojové kódy

change driver_h264_rtspclient.

yuchuli před 3 roky
rodič
revize
7e9030d645

+ 0 - 7
src/driver/driver_h264_rtspclient/driver_h264_rtspclient.pro

@@ -46,13 +46,6 @@ LIBS +=  -lavcodec -lavformat -lavutil
 INCLUDEPATH += /usr/include/x86_64-linux-gnu
 
 
-INCLUDEPATH += $$PWD/Include
-
-
-#INCLUDEPATH += $$PWD/libEasyRTSPClient/Include
-
-LIBS += -L$$PWD -leasypusher -leasyrtspclient
-
 RESOURCES += \
     rtspclient.qrc
 

+ 62 - 4
src/driver/driver_h264_rtspclient/main.cpp

@@ -198,7 +198,10 @@ int test2()
 #include "modulecomm.h"
 #include "rtspclientup.h"
 
-rtspclientup * gup1 = NULL;
+rtspclientup * gupfront = NULL;
+rtspclientup * guprear = NULL;
+rtspclientup * gupleft = NULL;
+rtspclientup * gupright = NULL;
 
 std::shared_ptr<char> gpstr_data;
 bool gbUpdate = false;
@@ -220,11 +223,66 @@ void Listenframe(const char * strdata,const unsigned int nSize,const unsigned in
     xframe.mframe_ptr = std::shared_ptr<char>(new char[nSize]);
     mempcpy(xframe.mframe_ptr.get(),strdata,nSize);
     xframe.mndatasize = nSize;
-    if(gup1 != NULL)
+    if(gupfront != NULL)
     {
-        gup1->AddData(xframe);
+        gupfront->AddData(xframe);
     }
 
+}
+
+void Listenfront(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+    if(nSize<6)return;
+    iv::framedata xframe;
+    xframe.mframe_ptr = std::shared_ptr<char>(new char[nSize]);
+    mempcpy(xframe.mframe_ptr.get(),strdata,nSize);
+    xframe.mndatasize = nSize;
+    if(gupfront != NULL)
+    {
+        gupfront->AddData(xframe);
+    }
+
+}
+
+void Listenrear(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+    if(nSize<6)return;
+    iv::framedata xframe;
+    xframe.mframe_ptr = std::shared_ptr<char>(new char[nSize]);
+    mempcpy(xframe.mframe_ptr.get(),strdata,nSize);
+    xframe.mndatasize = nSize;
+    if(guprear != NULL)
+    {
+        guprear->AddData(xframe);
+    }
+
+}
+
+void Listenleft(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+    if(nSize<6)return;
+    iv::framedata xframe;
+    xframe.mframe_ptr = std::shared_ptr<char>(new char[nSize]);
+    mempcpy(xframe.mframe_ptr.get(),strdata,nSize);
+    xframe.mndatasize = nSize;
+    if(gupleft != NULL)
+    {
+        gupleft->AddData(xframe);
+    }
+
+}
+
+void Listenright(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+    if(nSize<6)return;
+    iv::framedata xframe;
+    xframe.mframe_ptr = std::shared_ptr<char>(new char[nSize]);
+    mempcpy(xframe.mframe_ptr.get(),strdata,nSize);
+    xframe.mndatasize = nSize;
+    if(gupright != NULL)
+    {
+        gupright->AddData(xframe);
+    }
 
 }
 
@@ -332,7 +390,7 @@ int main(int argc, char *argv[])
     avformat_network_init();
 
     rtspclientup * pup = new rtspclientup("rtsp://111.33.136.149:9554/test",1920,1080);
-    gup1 = pup;
+    gupfront = pup;
     void * pa = iv::modulecomm::RegisterRecv("h264front",Listenframe);
     return a.exec();