Merge branch 'master' into multistream

This commit is contained in:
Isaac Connor 2022-01-05 20:20:45 -05:00
commit dadf53f99d
2 changed files with 19 additions and 1 deletions

View File

@ -83,6 +83,7 @@ std::string load_monitor_sql =
"`SectionLength`, `MinSectionLength`, `FrameSkip`, `MotionFrameSkip`, " "`SectionLength`, `MinSectionLength`, `FrameSkip`, `MotionFrameSkip`, "
"`FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`," "`FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`,"
"`RTSPServer`, `RTSPStreamName`," "`RTSPServer`, `RTSPStreamName`,"
"`ONVIF_URL`, `ONVIF_Username`, `ONVIF_Password`, `ONVIF_Options`,"
"`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1 FROM `Monitors`"; "`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1 FROM `Monitors`";
std::string CameraType_Strings[] = { std::string CameraType_Strings[] = {
@ -446,6 +447,7 @@ Monitor::Monitor()
"SectionLength, MinSectionLength, FrameSkip, MotionFrameSkip, " "SectionLength, MinSectionLength, FrameSkip, MotionFrameSkip, "
"FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif," "FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif,"
"`RTSPServer`,`RTSPStreamName`, "`RTSPServer`,`RTSPStreamName`,
"`ONVIF_URL`, `ONVIF_Username`, `ONVIF_Password`, `ONVIF_Options`,"
"SignalCheckPoints, SignalCheckColour, Importance-1 FROM Monitors"; "SignalCheckPoints, SignalCheckColour, Importance-1 FROM Monitors";
*/ */
@ -622,6 +624,13 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) {
rtsp_server = (*dbrow[col] != '0'); col++; rtsp_server = (*dbrow[col] != '0'); col++;
rtsp_streamname = dbrow[col]; col++; rtsp_streamname = dbrow[col]; col++;
onvif_url = std::string(dbrow[col] ? dbrow[col] : ""); col++;
onvif_username = std::string(dbrow[col] ? dbrow[col] : ""); col++;
onvif_password = std::string(dbrow[col] ? dbrow[col] : ""); col++;
onvif_options = std::string(dbrow[col] ? dbrow[col] : ""); col++;
importance = dbrow[col] ? atoi(dbrow[col]) : 0;// col++;
/*"SignalCheckPoints, SignalCheckColour, Importance-1 FROM Monitors"; */ /*"SignalCheckPoints, SignalCheckColour, Importance-1 FROM Monitors"; */
signal_check_points = atoi(dbrow[col]); col++; signal_check_points = atoi(dbrow[col]); col++;
signal_check_colour = strtol(dbrow[col][0] == '#' ? dbrow[col]+1 : dbrow[col], 0, 16); col++; signal_check_colour = strtol(dbrow[col][0] == '#' ? dbrow[col]+1 : dbrow[col], 0, 16); col++;
@ -633,7 +642,6 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) {
blue_val = BLUE_VAL_BGRA(signal_check_colour); blue_val = BLUE_VAL_BGRA(signal_check_colour);
grayscale_val = signal_check_colour & 0xff; /* Clear all bytes but lowest byte */ grayscale_val = signal_check_colour & 0xff; /* Clear all bytes but lowest byte */
importance = dbrow[col] ? atoi(dbrow[col]) : 0;// col++;
if (importance < 0) importance = 0; // Should only be >= 0 if (importance < 0) importance = 0; // Should only be >= 0
// How many frames we need to have before we start analysing // How many frames we need to have before we start analysing

View File

@ -306,6 +306,11 @@ protected:
std::string path; std::string path;
std::string second_path; std::string second_path;
std::string onvif_url;
std::string onvif_username;
std::string onvif_password;
std::string onvif_options;
std::string device; std::string device;
int palette; int palette;
int channel; int channel;
@ -608,6 +613,11 @@ public:
std::string GetAudioFifoPath() const { return shared_data ? shared_data->audio_fifo_path : ""; }; std::string GetAudioFifoPath() const { return shared_data ? shared_data->audio_fifo_path : ""; };
std::string GetRTSPStreamName() const { return rtsp_streamname; }; std::string GetRTSPStreamName() const { return rtsp_streamname; };
const std::string &getONVIF_URL() const { return onvif_url; };
const std::string &getONVIF_Username() const { return onvif_username; };
const std::string &getONVIF_Password() const { return onvif_password; };
const std::string &getONVIF_Options() const { return onvif_options; };
int GetImage(int32_t index=-1, int scale=100); int GetImage(int32_t index=-1, int scale=100);
ZMPacket *getSnapshot( int index=-1 ) const; ZMPacket *getSnapshot( int index=-1 ) const;
SystemTimePoint GetTimestamp(int index = -1) const; SystemTimePoint GetTimestamp(int index = -1) const;