Web UI for ARGUS server
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.

35 lines
1.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $STREAM = intval( $_POST['STREAM'] );
  5. $PID = $_POST['PID'];
  6. if( $_POST['VALUE'] == 'true' ){
  7. $VALUE = 1;
  8. } else {
  9. $VALUE = intval( $_POST['VALUE'] );
  10. };
  11. if( $STREAM > 0 && $PID!= '' ){
  12. $QS = "SELECT * FROM `media_streams` WHERE `id` = {$STREAM}";
  13. $Result = $DATABASE->Query( $QS, false );
  14. if( count( $Result ) ){
  15. $CS = $Result[0];
  16. if( $CS['source_type'] == 'A' ){
  17. $CMD = "";
  18. if( $PID == 'frame_format' ){
  19. $CMD = "v4l2-ctl -d {$CS['mrl']} --set-fmt-video=pixelformat=MJPG";
  20. } else if( $PID == 'frame_size' ){
  21. $TArr = explode( 'x', $_POST['VALUE'] );
  22. if( count( $TArr ) == 2 ){
  23. $CMD = "v4l2-ctl -d {$CS['mrl']} --set-fmt-video=width={$TArr[0]},height={$TArr[1]}";
  24. $QS = "UPDATE `media_streams` SET `img_width`={$TArr[0]}, `img_height`={$TArr[1]} WHERE `id`={$STREAM}";
  25. $DATABASE->Query($QS);
  26. };
  27. } else {
  28. $CMD = "v4l2-ctl -d {$CS['mrl']} --set-ctrl={$PID}={$VALUE}";
  29. };
  30. if( $CMD != '' ) $Ret = `$CMD`;
  31. echo $CMD;
  32. };
  33. };
  34. };
  35. };
  36. ?>