state->writer_params.chunk_page_prep=0;// will prepare page 0
state->writer_params.chunk_page_prep=0;// will prepare page 0
state->writer_params.chunk_page_write=0;// will write page 0
state->writer_params.chunk_page_write=0;// will write page 0
state->writer_params.writev_run=false;
state->writer_params.exit_thread=false;
state->writer_params.exit_thread=false;
...
@@ -1695,7 +1695,12 @@ int listener_loop(camogm_state *state)
...
@@ -1695,7 +1695,12 @@ int listener_loop(camogm_state *state)
caseCAMOGM_FRAME_NOT_READY:// just wait for the frame to appear at the current pointer
caseCAMOGM_FRAME_NOT_READY:// just wait for the frame to appear at the current pointer
// we'll wait for a frame, not to waste resources. But if the compressor is stopped this program will not respond to any commands
// we'll wait for a frame, not to waste resources. But if the compressor is stopped this program will not respond to any commands
// TODO - add another wait with (short) timeout?
// TODO - add another wait with (short) timeout?
fp0=lseek(state->fd_circ[curr_port],0,SEEK_CUR);
wait_frame_sync(state->fd_fparmsall[curr_port]);
D6(fprintf(debug_file,"No compressed frame ready, waited for the next frame sync for port %d @ %06d\n",curr_port,get_fpga_usec(state->fd_fparmsall[0],0)));
break;
// do not analyze next frame (may be non-existing), will do that next time
/*
fp0 = lseek(state->fd_circ[curr_port], 0, SEEK_CUR); // need to skip uncompressed frame, LWIR16 turns compressor off
if (fp0 < 0) {
if (fp0 < 0) {
D0(fprintf(debug_file, "%s:line %d got broken frame (%d) before waiting for ready\n", __FILE__, __LINE__, fp0));
D0(fprintf(debug_file, "%s:line %d got broken frame (%d) before waiting for ready\n", __FILE__, __LINE__, fp0));
rslt = CAMOGM_FRAME_BROKEN;
rslt = CAMOGM_FRAME_BROKEN;
...
@@ -1709,6 +1714,7 @@ int listener_loop(camogm_state *state)
...
@@ -1709,6 +1714,7 @@ int listener_loop(camogm_state *state)
break;
break;
}
}
}
}
*/
// no break
// no break
caseCAMOGM_FRAME_CHANGED:// frame parameters have changed
caseCAMOGM_FRAME_CHANGED:// frame parameters have changed
caseCAMOGM_FRAME_NEXTFILE:// next file needed (need to switch to a new file (time/size exceeded limit)
caseCAMOGM_FRAME_NEXTFILE:// next file needed (need to switch to a new file (time/size exceeded limit)
...
@@ -2294,3 +2300,14 @@ inline int get_fpga_usec(const int fd_fparsall, unsigned int port)
...
@@ -2294,3 +2300,14 @@ inline int get_fpga_usec(const int fd_fparsall, unsigned int port)