MythTV  master
Typedefs | Enumerations | Functions | Variables
zmserver.cpp File Reference
#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"
Include dependency graph for zmserver.cpp:

Go to the source code of this file.

Typedefs

using reconnect_t = my_bool
 

Enumerations

enum  ZM_SUBPIX_ORDER {
  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 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 {}
 

Typedef Documentation

◆ reconnect_t

using reconnect_t = my_bool

Definition at line 178 of file zmserver.cpp.

Enumeration Type Documentation

◆ ZM_SUBPIX_ORDER

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.

Function Documentation

◆ ADD_STR()

static void ADD_STR ( std::string &  list,
const std::string &  s 
)
inlinestatic

◆ ADD_INT()

static void ADD_INT ( std::string &  list,
int  n 
)
inlinestatic

◆ checkVersion()

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

◆ loadZMConfig()

void loadZMConfig ( const std::string &  configfile)

Definition at line 109 of file zmserver.cpp.

Referenced by main().

◆ connectToDatabase()

void connectToDatabase ( void  )

Definition at line 181 of file zmserver.cpp.

Referenced by kickDatabase(), and main().

◆ kickDatabase()

void kickDatabase ( bool  debug)

Definition at line 206 of file zmserver.cpp.

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

Variable Documentation

◆ ZM_PROTOCOL_VERSION

constexpr const char* ZM_PROTOCOL_VERSION { "11" }
staticconstexpr

Definition at line 53 of file zmserver.cpp.

Referenced by ZMServer::handleHello(), and ZMServer::ZMServer().

◆ ERROR_TOKEN_COUNT

constexpr const char* ERROR_TOKEN_COUNT { "Invalid token count" }
staticconstexpr

◆ ERROR_MYSQL_QUERY

constexpr const char* ERROR_MYSQL_QUERY { "Mysql Query Error" }
staticconstexpr

◆ ERROR_MYSQL_ROW

constexpr const char* ERROR_MYSQL_ROW { "Mysql Get Row Error" }
staticconstexpr

◆ ERROR_FILE_OPEN

constexpr const char* ERROR_FILE_OPEN { "Cannot open event file" }
staticconstexpr

Definition at line 64 of file zmserver.cpp.

Referenced by ZMServer::handleGetAnalysisFrame(), and ZMServer::handleGetEventFrame().

◆ ERROR_INVALID_MONITOR

constexpr const char* ERROR_INVALID_MONITOR { "Invalid Monitor" }
staticconstexpr

◆ ERROR_INVALID_POINTERS

constexpr const char* ERROR_INVALID_POINTERS { "Cannot get shared memory pointers" }
staticconstexpr

Definition at line 66 of file zmserver.cpp.

Referenced by ZMServer::handleGetLiveFrame().

◆ ERROR_INVALID_MONITOR_FUNCTION

constexpr const char* ERROR_INVALID_MONITOR_FUNCTION { "Invalid Monitor Function" }
staticconstexpr

Definition at line 67 of file zmserver.cpp.

Referenced by ZMServer::handleSetMonitorFunction().

◆ ERROR_INVALID_MONITOR_ENABLE_VALUE

constexpr const char* ERROR_INVALID_MONITOR_ENABLE_VALUE { "Invalid Monitor Enable Value" }
staticconstexpr

Definition at line 68 of file zmserver.cpp.

Referenced by ZMServer::handleSetMonitorFunction().

◆ ERROR_NO_FRAMES

constexpr const char* ERROR_NO_FRAMES { "No frames found for event" }
staticconstexpr

Definition at line 69 of file zmserver.cpp.

Referenced by ZMServer::handleGetAnalysisFrame(), and ZMServer::handleGetFrameList().

◆ g_dbConn

MYSQL g_dbConn

◆ g_zmversion

std::string g_zmversion

Definition at line 85 of file zmserver.cpp.

Referenced by loadZMConfig(), and main().

◆ g_password

std::string g_password

Definition at line 86 of file zmserver.cpp.

Referenced by connectToDatabase(), and loadZMConfig().

◆ g_server

std::string g_server

Definition at line 87 of file zmserver.cpp.

Referenced by connectToDatabase(), and loadZMConfig().

◆ g_database

std::string g_database

Definition at line 88 of file zmserver.cpp.

Referenced by connectToDatabase(), and loadZMConfig().

◆ g_webPath

std::string g_webPath

◆ g_user

std::string g_user

Definition at line 90 of file zmserver.cpp.

Referenced by connectToDatabase(), and loadZMConfig().

◆ g_webUser

std::string g_webUser

Definition at line 91 of file zmserver.cpp.

Referenced by loadZMConfig().

◆ g_binPath

std::string g_binPath

◆ g_mmapPath

std::string g_mmapPath

Definition at line 93 of file zmserver.cpp.

Referenced by loadZMConfig(), and ZMServer::ZMServer().

◆ g_eventsPath

std::string g_eventsPath

◆ g_majorVersion

int g_majorVersion = 0

Definition at line 95 of file zmserver.cpp.

Referenced by checkVersion(), and main().

◆ g_minorVersion

int g_minorVersion = 0

Definition at line 96 of file zmserver.cpp.

Referenced by checkVersion(), and main().

◆ g_revisionVersion

int g_revisionVersion = 0

Definition at line 97 of file zmserver.cpp.

Referenced by checkVersion(), and main().

◆ g_lastDBKick

TimePoint g_lastDBKick {}

Definition at line 99 of file zmserver.cpp.

Referenced by kickDatabase().