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.
 
 
 
 

36 lines
1.1 KiB

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$STREAM = intval( $_POST['STREAM'] );
$PID = $_POST['PID'];
if( $_POST['VALUE'] == 'true' ){
$VALUE = 1;
} else {
$VALUE = intval( $_POST['VALUE'] );
};
if( $STREAM > 0 && $PID!= '' ){
$QS = "SELECT * FROM `media_streams` WHERE `id` = {$STREAM}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$CS = $Result[0];
if( $CS['source_type'] == 'A' ){
$CMD = "";
if( $PID == 'frame_format' ){
$CMD = "v4l2-ctl -d {$CS['mrl']} --set-fmt-video=pixelformat=MJPG";
} else if( $PID == 'frame_size' ){
$TArr = explode( 'x', $_POST['VALUE'] );
if( count( $TArr ) == 2 ){
$CMD = "v4l2-ctl -d {$CS['mrl']} --set-fmt-video=width={$TArr[0]},height={$TArr[1]}";
$QS = "UPDATE `media_streams` SET `img_width`={$TArr[0]}, `img_height`={$TArr[1]} WHERE `id`={$STREAM}";
$DATABASE->Query($QS);
};
} else {
$CMD = "v4l2-ctl -d {$CS['mrl']} --set-ctrl={$PID}={$VALUE}";
};
if( $CMD != '' ) $Ret = `$CMD`;
echo $CMD;
};
};
};
};
?>