//! find location of the timestamp and copy it to the frame_params structure
//! find location of the timestamp and copy it to the frame_params structure
///==================================
///==================================
timestamp_start=(state->cirbuf_rp)+((state->jpeg_len+CCAM_MMAP_META+3)&(~0x1f))+32-CCAM_MMAP_META_SEC;//! magic shift - should index first byte of the time stamp
timestamp_start=(state->cirbuf_rp)+((state->jpeg_len+CCAM_MMAP_META+3)&(~0x1f))+32-CCAM_MMAP_META_SEC;//! magic shift - should index first byte of the time stamp
D3(fprintf(debug_file,"?6,fp=0x%x ",fp));//frame not ready, frame pointer seems valid, but not ready
D3(fprintf(debug_file,"?6,fp=0x%x ",fp));//frame not ready, frame pointer seems valid, but not ready
return-CAMOGM_FRAME_NOT_READY;//! frame pointer valid, but no frames yet
return-CAMOGM_FRAME_NOT_READY;//! frame pointer valid, but no frames yet
}
}
//! process skipping frames. TODO: add - skipping time between frames (or better - actual time period - use the nearest frame) instead of the frame number
//! process skipping frames. TODO: add - skipping time between frames (or better - actual time period - use the nearest frame) instead of the frame number
if((state->frames_skip>0)&&(state->frames_skip_left>0)){//!skipping frames, not seconds.
if((state->frames_skip>0)&&(state->frames_skip_left>0)){//!skipping frames, not seconds.
//! find location of the timestamp and copy it to the frame_params structure
//! find location of the timestamp and copy it to the frame_params structure
timestamp_start=state->cirbuf_rp+((state->jpeg_len+CCAM_MMAP_META+3)&(~0x1f))+32-CCAM_MMAP_META_SEC;//! magic shift - should index first byte of the time stamp
timestamp_start=state->cirbuf_rp+((state->jpeg_len+CCAM_MMAP_META+3)&(~0x1f))+32-CCAM_MMAP_META_SEC;//! magic shift - should index first byte of the time stamp
// if (state->this_frame_params.timestamp_sec > (state->kml_last_ts + state->kml_period)) { // this way it is safe to put kml_period=1000, then kml_period=1
// if (state->this_frame_params.timestamp_sec > (state->kml_last_ts + state->kml_period)) { // this way it is safe to put kml_period=1000, then kml_period=1