int main() { cout << "Connecting to and streaming data from ThermoCam" << endl << endl; printf("pid %d\n", (int) getpid()); AcquireImages(); cout << endl; cout << "<press a key to exit>" << endl; PvWaitForKeyPress(); return 0; }
int main(int argc, char** argv) { int i; if(argc != 5){ fprintf(stderr,"Incorrect number of arguments passed.\nEXAMPLE: ./LirTest \"<Camera 1 MAC Address>\" \"<encoder 1 output file path>\" \"<Camera 2 MAC Address>\" \"<encoder 2 output file path>\"\n"); exit(EXIT_FAILURE); } pthread_t thread[2]; pthread_attr_t attr; CamInfo camInfo[2]; running = 1; camInfo[0].MACAddress = argv[1]; camInfo[0].filename = argv[2]; camInfo[0].prefix = "CAM1-"; camInfo[1].MACAddress = argv[3]; camInfo[1].filename = argv[4]; camInfo[1].prefix = "CAM2-"; /* pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); for(i=0; i < 2; i++){ pthread_create(&thread[i],&attr,RunCam,(void*)&camInfo[i]); } */ AcquireImages(camInfo,2); printf( "\n<press the enter key to exit>\n" ); while ( !_kbhit() ); running = 0; /* pthread_attr_destroy(&attr); for(i=0; i < 2; i++){ pthread_join(thread[i],NULL); } */ return 0; }