Commit 4debbbaa authored by Mikhail Karpenko's avatar Mikhail Karpenko

Change default settings

parent 13e75796
...@@ -173,8 +173,8 @@ struct framepars_all_t *frameParsAll[SENSOR_PORTS]; ...@@ -173,8 +173,8 @@ struct framepars_all_t *frameParsAll[SENSOR_PORTS];
struct framepars_t *framePars[SENSOR_PORTS]; struct framepars_t *framePars[SENSOR_PORTS];
unsigned long *globalPars[SENSOR_PORTS]; /// parameters that are not frame-related, their changes do not initiate any actions unsigned long *globalPars[SENSOR_PORTS]; /// parameters that are not frame-related, their changes do not initiate any actions
#define DEFAULT_DURATION 60 /*!default segment duration (seconds) */ #define DEFAULT_DURATION 600 /*!default segment duration (seconds) */
#define DEFAULT_LENGTH 100000000 /*!default segment length (B) */ #define DEFAULT_LENGTH 1073741824 /*!default segment length (B) */
#define DEFAULT_GREEDY 0 /*!behavior for the files: 0 clean buffer, 1 - save as much as possible */ #define DEFAULT_GREEDY 0 /*!behavior for the files: 0 clean buffer, 1 - save as much as possible */
#define DEFAULT_IGNORE_FPS 0 /*!0 restartf file if fps changed, 1 - ignore variable fps (and skip less frames) */ #define DEFAULT_IGNORE_FPS 0 /*!0 restartf file if fps changed, 1 - ignore variable fps (and skip less frames) */
...@@ -183,7 +183,6 @@ unsigned long *globalPars[SENSOR_PORTS]; /// parameters that are not ...@@ -183,7 +183,6 @@ unsigned long *globalPars[SENSOR_PORTS]; /// parameters that are not
#define DEFAULT_FRAMES 16384 /* Maximal number of frames in file segment (each need 4* (1 + 1/frames_per_chunk) bytes for the frame index */ #define DEFAULT_FRAMES 16384 /* Maximal number of frames in file segment (each need 4* (1 + 1/frames_per_chunk) bytes for the frame index */
#define DEFAULT_FRAMES_PER_CHUNK 10 /*second sparse index - for Quicktime fast forward */ #define DEFAULT_FRAMES_PER_CHUNK 10 /*second sparse index - for Quicktime fast forward */
#define DEFAULT_LENGTH 100000000 /*!default segment length (B) */
#define DEFAULT_EXIF 1 /* use Exif */ #define DEFAULT_EXIF 1 /* use Exif */
static char cmdbuf[1024]; static char cmdbuf[1024];
...@@ -304,7 +303,7 @@ void camogm_init(camogm_state *state, unsigned int port, char *pipe_name) ...@@ -304,7 +303,7 @@ void camogm_init(camogm_state *state, unsigned int port, char *pipe_name)
strcpy(state->debug_name, "stderr"); strcpy(state->debug_name, "stderr");
camogm_set_timescale(state, 1.0); camogm_set_timescale(state, 1.0);
camogm_set_frames_skip(state, 0); // don't skip camogm_set_frames_skip(state, 0); // don't skip
camogm_set_format(state, CAMOGM_FORMAT_OGM); camogm_set_format(state, CAMOGM_FORMAT_MOV);
state->exifSize = 0; state->exifSize = 0;
state->exif = DEFAULT_EXIF; state->exif = DEFAULT_EXIF;
state->frame_lengths = NULL; state->frame_lengths = NULL;
...@@ -969,7 +968,7 @@ void camogm_status(camogm_state *state, char * fn, int xml) ...@@ -969,7 +968,7 @@ void camogm_status(camogm_state *state, char * fn, int xml)
"other"))) : "none"; "other"))) : "none";
_using_exif = state->exif ? "yes" : "no"; _using_exif = state->exif ? "yes" : "no";
_using_global_pointer = state->save_gp ? "yes" : "no"; _using_global_pointer = state->save_gp ? "yes" : "no";
_compressor_state = (getGPValue(state->port_num, P_COMPRESSOR_RUN) == 2) ? "running" : "stoppped"; _compressor_state = (getGPValue(state->port_num, P_COMPRESSOR_RUN) == 2) ? "running" : "stopped";
if ( state->frames_skip > 0 ) { if ( state->frames_skip > 0 ) {
_frames_remain = state->frames_skip_left; _frames_remain = state->frames_skip_left;
_frames_skip = state->frames_skip; _frames_skip = state->frames_skip;
...@@ -1538,7 +1537,7 @@ int listener_loop(camogm_state *state) ...@@ -1538,7 +1537,7 @@ int listener_loop(camogm_state *state)
/** /**
* @brief Return disk size in bytes * @brief Return disk size in bytes
* *
* This function reads disk size using ioctl call. * This function reads disk size using ioctl call and returns it in bytes.
* @param name pointer to disk name string * @param name pointer to disk name string
* @return disk size in bytes if it was read correctly and 0 otherwise * @return disk size in bytes if it was read correctly and 0 otherwise
*/ */
......
...@@ -69,10 +69,10 @@ ...@@ -69,10 +69,10 @@
/** @brief Size of iovec structures holding data to be written */ /** @brief Size of iovec structures holding data to be written */
#define IOVEC_SIZE 10 #define IOVEC_SIZE 10
/** @brief Start of file marker, contains "elphelst" string in ASCII symbols */ /** @brief File starting marker, contains "stelphel" string in ASCII symbols */
const unsigned char elphelst[] = {0x65, 0x6c, 0x70, 0x68, 0x65, 0x6c, 0x73, 0x74}; const unsigned char elphelst[] = {0x73, 0x74, 0x65, 0x6c, 0x70, 0x68, 0x65, 0x6c};
/** @brief End of file marker, contains "elphelen" string in ASCII symbols */ /** @brief File ending marker, contains "enelphel" string in ASCII symbols */
const unsigned char elphelen[] = {0x65, 0x6c, 0x70, 0x68, 0x65, 0x6c, 0x65, 0x6e}; const unsigned char elphelen[] = {0x65, 0x6e, 0x65, 0x6c, 0x70, 0x68, 0x65, 0x6c};
static struct iovec start_marker = { static struct iovec start_marker = {
.iov_base = elphelst, .iov_base = elphelst,
.iov_len = sizeof(elphelst) .iov_len = sizeof(elphelst)
...@@ -173,6 +173,8 @@ int camogm_frame_jpeg(camogm_state *state) ...@@ -173,6 +173,8 @@ int camogm_frame_jpeg(camogm_state *state)
} }
} }
chunks_iovec[0] = start_marker; chunks_iovec[0] = start_marker;
l += start_marker.iov_len;
chunks_used++;
for (int i = 1; i < chunks_used; i++) { for (int i = 1; i < chunks_used; i++) {
if (i == split_index) { if (i == split_index) {
// one of the chunks rolls over the end of the raw storage, split it into two segments and // one of the chunks rolls over the end of the raw storage, split it into two segments and
...@@ -193,9 +195,11 @@ int camogm_frame_jpeg(camogm_state *state) ...@@ -193,9 +195,11 @@ int camogm_frame_jpeg(camogm_state *state)
l += chunks_iovec[i].iov_len; l += chunks_iovec[i].iov_len;
} }
} }
assert(chunks_used < IOVEC_SIZE);
// consider start_marker here and increment chunks_used // consider start_marker here and increment chunks_used
chunks_iovec[chunks_used++] = end_marker; assert(chunks_used < IOVEC_SIZE);
chunks_iovec[chunks_used] = end_marker;
l += end_marker.iov_len;
chunks_used++;
/* debug code follows */ /* debug code follows */
fprintf(debug_file, "\n=== raw device write, iovec dump ===\n"); fprintf(debug_file, "\n=== raw device write, iovec dump ===\n");
......
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