Merge branch 'storageareas' into zma_to_thread

This commit is contained in:
Isaac Connor 2017-10-08 09:14:04 -04:00
commit 2163099d6b
3 changed files with 29 additions and 22 deletions

View File

@ -436,7 +436,10 @@ void Event::AddFramesInternal( int n_frames, int start_frame, Image **images, st
snprintf( event_file, sizeof(event_file), capture_file_format, path, frames );
if ( monitor->GetOptSaveJPEGs() & 4 ) {
//If this is the first frame, we should add a thumbnail to the event directory
if(frames == 10){
// ICON: We are working through the pre-event frames so this snapshot won't
// neccessarily be of the motion. But some events are less than 10 frames,
// so I am changing this to 1, but we should overwrite it later with a better snapshot.
if ( frames == 1 ) {
char snapshot_file[PATH_MAX];
snprintf( snapshot_file, sizeof(snapshot_file), "%s/snapshot.jpg", path );
WriteFrameImage( images[i], *(timestamps[i]), snapshot_file );
@ -463,7 +466,7 @@ void Event::AddFramesInternal( int n_frames, int start_frame, Image **images, st
Debug( 1, "Adding %d/%d frames to DB", frameCount, n_frames );
*(sql+strlen(sql)-2) = '\0';
if ( mysql_query( &dbconn, sql ) ) {
Error( "Can't insert frames: %s", mysql_error( &dbconn ) );
Error( "Can't insert frames: %s, sql was (%s)", mysql_error( &dbconn ), sql );
exit( mysql_errno( &dbconn ) );
}
last_db_frame = frames;

View File

@ -1190,11 +1190,15 @@ uint32_t LocalCamera::AutoSelectFormat(int p_colours) {
fmtinfo.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
// FIXME This will crash if there are more than 64 formats.
while(vidioctl( enum_fd, VIDIOC_ENUM_FMT, &fmtinfo ) >= 0) {
if (nIndex >= 64 ) {
Error("More than 64 formats detected, can't handle that.");
break;
}
/* Got a format. Copy it to the array */
strcpy(fmt_desc[nIndex], (const char*)(fmtinfo.description));
fmt_fcc[nIndex] = fmtinfo.pixelformat;
Debug(6, "Got format: %s (0x%02hhx%02hhx%02hhx%02hhx) at index %d",
Debug(3, "Got format: %s (0x%02hhx%02hhx%02hhx%02hhx) at index %d",
fmt_desc[nIndex], (fmt_fcc[nIndex]>>24)&0xff, (fmt_fcc[nIndex]>>16)&0xff, (fmt_fcc[nIndex]>>8)&0xff, (fmt_fcc[nIndex])&0xff ,nIndex);
/* Proceed to the next index */

View File

@ -46,7 +46,7 @@ $configSubFolder = ZM_CONFIG_SUBDIR;
if ( is_dir($configSubFolder) ) {
if ( is_readable($configSubFolder) ) {
foreach ( glob("$configSubFolder/*.conf") as $filename ) {
error_log("processing $filename");
//error_log("processing $filename");
$configvals = array_replace($configvals, process_configfile($filename) );
}
} else {