Web Interface For Lite Argus Control modules
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?php require_once('../ajax_asm.php'); //require_once('../php/onvif/toto.php');
if( $CUser->Data['id'] > 1 ){ if( isset( $_POST['cam_sources'] ) ){ if( $_POST['cam_sources'] == 'ipv' ){ $QS = "SELECT * FROM `cameras` WHERE `node_id`=0"; $Result = $DATABASE->Query($QS,false); foreach( $Result as $CD ){ $cnode['id'] = $CD['id']; $cnode['status'] = $CD['status']; $cnode['login'] = $CD['access_login']; $cnode['password']= $CD['access_pass']; $cnode['name'] = urldecode($CD['name']); $cnode['hardware']= urldecode($CD['hardware']); $cnode['caps'] = 'IP'; $cnode['ip'] = $CD['ip']; $cnode['mac'] = $CD['mac']; $cnode['ena'] = 1; $Data['nodes'][] = $cnode; }; } else { // Update Current Analog Sources
$CDATA = `v4l2-ctl --list-devices`; $LU = explode( "\n", $CDATA ); $CDEVS = array(); foreach( $LU as $U ){ $CL = trim( $U ); if( substr( $CL, 0, 10 ) == '/dev/video' ){ $CN = getV4L2DeviceName( $CL ); $RR = array( 'name'=>$CN, 'mrl'=>$CL ); $QS = "SELECT * FROM `media_streams` WHERE `source_type`='A' AND `mrl`='{$CL}'"; $KO = $DATABASE->Query( $QS ); if( count( $KO ) == 0 ){ $CDEVS[] = $RR; //$QS = "INSERT INTO `media_streams`(
}; }; }; $QS = "SELECT `ms`.* , `re`.`node_id` FROM `media_streams` `ms` LEFT JOIN `resources` `re` ON ( `re`.`aux_id` = `ms`.`id` ) WHERE `ms`.`source_type`='A' AND `ms`.`source_id`=0"; $Result = $DATABASE->Query($QS,false); foreach( $Result as $CD ){ $cnode['id'] = $CD['id']; $cnode['server'] = getServerID( $CD['node_id'] );//'local';
$T = getV4L2DeviceName($CD['mrl']); $cnode['name'] = $T['name']; $cnode['hardware']= $T['dev']; $cnode['caps'] = 'Analog'; $cnode['ip'] = '['.$CD['img_width'] .'x' . $CD['img_height'] .']'; $cnode['mac'] = $CD['mrl']; if( $T['dev']=='unknown') $cnode['ena'] = 0; else $cnode['ena'] = 1; $Data['nodes'][] = $cnode; }; }; echo json_encode( $Data ); } else { header('location: /'); }; } else { header('location: /'); };?>
|