Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1253 zms quit cmd #1254

Merged
merged 3 commits into from
Jan 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/zm_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,11 @@ void EventStream::processCommand( const CmdMsg *msg )
Debug( 1, "Got QUERY command, sending STATUS" );
break;
}
case CMD_QUIT :
{
Info ("User initiated exit - CMD_QUIT");
break;
}
default :
{
// Do nothing, for now
Expand Down Expand Up @@ -1125,6 +1130,9 @@ void EventStream::processCommand( const CmdMsg *msg )
exit( -1 );
}
}
// quit after sending a status, if this was a quit request
if ((MsgCommand)msg->msg_data[0]==CMD_QUIT)
exit(0);

updateFrameRate( (double)event_data->frame_count/event_data->duration );
}
Expand Down
9 changes: 9 additions & 0 deletions src/zm_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3922,6 +3922,11 @@ void MonitorStream::processCommand( const CmdMsg *msg )
Debug( 1, "Got SCALE command, to %d", scale );
break;
}
case CMD_QUIT :
{
Info ("User initiated exit - CMD_QUIT");
break;
}
case CMD_QUERY :
{
Debug( 1, "Got QUERY command, sending STATUS" );
Expand Down Expand Up @@ -3987,6 +3992,10 @@ void MonitorStream::processCommand( const CmdMsg *msg )
}
}

// quit after sending a status, if this was a quit request
if ((MsgCommand)msg->msg_data[0]==CMD_QUIT)
exit(0);

updateFrameRate( monitor->GetFPS() );
}

Expand Down
2 changes: 1 addition & 1 deletion src/zm_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class StreamBase
} 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_VARPLAY, CMD_GET_IMAGE, 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_GET_IMAGE, CMD_QUIT, CMD_QUERY=99 } MsgCommand;

protected:
Monitor *monitor;
Expand Down