#!/bin/bash
#
#   Script to respond to a click on the
#   streaming video picture.
#
#   by Bob Williams
#   bob@bob.usuf2.usuhs.mil
#
# Header requires these two lines
/bin/echo "Content-type: text/html"
/bin/echo
# set the umask so files are created mode 644
umask 022

# Send a different picture.
# if [ -f /tmp/camera_offline ]; then
#    /bin/cat /tmp/snapshot.jpg
#    exit 0
# fi

# Send a noise to the server machine, linux dsp device.
/bin/cat /home/httpd/html/video/liver.wav > /dev/dsp &

# Optional stuff:
# Take a snapshot and pipe it though a PGM->JPEG filter.  The result
# goes to STDOUT.  -greyscale flag is included to speed things up.
# touch /tmp/cam-in-use
# /usr/local/bin/qcam -E 1 -f /usr/local/etc/qcam.conf -s 1 \
#  -p 0x378 2>/dev/null \
#  | /usr/local/bin/cjpeg -grayscale > /tmp/snapshot.jpg 
# /bin/cat /tmp/snapshot.jpg
# rm -f /tmp/cam-in-use

/bin/echo "<HTML>"
/bin/echo "<BODY BGCOLOR="ffffff" TEXT="000000">"
/bin/echo "This is a response to a click on "
/bin/echo "the video stream frame."
/bin/echo "</body>"
/bin/echo "</HTML>"








