#include #include #include #include //#include "opencv2/imgcodecs/legacy/constants_c.h" #include #include "rawpic.pb.h" #include "modulecomm.h" #include #include #include extern char * gstrbuffer; extern QMutex gMutexLock; extern bool gbNewData; extern QWaitCondition gwc; static char * gstrwidth ="1920"; static char * gstrheight = "1080"; int gnwidth,gnheight; void StartNVENC(char * strwidth,char * strheight); extern bool gbNewOut; extern QWaitCondition gwcout; extern char * gstrout; extern QMutex gWaitMutexout; extern QMutex gMutexout; extern int gnoutsize ; void * gpaout; void threadout() { char * strout = new char[10000000]; int nout = 0; while(1) { gWaitMutexout.lock(); gwcout.wait(&gWaitMutexout,10); gWaitMutexout.unlock(); if(gbNewOut) { gMutexout.lock(); memcpy(strout, gstrout,gnoutsize); nout = gnoutsize; gbNewOut = false; gMutexout.unlock(); std::cout<<"send out. "< buff(pic.picdata().data(),pic.picdata().data()+pic.picdata().size()); mat = cv::imdecode(buff,1); } cv::Mat dstYuvImage; QTime xTime; xTime.start(); cv::cvtColor(mat, dstYuvImage, CV_BGR2YUV_I420); std::cout<<" cvt time: "<