Commit cd9c687b authored by Andrey Filippov's avatar Andrey Filippov

Fixing recording from Lepton

parent 36b9f027
...@@ -1630,15 +1630,19 @@ int listener_loop(camogm_state *state) ...@@ -1630,15 +1630,19 @@ int listener_loop(camogm_state *state)
ret = poll(&pfd,1,DEFAULT_POLL_TIMEOUT); ret = poll(&pfd,1,DEFAULT_POLL_TIMEOUT);
if (ret==0){ if (ret==0){
D6(fprintf(debug_file, "Waiting for commands...\n")); D6(fprintf(debug_file, "Waiting for commands..., state->prog_state = %d, pfd.revents=%d\n",state->prog_state, (int) pfd.revents));
} }
if (pfd.revents & POLLIN){ if (pfd.revents & POLLIN){
cmd = parse_cmd(state, cmd_file); cmd = parse_cmd(state, cmd_file);
if (cmd) { if (cmd) {
if (cmd < 0) D0(fprintf(debug_file, "Unrecognized command\n")); if (cmd < 0) D0(fprintf(debug_file, "Unrecognized command\n"));
}
} else if (state->prog_state == STATE_RUNNING) { // no commands in queue, started } else if (state->prog_state == STATE_RUNNING) { // no commands in queue, started
D6(fprintf(debug_file, "state->prog_state == STATE_RUNNING "));
switch ((rslt = -sendImageFrame(state))) { switch ((rslt = -sendImageFrame(state))) {
D6(fprintf(debug_file, " ==> %d",rslt));
case 0: case 0:
break; // frame sent OK, nothing to do (TODO: check file length/duration) break; // frame sent OK, nothing to do (TODO: check file length/duration)
case CAMOGM_FRAME_NOT_READY: // just wait for the frame to appear at the current pointer case CAMOGM_FRAME_NOT_READY: // just wait for the frame to appear at the current pointer
...@@ -1727,7 +1731,7 @@ int listener_loop(camogm_state *state) ...@@ -1727,7 +1731,7 @@ int listener_loop(camogm_state *state)
state->rawdev.thread_state = STATE_RUNNING; state->rawdev.thread_state = STATE_RUNNING;
usleep(COMMAND_LOOP_DELAY); // make it longer but interruptible by signals? usleep(COMMAND_LOOP_DELAY); // make it longer but interruptible by signals?
} }
} // if pfd.revents & POLLIN // } // if pfd.revents & POLLIN
} // while (process) } // while (process)
// normally, we should not be here // normally, we should not be here
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment