*! 1. minor changes to avoid php hanging when not communicating with camogm
*!
*! Revision 1.21 2012/04/14 01:25:12 dzhimiev
*! 1. added 'list' - shows files at the specified path
*!
*! Revision 1.20 2011/06/02 12:29:07 oneartplease
*! added new option to set_start_after_timestamp to allow setting record start time in the future without first having to read current camera time "p5" as parameter will start recording at camera time "p"lus 5 seconds
*!
*! Revision 1.19 2011/04/04 20:19:36 dzhimiev
*! 1. added frame skipping option
*!
*! Revision 1.18 2011/01/01 13:04:47 oneartplease
*! added commands to set frameskipping and secondsskipping (timelapse)
*!
*! Revision 1.17 2010/08/20 20:16:55 oneartplease
*! cleaned up setcookie commands
*!
*! Revision 1.16 2010/08/08 20:19:46 dzhimiev
*! 1. added write/read elphel parameters
*! 2. camogm: debuglev , start_after_timestamp
*!
*! Revision 1.15 2010/06/24 17:31:55 dzhimiev
*! 1. added camogm process run check (ps | grep camogm)
*!
*! Revision 1.14 2010/01/19 10:07:20 oneartplease
*! added unmounting command
*!
*! Revision 1.12 2009/10/13 12:42:31 oneartplease
*! moved save_gp=1 command
*!
*! Revision 1.11 2009/06/24 15:20:04 oneartplease
*! file renaming works with absolute paths now as preparation for mounting multiple devices
*!
*! Revision 1.5 2009/03/26 12:20:40 oneartplease
*! audio and geotagging updates, both are not fully working yet though
*!
*! Revision 1.9 2009/01/14 08:26:19 oneartplease
*! minor updates
*!
*!
*! Revision 1.0 2008/09/21 Sebastian Pichelhofer
*! start and stop commands for ajax execution
*!
*/
define('SSD_ROOT','/mnt/sda1/');
define('ASSUME_EXT4','sda1');// comment out after testing
// allow CORS: needed for multi cams unified control
header('Access-Control-Allow-Origin: *');
if(isset($_GET['state_file'])){
$state_file=$_GET['state_file'];
}
if(!check_camogm_running()){
echo"camogm is not running, starting\n";
$start_str=$start_str." -s ".$state_file;
// clean
exec("rm ".$cmd_pipe);
exec("rm ".$cmd_state);
if(!$debug)exec($start_str.' > /dev/null 2>&1 &');// "> /dev/null 2>&1 &" makes sure it is really really run as a background job that does not wait for input
elseexec($start_str.$debug.' > dev/null 2>&1 &');
for($i=0;$i<5;$i++){
if(file_exists($cmd_pipe))
break;
sleep(1);
}
if($debug){
$fcmd=fopen($cmd_pipe,"w");
fprintf($fcmd,"debuglev=$debuglev");
fclose($fcmd);
}
// set fast recording mode if there is at least one suitable partition or revert to legacy 'mov' mode