|
@@ -52,6 +52,12 @@ int gindex_right = 0;
|
|
|
std::string gio_method_name_, gpixel_format_name_, gcamera_name_, gcamera_info_url_;
|
|
|
std::string device_front,device_back,device_left,device_right;
|
|
|
std::string gmsgname_front, gmsgname_back, gmsgname_left, gmsgname_right;
|
|
|
+bool open_front,open_back,open_left,open_right;
|
|
|
+
|
|
|
+std::thread * mthread1;
|
|
|
+std::thread * mthread2;
|
|
|
+std::thread * mthread3;
|
|
|
+std::thread * mthread4;
|
|
|
//std::string start_service_name_, start_service_name_;
|
|
|
bool gstreaming_status_;
|
|
|
int gimage_width_, gimage_height_, gframerate_, gexposure_, gbrightness_, gcontrast_, gsaturation_, gsharpness_, gfocus_,
|
|
@@ -206,6 +212,8 @@ void threadcapture(std::string devicename,void * pHandle)
|
|
|
bool bser = pic.SerializeToArray(strser,nSize);
|
|
|
qDebug("pac time is %d size is %d",xg.elapsed(),nSize);
|
|
|
|
|
|
+ std::cout<<"read "<<devicename<<std::endl;
|
|
|
+
|
|
|
if(bser)iv::modulecomm::ModuleSendMsg(pHandle,strser,nSize);
|
|
|
else
|
|
|
{
|
|
@@ -256,6 +264,11 @@ int main(int argc, char *argv[])
|
|
|
device_left = xp.GetParam("left", std::string("/dev/video4"));
|
|
|
device_right = xp.GetParam("right", std::string("/dev/video6"));
|
|
|
|
|
|
+ open_front = xp.GetParam("open_front", true);
|
|
|
+ open_back = xp.GetParam("open_back", true);
|
|
|
+ open_left = xp.GetParam("open_left", true);
|
|
|
+ open_right = xp.GetParam("open_right", true);
|
|
|
+
|
|
|
|
|
|
gbrightness_ = xp.GetParam("brightness", -1); //0-255, -1 "leave alone"
|
|
|
gcontrast_ = xp.GetParam("contrast", -1); //0-255, -1 "leave alone"
|
|
@@ -283,29 +296,54 @@ int main(int argc, char *argv[])
|
|
|
gbuserawmjpeg = xp.GetParam("use_rawmjpeg",true);
|
|
|
gbcompress = xp.GetParam("bcompress",true);
|
|
|
|
|
|
- gpa_front = iv::modulecomm::RegisterSend(gmsgname_front.data(),1000000,1);
|
|
|
- std::thread * mthread1 = new std::thread(threadcapture,device_front,gpa_front);//new std::thread(VideoThread,0);
|
|
|
+ if(open_front)
|
|
|
+ {
|
|
|
+ gpa_front = iv::modulecomm::RegisterSend(gmsgname_front.data(),1000000,1);
|
|
|
+ mthread1 = new std::thread(threadcapture,device_front,gpa_front);//new std::thread(VideoThread,0);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(open_back)
|
|
|
+ {
|
|
|
+ gpa_back = iv::modulecomm::RegisterSend(gmsgname_back.data(),1000000,1);
|
|
|
+ mthread2 = new std::thread(threadcapture,device_back,gpa_back);//
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(open_left)
|
|
|
+ {
|
|
|
+ gpa_left = iv::modulecomm::RegisterSend(gmsgname_left.data(),1000000,1);
|
|
|
+ mthread3 = new std::thread(threadcapture,device_left,gpa_left);//
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- gpa_back = iv::modulecomm::RegisterSend(gmsgname_back.data(),1000000,1);
|
|
|
- std::thread * mthread2 = new std::thread(threadcapture,device_back,gpa_back);//
|
|
|
+ if(open_right)
|
|
|
+ {
|
|
|
+ gpa_right = iv::modulecomm::RegisterSend(gmsgname_right.data(),1000000,1);
|
|
|
+ mthread4 = new std::thread(threadcapture,device_right,gpa_right);//
|
|
|
+ }
|
|
|
|
|
|
- gpa_left = iv::modulecomm::RegisterSend(gmsgname_left.data(),1000000,1);
|
|
|
- std::thread * mthread3 = new std::thread(threadcapture,device_left,gpa_left);//
|
|
|
+ if(open_front)
|
|
|
+ (void)mthread1;
|
|
|
+ if(open_back)
|
|
|
+ (void)mthread2;
|
|
|
+ if(open_left)
|
|
|
+ (void)mthread3;
|
|
|
+ if(open_right)
|
|
|
+ (void)mthread4;
|
|
|
|
|
|
- gpa_right = iv::modulecomm::RegisterSend(gmsgname_right.data(),1000000,1);
|
|
|
- std::thread * mthread4 = new std::thread(threadcapture,device_right,gpa_right);//
|
|
|
|
|
|
- (void)mthread1;
|
|
|
- (void)mthread2;
|
|
|
- (void)mthread3;
|
|
|
- (void)mthread4;
|
|
|
iv::ivexit::RegIVExitCall(ExitFunc);
|
|
|
signal(SIGINT,signal_handler);
|
|
|
int nrc = a.exec();
|
|
|
- iv::modulecomm::Unregister(gpa_front);
|
|
|
- iv::modulecomm::Unregister(gpa_back);
|
|
|
- iv::modulecomm::Unregister(gpa_left);
|
|
|
- iv::modulecomm::Unregister(gpa_right);
|
|
|
+
|
|
|
+ if(open_front)
|
|
|
+ iv::modulecomm::Unregister(gpa_front);
|
|
|
+ if(open_back)
|
|
|
+ iv::modulecomm::Unregister(gpa_back);
|
|
|
+ if(open_left)
|
|
|
+ iv::modulecomm::Unregister(gpa_left);
|
|
|
+ if(open_right)
|
|
|
+ iv::modulecomm::Unregister(gpa_right);
|
|
|
std::cout<<"driver_camera_ioctl quit."<<nrc<<std::endl;
|
|
|
|
|
|
return nrc;
|