|
@@ -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();
|
|
|
|