|
MythTV master
|
#include <algorithm>#include <array>#include <filesystem>#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 <utility>#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) |
| static uintmax_t | disk_usage_percent (const std::filesystem::space_info &space_info) |
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 166 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 62 of file zmserver.cpp.
|
inlinestatic |
Definition at line 45 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 43 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 90 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 169 of file zmserver.cpp.
Referenced by kickDatabase(), and main().
|
static |
Definition at line 733 of file zmserver.cpp.
Referenced by ZMServer::handleGetServerStatus().
| void kickDatabase | ( | bool | debug | ) |
Definition at line 194 of file zmserver.cpp.
Referenced by ZMServer::handleGetLiveFrame(), and main().
| void loadZMConfig | ( | const std::string & | configfile | ) |
Definition at line 97 of file zmserver.cpp.
Referenced by main().
|
staticconstexpr |
Definition at line 52 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), and ZMServer::handleGetEventFrame().
|
staticconstexpr |
Definition at line 53 of file zmserver.cpp.
Referenced by ZMServer::handleGetLiveFrame(), and ZMServer::handleSetMonitorFunction().
|
staticconstexpr |
Definition at line 56 of file zmserver.cpp.
Referenced by ZMServer::handleSetMonitorFunction().
|
staticconstexpr |
Definition at line 55 of file zmserver.cpp.
Referenced by ZMServer::handleSetMonitorFunction().
|
staticconstexpr |
Definition at line 54 of file zmserver.cpp.
Referenced by ZMServer::handleGetLiveFrame().
|
staticconstexpr |
Definition at line 50 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 51 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventDates(), ZMServer::handleGetEventList(), ZMServer::handleGetFrameList(), and ZMServer::handleGetMonitorStatus().
|
staticconstexpr |
Definition at line 57 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), and ZMServer::handleGetFrameList().
|
staticconstexpr |
Definition at line 49 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 80 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 76 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
| MYSQL g_dbConn |
Definition at line 72 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 82 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventFrame(), and loadZMConfig().
| TimePoint g_lastDBKick {} |
Definition at line 87 of file zmserver.cpp.
Referenced by kickDatabase().
| int g_majorVersion = 0 |
Definition at line 83 of file zmserver.cpp.
Referenced by checkVersion(), and main().
| int g_minorVersion = 0 |
Definition at line 84 of file zmserver.cpp.
Referenced by checkVersion(), and main().
| std::string g_mmapPath |
Definition at line 81 of file zmserver.cpp.
Referenced by loadZMConfig(), and ZMServer::ZMServer().
| std::string g_password |
Definition at line 74 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
| int g_revisionVersion = 0 |
Definition at line 85 of file zmserver.cpp.
Referenced by checkVersion(), and main().
| std::string g_server |
Definition at line 75 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
| std::string g_user |
Definition at line 78 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
| std::string g_webPath |
Definition at line 77 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventFrame(), ZMServer::handleGetServerStatus(), and loadZMConfig().
| std::string g_webUser |
Definition at line 79 of file zmserver.cpp.
Referenced by loadZMConfig().
| std::string g_zmversion |
Definition at line 73 of file zmserver.cpp.
Referenced by loadZMConfig(), and main().
|
staticconstexpr |
Definition at line 35 of file zmserver.cpp.
Referenced by ZMServer::send().
|
staticconstexpr |
Definition at line 41 of file zmserver.cpp.
Referenced by ZMServer::handleHello(), and ZMServer::ZMServer().