|
MythTV master
|
#include <algorithm>#include <array>#include <fstream>#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <cerrno>#include <sys/socket.h>#include <fcntl.h>#include <netinet/in.h>#include <sys/stat.h>#include <sys/shm.h>#include <sys/mman.h>#include <sys/param.h>#include <sys/mount.h>#include <sys/sysctl.h>#include "zmserver.h"Go to the source code of this file.
Typedefs | |
| using | reconnect_t = my_bool |
Enumerations | |
| enum | ZM_SUBPIX_ORDER : std::uint8_t { ZM_SUBPIX_ORDER_NONE = 2 , ZM_SUBPIX_ORDER_RGB = 6 , ZM_SUBPIX_ORDER_BGR = 5 , ZM_SUBPIX_ORDER_BGRA = 7 , ZM_SUBPIX_ORDER_RGBA = 8 , ZM_SUBPIX_ORDER_ABGR = 9 , ZM_SUBPIX_ORDER_ARGB = 10 } |
Functions | |
| static void | ADD_STR (std::string &list, const std::string &s) |
| static void | ADD_INT (std::string &list, int n) |
| bool | checkVersion (int major, int minor, int revision) |
| void | loadZMConfig (const std::string &configfile) |
| void | connectToDatabase (void) |
| void | kickDatabase (bool debug) |
Variables | |
| static constexpr int | MSG_NOSIGNAL { 0 } |
| static constexpr const char * | ZM_PROTOCOL_VERSION { "11" } |
| static constexpr const char * | ERROR_TOKEN_COUNT { "Invalid token count" } |
| static constexpr const char * | ERROR_MYSQL_QUERY { "Mysql Query Error" } |
| static constexpr const char * | ERROR_MYSQL_ROW { "Mysql Get Row Error" } |
| static constexpr const char * | ERROR_FILE_OPEN { "Cannot open event file" } |
| static constexpr const char * | ERROR_INVALID_MONITOR { "Invalid Monitor" } |
| static constexpr const char * | ERROR_INVALID_POINTERS { "Cannot get shared memory pointers" } |
| static constexpr const char * | ERROR_INVALID_MONITOR_FUNCTION { "Invalid Monitor Function" } |
| static constexpr const char * | ERROR_INVALID_MONITOR_ENABLE_VALUE { "Invalid Monitor Enable Value" } |
| static constexpr const char * | ERROR_NO_FRAMES { "No frames found for event" } |
| MYSQL | g_dbConn |
| std::string | g_zmversion |
| std::string | g_password |
| std::string | g_server |
| std::string | g_database |
| std::string | g_webPath |
| std::string | g_user |
| std::string | g_webUser |
| std::string | g_binPath |
| std::string | g_mmapPath |
| std::string | g_eventsPath |
| int | g_majorVersion = 0 |
| int | g_minorVersion = 0 |
| int | g_revisionVersion = 0 |
| TimePoint | g_lastDBKick {} |
| using reconnect_t = my_bool |
Definition at line 178 of file zmserver.cpp.
| enum ZM_SUBPIX_ORDER : std::uint8_t |
| Enumerator | |
|---|---|
| ZM_SUBPIX_ORDER_NONE | |
| ZM_SUBPIX_ORDER_RGB | |
| ZM_SUBPIX_ORDER_BGR | |
| ZM_SUBPIX_ORDER_BGRA | |
| ZM_SUBPIX_ORDER_RGBA | |
| ZM_SUBPIX_ORDER_ABGR | |
| ZM_SUBPIX_ORDER_ARGB | |
Definition at line 74 of file zmserver.cpp.
|
inlinestatic |
Definition at line 57 of file zmserver.cpp.
Referenced by ZMServer::handleGetAlarmStates(), ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetCameraList(), ZMServer::handleGetEventDates(), ZMServer::handleGetEventFrame(), ZMServer::handleGetEventList(), ZMServer::handleGetFrameList(), ZMServer::handleGetLiveFrame(), ZMServer::handleGetMonitorList(), and ZMServer::handleGetMonitorStatus().
|
inlinestatic |
Definition at line 55 of file zmserver.cpp.
Referenced by ZMServer::handleDeleteEvent(), ZMServer::handleDeleteEventList(), ZMServer::handleGetAlarmStates(), ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetCameraList(), ZMServer::handleGetEventDates(), ZMServer::handleGetEventFrame(), ZMServer::handleGetEventList(), ZMServer::handleGetFrameList(), ZMServer::handleGetLiveFrame(), ZMServer::handleGetMonitorList(), ZMServer::handleGetMonitorStatus(), ZMServer::handleGetServerStatus(), ZMServer::handleHello(), ZMServer::handleRunZMAudit(), ZMServer::handleSetMonitorFunction(), and ZMServer::sendError().
| bool checkVersion | ( | int | major, |
| int | minor, | ||
| int | revision | ||
| ) |
Definition at line 102 of file zmserver.cpp.
Referenced by ZMServer::getMonitorList(), ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventFrame(), MONITOR::initMonitor(), MONITOR::isValid(), main(), and ZMServer::ZMServer().
| void connectToDatabase | ( | void | ) |
Definition at line 181 of file zmserver.cpp.
Referenced by kickDatabase(), and main().
| void kickDatabase | ( | bool | debug | ) |
Definition at line 206 of file zmserver.cpp.
Referenced by ZMServer::handleGetLiveFrame(), and main().
| void loadZMConfig | ( | const std::string & | configfile | ) |
Definition at line 109 of file zmserver.cpp.
Referenced by main().
|
staticconstexpr |
Definition at line 64 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), and ZMServer::handleGetEventFrame().
|
staticconstexpr |
Definition at line 65 of file zmserver.cpp.
Referenced by ZMServer::handleGetLiveFrame(), and ZMServer::handleSetMonitorFunction().
|
staticconstexpr |
Definition at line 68 of file zmserver.cpp.
Referenced by ZMServer::handleSetMonitorFunction().
|
staticconstexpr |
Definition at line 67 of file zmserver.cpp.
Referenced by ZMServer::handleSetMonitorFunction().
|
staticconstexpr |
Definition at line 66 of file zmserver.cpp.
Referenced by ZMServer::handleGetLiveFrame().
|
staticconstexpr |
Definition at line 62 of file zmserver.cpp.
Referenced by ZMServer::handleDeleteEvent(), ZMServer::handleDeleteEventList(), ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventDates(), ZMServer::handleGetEventList(), ZMServer::handleGetFrameList(), ZMServer::handleGetMonitorStatus(), ZMServer::handleSetMonitorFunction(), and ZMServer::zmcControl().
|
staticconstexpr |
Definition at line 63 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventDates(), ZMServer::handleGetEventList(), ZMServer::handleGetFrameList(), and ZMServer::handleGetMonitorStatus().
|
staticconstexpr |
Definition at line 69 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), and ZMServer::handleGetFrameList().
|
staticconstexpr |
Definition at line 61 of file zmserver.cpp.
Referenced by ZMServer::handleDeleteEvent(), ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventDates(), ZMServer::handleGetEventFrame(), ZMServer::handleGetEventList(), ZMServer::handleGetFrameList(), ZMServer::handleGetLiveFrame(), and ZMServer::handleSetMonitorFunction().
| std::string g_binPath |
Definition at line 92 of file zmserver.cpp.
Referenced by ZMServer::getMonitorStatus(), ZMServer::handleDeleteEvent(), ZMServer::handleGetServerStatus(), ZMServer::handleRunZMAudit(), ZMServer::handleSetMonitorFunction(), loadZMConfig(), ZMServer::zmaControl(), and ZMServer::zmcControl().
| std::string g_database |
Definition at line 88 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
| MYSQL g_dbConn |
Definition at line 84 of file zmserver.cpp.
Referenced by connectToDatabase(), ZMServer::getMonitorList(), ZMServer::getZMSetting(), ZMServer::handleDeleteEvent(), ZMServer::handleDeleteEventList(), ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventDates(), ZMServer::handleGetEventList(), ZMServer::handleGetFrameList(), ZMServer::handleGetMonitorStatus(), ZMServer::handleSetMonitorFunction(), kickDatabase(), main(), and ZMServer::zmcControl().
| std::string g_eventsPath |
Definition at line 94 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventFrame(), and loadZMConfig().
| TimePoint g_lastDBKick {} |
Definition at line 99 of file zmserver.cpp.
Referenced by kickDatabase().
| int g_majorVersion = 0 |
Definition at line 95 of file zmserver.cpp.
Referenced by checkVersion(), and main().
| int g_minorVersion = 0 |
Definition at line 96 of file zmserver.cpp.
Referenced by checkVersion(), and main().
| std::string g_mmapPath |
Definition at line 93 of file zmserver.cpp.
Referenced by loadZMConfig(), and ZMServer::ZMServer().
| std::string g_password |
Definition at line 86 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
| int g_revisionVersion = 0 |
Definition at line 97 of file zmserver.cpp.
Referenced by checkVersion(), and main().
| std::string g_server |
Definition at line 87 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
| std::string g_user |
Definition at line 90 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
| std::string g_webPath |
Definition at line 89 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventFrame(), ZMServer::handleGetServerStatus(), and loadZMConfig().
| std::string g_webUser |
Definition at line 91 of file zmserver.cpp.
Referenced by loadZMConfig().
| std::string g_zmversion |
Definition at line 85 of file zmserver.cpp.
Referenced by loadZMConfig(), and main().
|
staticconstexpr |
Definition at line 47 of file zmserver.cpp.
Referenced by ZMServer::send().
|
staticconstexpr |
Definition at line 53 of file zmserver.cpp.
Referenced by ZMServer::handleHello(), and ZMServer::ZMServer().