Add analysis boolean query param

This commit is contained in:
Isaac Connor 2020-09-07 13:28:23 -04:00
parent 8863fc0e0f
commit 7ae9bebea4
1 changed files with 11 additions and 1 deletions

View File

@ -63,6 +63,7 @@ int main(int argc, const char *argv[], char **envp) {
double maxfps = 10.0;
unsigned int bitrate = 100000;
unsigned int ttl = 0;
bool analysis_frames = false;
EventStream::StreamMode replay = EventStream::MODE_NONE;
std::string username;
std::string password;
@ -115,7 +116,14 @@ int main(int argc, const char *argv[], char **envp) {
char const *value = strtok(nullptr, "=");
if ( !value )
value = "";
if ( !strcmp(name, "source") ) {
if ( !strcmp(name, "analysis") ) {
if ( !strcmp(value, "true") ) {
analysis_frames = true;
} else {
analysis_frames = (atoi(value) == 1);
}
Debug(1, "Viewing analysis frames");
} else if ( !strcmp(name, "source") ) {
if ( !strcmp(value, "event") ) {
source = ZMS_EVENT;
} else if ( !strcmp(value, "fifo") ) {
@ -271,6 +279,7 @@ int main(int argc, const char *argv[], char **envp) {
zmDbClose();
return -1;
}
stream.setStreamFrameType(analysis_frames ? StreamBase::FRAME_ANALYSIS: StreamBase::FRAME_NORMAL);
if ( mode == ZMS_JPEG ) {
stream.setStreamType(MonitorStream::STREAM_JPEG);
@ -307,6 +316,7 @@ int main(int argc, const char *argv[], char **envp) {
Debug(3, "Setting stream start to frame (%d)", frame_id);
stream.setStreamStart(event_id, frame_id);
}
stream.setStreamFrameType(analysis_frames ? StreamBase::FRAME_ANALYSIS: StreamBase::FRAME_NORMAL);
if ( mode == ZMS_JPEG ) {
stream.setStreamType(EventStream::STREAM_JPEG);
} else {