diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 4aacc42e0..d53c3658a 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -2775,6 +2775,19 @@ void MonitorStream::processCommand( const CmdMsg *msg ) replay_rate = ZM_RATE_BASE; break; } + case CMD_VARPLAY : + { + Debug( 1, "Got VARPLAY command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + replay_rate = msg->msg_data[1]; + break; + } case CMD_STOP : { Debug( 1, "Got STOP command" ); diff --git a/src/zm_stream.h b/src/zm_stream.h index 47b745514..598d85384 100644 --- a/src/zm_stream.h +++ b/src/zm_stream.h @@ -57,7 +57,7 @@ protected: } DataMsg; typedef enum { MSG_CMD=1, MSG_DATA_WATCH, MSG_DATA_EVENT } MsgType; - typedef enum { CMD_NONE=0, CMD_PAUSE, CMD_PLAY, CMD_STOP, CMD_FASTFWD, CMD_SLOWFWD, CMD_SLOWREV, CMD_FASTREV, CMD_ZOOMIN, CMD_ZOOMOUT, CMD_PAN, CMD_SCALE, CMD_PREV, CMD_NEXT, CMD_SEEK, CMD_QUERY=99 } MsgCommand; + typedef enum { CMD_NONE=0, CMD_PAUSE, CMD_PLAY, CMD_STOP, CMD_FASTFWD, CMD_SLOWFWD, CMD_SLOWREV, CMD_FASTREV, CMD_ZOOMIN, CMD_ZOOMOUT, CMD_PAN, CMD_SCALE, CMD_PREV, CMD_NEXT, CMD_SEEK, CMD_VARPLAY, CMD_QUERY=99 } MsgCommand; protected: Monitor *monitor; diff --git a/web/ajax/stream.php b/web/ajax/stream.php index 638c510b9..89c76f918 100644 --- a/web/ajax/stream.php +++ b/web/ajax/stream.php @@ -20,6 +20,10 @@ if ( !@socket_bind( $socket, $locSockFile ) ) switch ( $_REQUEST['command'] ) { + case CMD_VARPLAY : + //error_log( "Varplaying to ".$_REQUEST['rate'] ); + $msg = pack( "lcc", MSG_CMD, $_REQUEST['command'], $_REQUEST['rate'] ); + break; case CMD_ZOOMIN : //error_log( "Zooming to ".$_REQUEST['x'].",".$_REQUEST['y'] ); $msg = pack( "lcnn", MSG_CMD, $_REQUEST['command'], $_REQUEST['x'], $_REQUEST['y'] ); diff --git a/web/includes/config.php.in b/web/includes/config.php.in index c18db29f0..bc45f30ac 100644 --- a/web/includes/config.php.in +++ b/web/includes/config.php.in @@ -78,6 +78,7 @@ define( "CMD_SCALE", 11 ); define( "CMD_PREV", 12 ); define( "CMD_NEXT", 13 ); define( "CMD_SEEK", 14 ); +define( "CMD_VARPLAY", 15 ); define( "CMD_QUERY", 99 ); //