MythTV  master
Classes | Macros | Typedefs | Enumerations | Functions | Variables
zmserver.h File Reference
#include <chrono>
#include <cstdint>
#include <map>
#include <mysql/mysql.h>
#include <sstream>
#include <string>
#include <unistd.h>
#include <vector>
Include dependency graph for zmserver.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SharedData
 
struct  SharedData26
 
struct  SharedData32
 
struct  SharedData34
 
struct  TriggerData
 
struct  TriggerData26
 
struct  VideoStoreData
 
class  MONITOR
 
class  ZMServer
 

Macros

#define MAX_IMAGE_SIZE   (2048*1536*3)
 

Typedefs

using Clock = std::chrono::system_clock
 
using TimePoint = std::chrono::time_point< Clock >
 
using FrameData = std::array< uint8_t, MAX_IMAGE_SIZE >
 

Enumerations

enum  State {
  IDLE, PREALARM, ALARM, ALERT,
  TAPE, IDLE, PREALARM, ALARM,
  ALERT, TAPE
}
 
enum  TriggerState { TRIGGER_CANCEL, TRIGGER_ON, TRIGGER_OFF }
 

Functions

bool checkVersion (int major, int minor, int revision)
 
void loadZMConfig (const std::string &configfile)
 
void connectToDatabase (void)
 
void kickDatabase (bool debug)
 

Variables

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
 
int g_majorVersion
 
int g_minorVersion
 
int g_revisionVersion
 
static constexpr std::chrono::seconds DB_CHECK_TIME { 60s }
 
TimePoint g_lastDBKick
 
const std::string FUNCTION_MONITOR = "Monitor"
 
const std::string FUNCTION_MODECT = "Modect"
 
const std::string FUNCTION_NODECT = "Nodect"
 
const std::string FUNCTION_RECORD = "Record"
 
const std::string FUNCTION_MOCORD = "Mocord"
 
const std::string FUNCTION_NONE = "None"
 
const std::string RESTART = "restart"
 
const std::string RELOAD = "reload"
 
const std::string RUNNING = "running"
 

Macro Definition Documentation

◆ MAX_IMAGE_SIZE

#define MAX_IMAGE_SIZE   (2048*1536*3)

Definition at line 32 of file zmserver.h.

Typedef Documentation

◆ Clock

using Clock = std::chrono::system_clock

Definition at line 28 of file zmserver.h.

◆ TimePoint

using TimePoint = std::chrono::time_point<Clock>

Definition at line 29 of file zmserver.h.

◆ FrameData

using FrameData = std::array<uint8_t,MAX_IMAGE_SIZE>

Definition at line 33 of file zmserver.h.

Enumeration Type Documentation

◆ State

enum State
Enumerator
IDLE 
PREALARM 
ALARM 
ALERT 
TAPE 
IDLE 
PREALARM 
ALARM 
ALERT 
TAPE 

Definition at line 68 of file zmserver.h.

◆ TriggerState

Enumerator
TRIGGER_CANCEL 
TRIGGER_ON 
TRIGGER_OFF 

Definition at line 223 of file zmserver.h.

Function Documentation

◆ checkVersion()

bool checkVersion ( int  major,
int  minor,
int  revision 
)

◆ loadZMConfig()

void loadZMConfig ( const std::string &  configfile)

Definition at line 104 of file zmserver.cpp.

Referenced by main().

◆ connectToDatabase()

void connectToDatabase ( void  )

Definition at line 176 of file zmserver.cpp.

Referenced by kickDatabase(), and main().

◆ kickDatabase()

void kickDatabase ( bool  debug)

Definition at line 201 of file zmserver.cpp.

Referenced by ZMServer::handleGetLiveFrame(), and main().

Variable Documentation

◆ g_dbConn

MYSQL g_dbConn

◆ g_zmversion

std::string g_zmversion

Definition at line 80 of file zmserver.cpp.

Referenced by loadZMConfig(), and main().

◆ g_password

std::string g_password

Definition at line 81 of file zmserver.cpp.

Referenced by connectToDatabase(), and loadZMConfig().

◆ g_server

std::string g_server

Definition at line 82 of file zmserver.cpp.

Referenced by connectToDatabase(), and loadZMConfig().

◆ g_database

std::string g_database

Definition at line 83 of file zmserver.cpp.

Referenced by connectToDatabase(), and loadZMConfig().

◆ g_webPath

std::string g_webPath

◆ g_user

std::string g_user

Definition at line 85 of file zmserver.cpp.

Referenced by connectToDatabase(), and loadZMConfig().

◆ g_webUser

std::string g_webUser

Definition at line 86 of file zmserver.cpp.

Referenced by loadZMConfig().

◆ g_binPath

std::string g_binPath

◆ g_majorVersion

int g_majorVersion

Definition at line 90 of file zmserver.cpp.

Referenced by checkVersion(), and main().

◆ g_minorVersion

int g_minorVersion

Definition at line 91 of file zmserver.cpp.

Referenced by checkVersion(), and main().

◆ g_revisionVersion

int g_revisionVersion

Definition at line 92 of file zmserver.cpp.

Referenced by checkVersion(), and main().

◆ DB_CHECK_TIME

constexpr std::chrono::seconds DB_CHECK_TIME { 60s }
staticconstexpr

Definition at line 54 of file zmserver.h.

Referenced by kickDatabase(), and main().

◆ g_lastDBKick

TimePoint g_lastDBKick

Definition at line 94 of file zmserver.cpp.

Referenced by kickDatabase().

◆ FUNCTION_MONITOR

const std::string FUNCTION_MONITOR = "Monitor"

Definition at line 57 of file zmserver.h.

Referenced by ZMServer::handleSetMonitorFunction().

◆ FUNCTION_MODECT

const std::string FUNCTION_MODECT = "Modect"

Definition at line 58 of file zmserver.h.

Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().

◆ FUNCTION_NODECT

const std::string FUNCTION_NODECT = "Nodect"

Definition at line 59 of file zmserver.h.

Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().

◆ FUNCTION_RECORD

const std::string FUNCTION_RECORD = "Record"

Definition at line 60 of file zmserver.h.

Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().

◆ FUNCTION_MOCORD

const std::string FUNCTION_MOCORD = "Mocord"

Definition at line 61 of file zmserver.h.

Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().

◆ FUNCTION_NONE

const std::string FUNCTION_NONE = "None"

Definition at line 62 of file zmserver.h.

Referenced by ZMServer::handleSetMonitorFunction().

◆ RESTART

const std::string RESTART = "restart"

◆ RELOAD

const std::string RELOAD = "reload"

Definition at line 65 of file zmserver.h.

Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().

◆ RUNNING

const std::string RUNNING = "running"

Definition at line 66 of file zmserver.h.

Referenced by ZMServer::handleSetMonitorFunction().