Merge pull request #3127 from Carbenium/header-cleanup

Cleanup and reorganize includes
This commit is contained in:
Isaac Connor 2021-02-04 12:52:04 -05:00 committed by GitHub
commit 513739aeb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
125 changed files with 436 additions and 684 deletions

View File

@ -682,7 +682,7 @@ if(NOT ZM_NO_RTSPSERVER)
set(optlibsfound "${optlibsfound} libLive555") set(optlibsfound "${optlibsfound} libLive555")
else(Live555_FOUND) else(Live555_FOUND)
set(HAVE_RTSP_SERVER 0) set(HAVE_RTSP_SERVER 0)
set(optlibsfound "${optlibsnotfound} libLive555") set(optlibsnotfound "${optlibsnotfound} libLive555")
endif(Live555_FOUND) endif(Live555_FOUND)
else(NOT ZM_NO_RTSPSERVER) else(NOT ZM_NO_RTSPSERVER)
set(HAVE_RTSP_SERVER 0) set(HAVE_RTSP_SERVER 0)

View File

@ -21,18 +21,6 @@
#ifndef ZM_H #ifndef ZM_H
#define ZM_H #define ZM_H
#include "zm_define.h"
#include "zm_config.h"
#include "zm_signal.h"
#ifdef SOLARIS
#undef DEFAULT_TYPE // pthread defines this which breaks StreamType DEFAULT_TYPE
#include <string.h> // define strerror() and friends
#endif
#include "zm_logger.h"
#include <iostream>
extern const char *self; extern const char *self;
#endif // ZM_H #endif // ZM_H

View File

@ -1,9 +1,10 @@
#include "zm_analysis_thread.h" #include "zm_analysis_thread.h"
#include "zm_signal.h"
AnalysisThread::AnalysisThread(Monitor *p_monitor) { AnalysisThread::AnalysisThread(Monitor *p_monitor) {
monitor = p_monitor; monitor = p_monitor;
terminate = false; terminate = false;
//sigemptyset(&block_set);
} }
AnalysisThread::~AnalysisThread() { AnalysisThread::~AnalysisThread() {

View File

@ -1,15 +1,12 @@
#ifndef ZM_ANALYSIS_THREAD_H #ifndef ZM_ANALYSIS_THREAD_H
#define ZM_ANALYSIS_THREAD_H #define ZM_ANALYSIS_THREAD_H
#include "zm_thread.h"
#include <signal.h>
#include "zm_monitor.h" #include "zm_monitor.h"
#include "zm_thread.h"
class AnalysisThread : public Thread { class AnalysisThread : public Thread {
private: private:
bool terminate; bool terminate;
sigset_t block_set;
Monitor *monitor; Monitor *monitor;
public: public:

View File

@ -17,7 +17,6 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#include "zm_box.h" #include "zm_box.h"
// This section deliberately left blank // This section deliberately left blank

View File

@ -20,14 +20,8 @@
#ifndef ZM_BOX_H #ifndef ZM_BOX_H
#define ZM_BOX_H #define ZM_BOX_H
#include "zm.h"
#include "zm_coord.h" #include "zm_coord.h"
#ifndef SOLARIS
#include <math.h>
#else
#include <cmath> #include <cmath>
#endif
// //
// Class used for storing a box, which is defined as a region // Class used for storing a box, which is defined as a region
@ -61,8 +55,8 @@ public:
inline int Area() const { return size.X()*size.Y(); } inline int Area() const { return size.X()*size.Y(); }
inline const Coord Centre() const { inline const Coord Centre() const {
int mid_x = int(round(lo.X()+(size.X()/2.0))); int mid_x = int(std::round(lo.X()+(size.X()/2.0)));
int mid_y = int(round(lo.Y()+(size.Y()/2.0))); int mid_y = int(std::round(lo.Y()+(size.Y()/2.0)));
return Coord( mid_x, mid_y ); return Coord( mid_x, mid_y );
} }
inline bool Inside( const Coord &coord ) const inline bool Inside( const Coord &coord ) const

View File

@ -17,7 +17,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "zm.h"
#include "zm_buffer.h" #include "zm_buffer.h"
unsigned int Buffer::assign(const unsigned char *pStorage, unsigned int pSize) { unsigned int Buffer::assign(const unsigned char *pStorage, unsigned int pSize) {

View File

@ -20,9 +20,8 @@
#ifndef ZM_BUFFER_H #ifndef ZM_BUFFER_H
#define ZM_BUFFER_H #define ZM_BUFFER_H
#include "zm.h" #include "zm_logger.h"
#include <cstring>
#include <string.h>
class Buffer class Buffer
{ {
@ -42,12 +41,12 @@ public:
} }
Buffer(const unsigned char *pStorage, unsigned int pSize) : mAllocation(pSize), mSize(pSize) { Buffer(const unsigned char *pStorage, unsigned int pSize) : mAllocation(pSize), mSize(pSize) {
mHead = mStorage = new unsigned char[mSize]; mHead = mStorage = new unsigned char[mSize];
memcpy(mStorage, pStorage, mSize); std::memcpy(mStorage, pStorage, mSize);
mTail = mHead + mSize; mTail = mHead + mSize;
} }
Buffer(const Buffer &buffer) : mAllocation(buffer.mSize), mSize(buffer.mSize) { Buffer(const Buffer &buffer) : mAllocation(buffer.mSize), mSize(buffer.mSize) {
mHead = mStorage = new unsigned char[mSize]; mHead = mStorage = new unsigned char[mSize];
memcpy(mStorage, buffer.mHead, mSize); std::memcpy(mStorage, buffer.mHead, mSize);
mTail = mHead + mSize; mTail = mHead + mSize;
} }
~Buffer() { ~Buffer() {
@ -116,7 +115,7 @@ public:
// Add bytes to the end of the buffer // Add bytes to the end of the buffer
unsigned int append(const unsigned char *pStorage, unsigned int pSize) { unsigned int append(const unsigned char *pStorage, unsigned int pSize) {
expand(pSize); expand(pSize);
memcpy(mTail, pStorage, pSize); std::memcpy(mTail, pStorage, pSize);
mTail += pSize; mTail += pSize;
mSize += pSize; mSize += pSize;
return mSize; return mSize;
@ -133,7 +132,7 @@ public:
mHead = mTail = mStorage; mHead = mTail = mStorage;
else if ( level ) { else if ( level ) {
if ( ((uintptr_t)mHead-(uintptr_t)mStorage) > mSize ) { if ( ((uintptr_t)mHead-(uintptr_t)mStorage) > mSize ) {
memcpy( mStorage, mHead, mSize ); std::memcpy( mStorage, mHead, mSize );
mHead = mStorage; mHead = mStorage;
mTail = mHead + mSize; mTail = mHead + mSize;
} }

View File

@ -17,9 +17,10 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#include "zm_camera.h" #include "zm_camera.h"
#include "zm_monitor.h"
Camera::Camera( Camera::Camera(
unsigned int p_monitor_id, unsigned int p_monitor_id,
SourceType p_type, SourceType p_type,

View File

@ -20,15 +20,12 @@
#ifndef ZM_CAMERA_H #ifndef ZM_CAMERA_H
#define ZM_CAMERA_H #define ZM_CAMERA_H
#include <sys/types.h>
#include <sys/ioctl.h>
#include "zm_image.h" #include "zm_image.h"
#include "zm_packet.h" #include <sys/ioctl.h>
#include <sys/types.h>
class Camera; class Monitor;
class ZMPacket;
#include "zm_monitor.h"
// //
// Abstract base class for cameras. This is intended just to express // Abstract base class for cameras. This is intended just to express

View File

@ -18,24 +18,17 @@
// //
#include "zm_comms.h" #include "zm_comms.h"
#include "zm_logger.h" #include "zm_logger.h"
#include <arpa/inet.h> // for debug output
#include <errno.h> #include <cerrno>
#include <cstdarg>
#include <cstdio> // for snprintf
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h> #include <netinet/tcp.h>
#include <utility>
#if defined(BSD)
#include <stdlib.h>
#else
#include <alloca.h>
#endif
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/param.h> #include <sys/param.h>
#include <netinet/tcp.h> #include <utility>
#include <arpa/inet.h> // for debug output
#include <stdio.h> // for snprintf
#ifdef SOLARIS #ifdef SOLARIS
#include <sys/filio.h> // define FIONREAD #include <sys/filio.h> // define FIONREAD

View File

@ -20,18 +20,13 @@
#ifndef ZM_COMMS_H #ifndef ZM_COMMS_H
#define ZM_COMMS_H #define ZM_COMMS_H
#include "zm_logger.h"
#include "zm_exception.h" #include "zm_exception.h"
#include "zm_logger.h"
#include <string.h>
#include <unistd.h>
#include <netdb.h> #include <netdb.h>
#include <errno.h>
#include <sys/un.h>
#include <set> #include <set>
#include <vector>
#include <sys/uio.h> #include <sys/uio.h>
#include <sys/un.h>
#include <vector>
#if defined(BSD) #if defined(BSD)
#include <sys/socket.h> #include <sys/socket.h>

View File

@ -17,19 +17,15 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h" #include "zm_config.h"
#include "zm_db.h"
#include <stdio.h> #include "zm_db.h"
#include <stdlib.h> #include "zm_logger.h"
#include <string.h> #include "zm_utils.h"
#include <errno.h> #include <cstring>
#include <dirent.h> #include <dirent.h>
#include <glob.h> #include <glob.h>
#include "zm_utils.h"
#include "zm_config.h"
// Note that Error and Debug calls won't actually go anywhere unless you // Note that Error and Debug calls won't actually go anywhere unless you
// set the relevant ENV vars because the logger gets it's setting from the // set the relevant ENV vars because the logger gets it's setting from the
// config. // config.

View File

@ -20,16 +20,15 @@
#ifndef ZM_CONFIG_H #ifndef ZM_CONFIG_H
#define ZM_CONFIG_H #define ZM_CONFIG_H
#include "config.h"
#include "zm_config_data.h"
#include "zm_config_defines.h"
#include <string>
#if !defined(PATH_MAX) #if !defined(PATH_MAX)
#define PATH_MAX 1024 #define PATH_MAX 1024
#endif #endif
#include "config.h"
#include "zm_config_defines.h"
#include "zm_config_data.h"
#include <string>
#ifdef HAVE_LIBAVFORMAT #ifdef HAVE_LIBAVFORMAT
#define ZM_HAS_FFMPEG 1 #define ZM_HAS_FFMPEG 1
#endif // HAVE_LIBAVFORMAT #endif // HAVE_LIBAVFORMAT

View File

@ -17,7 +17,6 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#include "zm_coord.h" #include "zm_coord.h"
// This section deliberately left blank // This section deliberately left blank

View File

@ -20,7 +20,7 @@
#ifndef ZM_COORD_H #ifndef ZM_COORD_H
#define ZM_COORD_H #define ZM_COORD_H
#include "zm.h" #include "zm_define.h"
// //
// Class used for storing an x,y pair, i.e. a coordinate // Class used for storing an x,y pair, i.e. a coordinate

View File

@ -1,19 +1,21 @@
#include "zm.h"
#include "zm_crypt.h" #include "zm_crypt.h"
#include "zm_logger.h"
#include "BCrypt.hpp" #include "BCrypt.hpp"
#include <algorithm>
#if HAVE_LIBJWT #if HAVE_LIBJWT
#include <jwt.h> #include <jwt.h>
#else #else
#include "jwt_cpp.h" #include "jwt_cpp.h"
#endif #endif
#include <algorithm>
#if HAVE_LIBCRYPTO #if HAVE_LIBCRYPTO
#include <openssl/sha.h> #include <openssl/sha.h>
#elif HAVE_GNUTLS_GNUTLS_H #elif HAVE_GNUTLS_GNUTLS_H
#include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
#include <gnutls/crypto.h> #include <gnutls/crypto.h>
#endif #endif
#include <string.h>
// returns username if valid, "" if not // returns username if valid, "" if not
#if HAVE_LIBJWT #if HAVE_LIBJWT

View File

@ -20,10 +20,8 @@
#ifndef ZM_CRYPT_H #ifndef ZM_CRYPT_H
#define ZM_CRYPT_H #define ZM_CRYPT_H
#include <string>
#include <string.h> #include <utility>
bool verifyPassword( const char *username, const char *input_password, const char *db_password_hash); bool verifyPassword( const char *username, const char *input_password, const char *db_password_hash);

View File

@ -17,12 +17,10 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include <dlfcn.h>
#include "zm.h"
#include "zm_curl_camera.h" #include "zm_curl_camera.h"
#include "zm_packetqueue.h" #include "zm_packet.h"
#include <dlfcn.h>
#if HAVE_LIBCURL #if HAVE_LIBCURL

View File

@ -20,16 +20,13 @@
#ifndef ZM_CURL_CAMERA_H #ifndef ZM_CURL_CAMERA_H
#define ZM_CURL_CAMERA_H #define ZM_CURL_CAMERA_H
#if HAVE_LIBCURL #include "zm_config.h"
#include "zm_camera.h"
#include "zm_ffmpeg.h"
#include "zm_buffer.h" #include "zm_buffer.h"
#include "zm_regexp.h" #include "zm_camera.h"
#include "zm_utils.h"
#include "zm_signal.h"
#include <string>
#include <deque> #include <deque>
#include <string>
#if HAVE_LIBCURL
#if HAVE_CURL_CURL_H #if HAVE_CURL_CURL_H
#include <curl/curl.h> #include <curl/curl.h>

View File

@ -16,13 +16,11 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include <stdlib.h>
#include <string.h>
#include "zm.h"
#include "zm_db.h" #include "zm_db.h"
#include "zm_logger.h"
#include <cstdlib>
MYSQL dbconn; MYSQL dbconn;
RecursiveMutex db_mutex; RecursiveMutex db_mutex;

View File

@ -20,8 +20,8 @@
#ifndef ZM_DB_H #ifndef ZM_DB_H
#define ZM_DB_H #define ZM_DB_H
#include <mysql/mysql.h>
#include "zm_thread.h" #include "zm_thread.h"
#include <mysql/mysql.h>
class zmDbRow { class zmDbRow {
private: private:

View File

@ -17,23 +17,17 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include <fcntl.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/un.h>
#include <sys/uio.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <getopt.h>
#include <arpa/inet.h>
#include <glob.h>
#include "zm.h"
#include "zm_db.h"
#include "zm_time.h"
#include "zm_signal.h"
#include "zm_event.h" #include "zm_event.h"
#include "zm_camera.h"
#include "zm_db.h"
#include "zm_frame.h"
#include "zm_logger.h"
#include "zm_monitor.h" #include "zm_monitor.h"
#include "zm_signal.h"
#include "zm_videostore.h"
#include <cstring>
#include <sys/stat.h>
//#define USE_PREPARED_SQL 1 //#define USE_PREPARED_SQL 1

View File

@ -20,39 +20,23 @@
#ifndef ZM_EVENT_H #ifndef ZM_EVENT_H
#define ZM_EVENT_H #define ZM_EVENT_H
#include <stdlib.h> #include "zm_storage.h"
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <mysql/mysql.h>
#include <set>
#include <map> #include <map>
#include <queue> #include <queue>
#include <string> #include <set>
#include "zm.h"
#include "zm_image.h"
#include "zm_stream.h"
#include "zm_packet.h"
#include "zm_storage.h"
class VideoStore;
class Zone;
class Monitor;
class EventStream; class EventStream;
class Frame;
class Image;
class Monitor;
class VideoStore;
class ZMPacket;
class Zone;
// Maximum number of prealarm frames that can be stored // Maximum number of prealarm frames that can be stored
#define MAX_PRE_ALARM_FRAMES 16 #define MAX_PRE_ALARM_FRAMES 16
typedef uint64_t event_id_t;
typedef enum { NORMAL=0, BULK, ALARM } FrameType;
#include "zm_frame.h" typedef uint64_t event_id_t;
// //
// Class describing events, i.e. captured periods of activity. // Class describing events, i.e. captured periods of activity.

View File

@ -17,18 +17,16 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
// //
#include <arpa/inet.h>
#include "zm.h"
#include "zm_db.h"
#include "zm_time.h"
#include "zm_mpeg.h"
#include "zm_event.h"
#include "zm_eventstream.h" #include "zm_eventstream.h"
#include "zm_storage.h"
#include "zm_monitor.h"
#include "zm_db.h"
#include "zm_image.h"
#include "zm_logger.h"
#include "zm_sendfile.h" #include "zm_sendfile.h"
#include "zm_signal.h"
#include "zm_storage.h"
#include <arpa/inet.h>
#include <sys/stat.h>
const std::string EventStream::StreamMode_Strings[4] = { const std::string EventStream::StreamMode_Strings[4] = {
"None", "None",

View File

@ -20,9 +20,7 @@
#ifndef ZM_EVENTSTREAM_H #ifndef ZM_EVENTSTREAM_H
#define ZM_EVENTSTREAM_H #define ZM_EVENTSTREAM_H
#include "zm_image.h"
#include "zm_stream.h" #include "zm_stream.h"
#include "zm_video.h"
#include "zm_ffmpeg_input.h" #include "zm_ffmpeg_input.h"
#include "zm_monitor.h" #include "zm_monitor.h"
#include "zm_storage.h" #include "zm_storage.h"
@ -37,7 +35,6 @@ extern "C" {
} }
#endif #endif
class EventStream : public StreamBase { class EventStream : public StreamBase {
public: public:
typedef enum { MODE_NONE, MODE_SINGLE, MODE_ALL, MODE_ALL_GAPLESS } StreamMode; typedef enum { MODE_NONE, MODE_SINGLE, MODE_ALL, MODE_ALL_GAPLESS } StreamMode;

View File

@ -18,8 +18,10 @@
*/ */
#include "zm_ffmpeg.h" #include "zm_ffmpeg.h"
#include "zm_image.h"
#include "zm_logger.h"
#include "zm_rgb.h" #include "zm_rgb.h"
extern "C" { extern "C" {
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
} }

View File

@ -17,14 +17,14 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h" #include "zm_ffmpeg_camera.h"
#include "zm_packet.h"
#include "zm_signal.h" #include "zm_signal.h"
#include "zm_utils.h" #include "zm_utils.h"
#if HAVE_LIBAVFORMAT #if HAVE_LIBAVFORMAT
#include "zm_ffmpeg_camera.h"
extern "C" { extern "C" {
#include "libavutil/time.h" #include "libavutil/time.h"
#if HAVE_LIBAVUTIL_HWCONTEXT_H #if HAVE_LIBAVUTIL_HWCONTEXT_H
@ -35,7 +35,6 @@ extern "C" {
} }
#include <string> #include <string>
#include <locale>
#if HAVE_LIBAVUTIL_HWCONTEXT_H #if HAVE_LIBAVUTIL_HWCONTEXT_H
#if LIBAVCODEC_VERSION_CHECK(57, 89, 0, 89, 0) #if LIBAVCODEC_VERSION_CHECK(57, 89, 0, 89, 0)

View File

@ -22,10 +22,6 @@
#include "zm_camera.h" #include "zm_camera.h"
#include "zm_buffer.h"
#include "zm_ffmpeg.h"
#include "zm_videostore.h"
#if HAVE_LIBAVUTIL_HWCONTEXT_H #if HAVE_LIBAVUTIL_HWCONTEXT_H
typedef struct DecodeContext { typedef struct DecodeContext {
AVBufferRef *hw_device_ref; AVBufferRef *hw_device_ref;

View File

@ -1,7 +1,7 @@
#include "zm_ffmpeg_input.h" #include "zm_ffmpeg_input.h"
#include "zm_logger.h"
#include "zm_ffmpeg.h" #include "zm_ffmpeg.h"
#include "zm_logger.h"
FFmpeg_Input::FFmpeg_Input() { FFmpeg_Input::FFmpeg_Input() {
input_format_context = nullptr; input_format_context = nullptr;

View File

@ -17,17 +17,14 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm_fifo.h"
#include "zm_monitor.h"
#include "zm_signal.h"
#include <fcntl.h> #include <fcntl.h>
#include <sys/file.h> #include <sys/file.h>
#include <stdio.h> #include <sys/stat.h>
#include <stdarg.h>
#include <signal.h>
#include "zm.h"
#include "zm_time.h"
#include "zm_signal.h"
#include "zm_monitor.h"
#include "zm_fifo.h"
#define RAW_BUFFER 512 #define RAW_BUFFER 512
static bool zm_fifodbg_inited = false; static bool zm_fifodbg_inited = false;
FILE *zm_fifodbg_log_fd = nullptr; FILE *zm_fifodbg_log_fd = nullptr;

View File

@ -19,23 +19,10 @@
#ifndef ZM_FIFO_H #ifndef ZM_FIFO_H
#define ZM_FIFO_H #define ZM_FIFO_H
#if 0
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "zm.h"
#include "zm_image.h"
#endif
#include "zm_monitor.h"
#include "zm_stream.h" #include "zm_stream.h"
class Monitor;
#define zmFifoDbgPrintf(level, params...) {\ #define zmFifoDbgPrintf(level, params...) {\
zmFifoDbgOutput(0, __FILE__, __LINE__, level, ##params);\ zmFifoDbgOutput(0, __FILE__, __LINE__, level, ##params);\
} }

View File

@ -17,19 +17,11 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include "zm.h"
#include "zm_file_camera.h" #include "zm_file_camera.h"
#include "zm_packet.h"
#include <sys/stat.h>
FileCamera::FileCamera( FileCamera::FileCamera(
int p_id, int p_id,
const char *p_path, const char *p_path,

View File

@ -21,11 +21,6 @@
#define ZM_FILE_CAMERA_H #define ZM_FILE_CAMERA_H
#include "zm_camera.h" #include "zm_camera.h"
#include "zm_buffer.h"
#include "zm_regexp.h"
#include "zm_packet.h"
#include <sys/param.h>
// //
// Class representing 'file' cameras, i.e. those which are // Class representing 'file' cameras, i.e. those which are

View File

@ -1,10 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include "zm.h"
#include "zm_font.h" #include "zm_font.h"
#include "zm_utils.h"
#include <cstring>
#include <sys/stat.h>
int ZmFont::ReadFontFile(const std::string &loc) { int ZmFont::ReadFontFile(const std::string &loc) {
FILE *f = fopen(loc.c_str(), "rb"); FILE *f = fopen(loc.c_str(), "rb");

View File

@ -2,7 +2,6 @@
#define ZM_FONT_H #define ZM_FONT_H
#include "zm_define.h" #include "zm_define.h"
#include <string> #include <string>
#define NUM_FONT_SIZES 4 #define NUM_FONT_SIZES 4

View File

@ -20,12 +20,15 @@
#ifndef ZM_FRAME_H #ifndef ZM_FRAME_H
#define ZM_FRAME_H #define ZM_FRAME_H
#include <sys/time.h>
#include <sys/types.h>
class Frame;
#include "zm_event.h" #include "zm_event.h"
#include "zm_time.h" #include "zm_time.h"
#include <sys/time.h>
enum FrameType {
NORMAL = 0,
BULK,
ALARM
};
// //
// This describes a frame record // This describes a frame record

View File

@ -17,13 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "zm.h"
#include "zm_db.h"
#include "zm_group.h" #include "zm_group.h"
#include <string.h> #include "zm_logger.h"
#include <stdlib.h> #include <cstring>
Group::Group() { Group::Group() {
Warning("Instantiating default Group Object. Should not happen."); Warning("Instantiating default Group Object. Should not happen.");

View File

@ -17,11 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "zm_db.h"
#ifndef ZM_GROUP_H #ifndef ZM_GROUP_H
#define ZM_GROUP_H #define ZM_GROUP_H
#include "zm_db.h"
class Group { class Group {
protected: protected:

View File

@ -16,16 +16,14 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#include "zm_font.h"
#include "zm_image.h"
#include "zm_utils.h"
#include "zm_rgb.h"
#include "zm_ffmpeg.h"
#include "zm_image.h"
#include "zm_font.h"
#include "zm_poly.h"
#include "zm_utils.h"
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h>
static unsigned char y_table_global[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 100, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 112, 114, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125, 126, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 142, 143, 144, 145, 146, 147, 149, 150, 151, 152, 153, 154, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 170, 171, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 206, 207, 208, 209, 210, 211, 213, 214, 215, 216, 217, 218, 220, 221, 222, 223, 224, 225, 227, 228, 229, 230, 231, 232, 234, 235, 236, 237, 238, 239, 241, 242, 243, 244, 245, 246, 248, 249, 250, 251, 252, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}; static unsigned char y_table_global[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 100, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 112, 114, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125, 126, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 142, 143, 144, 145, 146, 147, 149, 150, 151, 152, 153, 154, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 170, 171, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 206, 207, 208, 209, 210, 211, 213, 214, 215, 216, 217, 218, 220, 221, 222, 223, 224, 225, 227, 228, 229, 230, 231, 232, 234, 235, 236, 237, 238, 239, 241, 242, 243, 244, 245, 246, 248, 249, 250, 251, 252, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255};

View File

@ -20,26 +20,21 @@
#ifndef ZM_IMAGE_H #ifndef ZM_IMAGE_H
#define ZM_IMAGE_H #define ZM_IMAGE_H
#include "zm.h"
extern "C" {
#include "zm_jpeg.h"
}
#include "zm_rgb.h"
#include "zm_coord.h" #include "zm_coord.h"
#include "zm_box.h"
#include "zm_poly.h"
#include "zm_mem_utils.h"
#include "zm_utils.h"
class Image;
#include "zm_ffmpeg.h" #include "zm_ffmpeg.h"
#include "zm_jpeg.h"
#include <errno.h> #include "zm_logger.h"
#include "zm_mem_utils.h"
#include "zm_rgb.h"
#if HAVE_ZLIB_H #if HAVE_ZLIB_H
#include <zlib.h> #include <zlib.h>
#endif // HAVE_ZLIB_H #endif // HAVE_ZLIB_H
class Box;
class Image;
class Polygon;
#define ZM_BUFTYPE_DONTFREE 0 #define ZM_BUFTYPE_DONTFREE 0
#define ZM_BUFTYPE_MALLOC 1 #define ZM_BUFTYPE_MALLOC 1
#define ZM_BUFTYPE_NEW 2 #define ZM_BUFTYPE_NEW 2

View File

@ -18,9 +18,8 @@
*/ */
#include "zm_jpeg.h" #include "zm_jpeg.h"
#include "zm_logger.h"
#include <unistd.h> #include "zm_logger.h"
/* Overridden error handlers, mostly for decompression */ /* Overridden error handlers, mostly for decompression */
extern "C" { extern "C" {

View File

@ -17,11 +17,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <setjmp.h> #include "jerror.h"
#include "jinclude.h" #include "jinclude.h"
#include "jpeglib.h" #include "jpeglib.h"
#include "jerror.h" #include <csetjmp>
// Stop complaints about deuplicate definitions // Stop complaints about deuplicate definitions
#undef HAVE_STDLIB_H #undef HAVE_STDLIB_H

View File

@ -17,11 +17,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <dlfcn.h>
#include "zm.h"
#include "zm_signal.h"
#include "zm_libvlc_camera.h" #include "zm_libvlc_camera.h"
#include "zm_packet.h"
#include "zm_signal.h"
#include "zm_utils.h"
#include <dlfcn.h>
#if HAVE_LIBVLC #if HAVE_LIBVLC
static void *libvlc_lib = nullptr; static void *libvlc_lib = nullptr;
static void (*libvlc_media_player_release_f)(libvlc_media_player_t* ) = nullptr; static void (*libvlc_media_player_release_f)(libvlc_media_player_t* ) = nullptr;

View File

@ -20,7 +20,6 @@
#ifndef ZM_LIBVLC_CAMERA_H #ifndef ZM_LIBVLC_CAMERA_H
#define ZM_LIBVLC_CAMERA_H #define ZM_LIBVLC_CAMERA_H
#include "zm_buffer.h"
#include "zm_camera.h" #include "zm_camera.h"
#include "zm_thread.h" #include "zm_thread.h"

View File

@ -1,8 +1,7 @@
#include <dlfcn.h>
#include "zm.h"
#include "zm_signal.h"
#include "zm_libvnc_camera.h" #include "zm_libvnc_camera.h"
#include "zm_swscale.h"
#include "zm_packet.h"
#include <dlfcn.h>
#if HAVE_LIBVNC #if HAVE_LIBVNC

View File

@ -2,9 +2,7 @@
#ifndef ZN_LIBVNC_CAMERA_H #ifndef ZN_LIBVNC_CAMERA_H
#define ZN_LIBVNC_CAMERA_H #define ZN_LIBVNC_CAMERA_H
#include "zm_buffer.h"
#include "zm_camera.h" #include "zm_camera.h"
#include "zm_thread.h"
#include "zm_swscale.h" #include "zm_swscale.h"
#if HAVE_LIBVNC #if HAVE_LIBVNC

View File

@ -17,20 +17,15 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#if ZM_HAS_V4L
#include "zm_local_camera.h" #include "zm_local_camera.h"
#include <sys/types.h> #include "zm_packet.h"
#include <sys/stat.h> #include "zm_utils.h"
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <errno.h> #include <sys/stat.h>
#include <stdlib.h>
#include <limits.h> #if ZM_HAS_V4L
/* Workaround for GNU/kFreeBSD and FreeBSD */ /* Workaround for GNU/kFreeBSD and FreeBSD */
#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) #if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)

View File

@ -20,10 +20,7 @@
#ifndef ZM_LOCAL_CAMERA_H #ifndef ZM_LOCAL_CAMERA_H
#define ZM_LOCAL_CAMERA_H #define ZM_LOCAL_CAMERA_H
#include "zm.h"
#include "zm_camera.h" #include "zm_camera.h"
#include "zm_image.h"
#include "zm_packet.h"
#if ZM_HAS_V4L #if ZM_HAS_V4L
@ -42,8 +39,6 @@
#define VIDEO_MAX_FRAME 32 #define VIDEO_MAX_FRAME 32
#endif #endif
#include "zm_ffmpeg.h"
// //
// Class representing 'local' cameras, i.e. those which are // Class representing 'local' cameras, i.e. those which are
// directly connect to the host machine and which are accessed // directly connect to the host machine and which are accessed

View File

@ -19,24 +19,18 @@
#include "zm_logger.h" #include "zm_logger.h"
#include "zm_config.h"
#include "zm_utils.h"
#include "zm_db.h" #include "zm_db.h"
#include "zm_utils.h"
#include <unistd.h> #include <csignal>
#include <stdio.h> #include <cstdarg>
#include <stdlib.h> #include <cstring>
#include <string.h>
#include <sys/time.h>
#include <syslog.h>
#include <signal.h>
#include <stdarg.h>
#include <errno.h>
#include <libgen.h> #include <libgen.h>
#include <syslog.h>
#include <sys/time.h>
#ifdef __FreeBSD__ #ifdef __FreeBSD__
#include <sys/thr.h> #include <sys/thr.h>
#endif #endif
#include <cstdarg>
bool Logger::smInitialised = false; bool Logger::smInitialised = false;
Logger *Logger::smInstance = nullptr; Logger *Logger::smInstance = nullptr;

View File

@ -20,17 +20,16 @@
#ifndef ZM_LOGGER_H #ifndef ZM_LOGGER_H
#define ZM_LOGGER_H #define ZM_LOGGER_H
#include "zm_db.h"
#include "zm_config.h" #include "zm_config.h"
#include "zm_define.h" #include "zm_define.h"
#include "zm_thread.h" #include "zm_thread.h"
#include <unistd.h>
#include <string> #include <string>
#include <map> #include <map>
#ifdef HAVE_SYS_SYSCALL_H #ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h> #include <sys/syscall.h>
#endif // HAVE_SYS_SYSCALL_H #endif // HAVE_SYS_SYSCALL_H
#include <mysql/mysql.h>
class Logger { class Logger {
public: public:

View File

@ -20,8 +20,7 @@
#ifndef ZM_MEM_UTILS_H #ifndef ZM_MEM_UTILS_H
#define ZM_MEM_UTILS_H #define ZM_MEM_UTILS_H
#include <stdlib.h> #include <cstdlib>
#include "zm.h"
inline void* zm_mallocaligned(unsigned int reqalignment, size_t reqsize) { inline void* zm_mallocaligned(unsigned int reqalignment, size_t reqsize) {
uint8_t* retptr; uint8_t* retptr;

View File

@ -17,43 +17,46 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include <sys/types.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <glob.h>
#include "zm.h"
#include "zm_db.h"
#include "zm_time.h"
#include "zm_mpeg.h"
#include "zm_signal.h"
#include "zm_monitor.h" #include "zm_monitor.h"
#include "zm_video.h"
#include "zm_group.h"
#include "zm_eventstream.h" #include "zm_eventstream.h"
#if ZM_HAS_V4L #include "zm_fifo.h"
#include "zm_local_camera.h" #include "zm_file_camera.h"
#endif // ZM_HAS_V4L
#include "zm_remote_camera.h" #include "zm_remote_camera.h"
#include "zm_remote_camera_http.h" #include "zm_remote_camera_http.h"
#include "zm_remote_camera_nvsocket.h" #include "zm_remote_camera_nvsocket.h"
#include "zm_signal.h"
#include "zm_time.h"
#include "zm_zone.h"
#if ZM_HAS_V4L
#include "zm_local_camera.h"
#endif // ZM_HAS_V4L
#if HAVE_LIBAVFORMAT #if HAVE_LIBAVFORMAT
#include "zm_remote_camera_rtsp.h" #include "zm_remote_camera_rtsp.h"
#endif // HAVE_LIBAVFORMAT #endif // HAVE_LIBAVFORMAT
#include "zm_file_camera.h"
#if HAVE_LIBAVFORMAT #if HAVE_LIBAVFORMAT
#include "zm_ffmpeg_camera.h" #include "zm_ffmpeg_camera.h"
#endif // HAVE_LIBAVFORMAT #endif // HAVE_LIBAVFORMAT
#include "zm_fifo.h"
#if HAVE_LIBVLC #if HAVE_LIBVLC
#include "zm_libvlc_camera.h" #include "zm_libvlc_camera.h"
#endif // HAVE_LIBVLC #endif // HAVE_LIBVLC
#if HAVE_LIBCURL #if HAVE_LIBCURL
#include "zm_curl_camera.h" #include "zm_curl_camera.h"
#endif // HAVE_LIBCURL #endif // HAVE_LIBCURL
#if HAVE_LIBVNC #if HAVE_LIBVNC
#include "zm_libvnc_camera.h" #include "zm_libvnc_camera.h"
#endif // HAVE_LIBVNC #endif // HAVE_LIBVNC
#include <sys/types.h>
#include <sys/stat.h>
#if ZM_MEM_MAPPED #if ZM_MEM_MAPPED
#include <sys/mman.h> #include <sys/mman.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -20,30 +20,16 @@
#ifndef ZM_MONITOR_H #ifndef ZM_MONITOR_H
#define ZM_MONITOR_H #define ZM_MONITOR_H
#include <vector>
#include <sstream>
#include <thread>
#include "zm.h"
#include "zm_coord.h"
#include "zm_image.h"
#include "zm_rgb.h"
#include "zm_zone.h"
#include "zm_event.h" #include "zm_event.h"
#include "zm_video.h" #include "zm_image.h"
#include "zm_videostore.h" #include "zm_packet.h"
#include "zm_packetqueue.h" #include "zm_packetqueue.h"
#include "zm_thread.h" #include "zm_video.h"
class Monitor;
#include "zm_group.h"
#include "zm_camera.h"
#include "zm_storage.h"
#include "zm_utils.h"
#include "zm_image_analyser.h"
#include <sys/time.h> #include <sys/time.h>
#include <vector>
class Camera;
class Group;
#define SIGNAL_CAUSE "Signal" #define SIGNAL_CAUSE "Signal"
#define MOTION_CAUSE "Motion" #define MOTION_CAUSE "Motion"

View File

@ -17,15 +17,14 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#include "zm_db.h"
#include "zm_time.h"
#include "zm_mpeg.h"
#include "zm_signal.h"
#include "zm_monitor.h"
#include "zm_monitorstream.h" #include "zm_monitorstream.h"
#include "zm_monitor.h"
#include "zm_signal.h"
#include "zm_time.h"
#include <arpa/inet.h> #include <arpa/inet.h>
#include <glob.h> #include <glob.h>
#include <sys/stat.h>
const int MAX_SLEEP_USEC = 1000000; // 1 sec const int MAX_SLEEP_USEC = 1000000; // 1 sec

View File

@ -20,11 +20,8 @@
#ifndef ZM_MONITORSTREAM_H #ifndef ZM_MONITORSTREAM_H
#define ZM_MONITORSTREAM_H #define ZM_MONITORSTREAM_H
#include "zm.h" #include "zm_stream.h"
#include "zm_coord.h" #include <sys/time.h>
#include "zm_image.h"
#include "zm_utils.h"
#include "zm_monitor.h"
class MonitorStream : public StreamBase { class MonitorStream : public StreamBase {
protected: protected:

View File

@ -17,13 +17,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <stdlib.h>
#include <string.h>
#include "zm.h"
#include "zm_rgb.h"
#include "zm_mpeg.h" #include "zm_mpeg.h"
#include "zm_logger.h"
#include "zm_rgb.h"
#include <cstring>
#if HAVE_LIBAVCODEC #if HAVE_LIBAVCODEC
extern "C" { extern "C" {
#include <libavutil/mathematics.h> #include <libavutil/mathematics.h>

View File

@ -16,10 +16,11 @@
//You should have received a copy of the GNU General Public License //You should have received a copy of the GNU General Public License
//along with ZoneMinder. If not, see <http://www.gnu.org/licenses/>. //along with ZoneMinder. If not, see <http://www.gnu.org/licenses/>.
#include "zm_packet.h" #include "zm_packet.h"
#include "zm_ffmpeg.h"
#include "zm_ffmpeg.h"
#include "zm_image.h"
#include "zm_logger.h"
#include <sys/time.h> #include <sys/time.h>
using namespace std; using namespace std;

View File

@ -20,6 +20,9 @@
#ifndef ZM_PACKET_H #ifndef ZM_PACKET_H
#define ZM_PACKET_H #define ZM_PACKET_H
#include "zm_logger.h"
#include <mutex>
extern "C" { extern "C" {
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
} }
@ -28,9 +31,7 @@ extern "C" {
#include <sys/time.h> #include <sys/time.h>
#endif // __FreeBSD__ #endif // __FreeBSD__
#include "zm_image.h" class Image;
#include "zm_thread.h"
#include <mutex>
class ZMPacket { class ZMPacket {
public: public:

View File

@ -20,10 +20,11 @@
// PacketQueue must know about all iterators and manage them // PacketQueue must know about all iterators and manage them
#include "zm_packetqueue.h" #include "zm_packetqueue.h"
#include "zm_ffmpeg.h" #include "zm_ffmpeg.h"
#include "zm_packet.h"
#include "zm_signal.h" #include "zm_signal.h"
#include <sys/time.h> #include <sys/time.h>
#include "zm_time.h"
PacketQueue::PacketQueue(): PacketQueue::PacketQueue():
video_stream_id(-1), video_stream_id(-1),

View File

@ -16,19 +16,15 @@
//You should have received a copy of the GNU General Public License //You should have received a copy of the GNU General Public License
//along with ZoneMinder. If not, see <http://www.gnu.org/licenses/>. //along with ZoneMinder. If not, see <http://www.gnu.org/licenses/>.
#ifndef ZM_PACKETQUEUE_H #ifndef ZM_PACKETQUEUE_H
#define ZM_PACKETQUEUE_H #define ZM_PACKETQUEUE_H
#include <list>
#include "zm_packet.h"
#include "zm_thread.h"
#include <mutex>
#include <condition_variable> #include <condition_variable>
#include <list>
#include <mutex>
class ZMPacket;
extern "C" {
#include <libavformat/avformat.h>
}
typedef std::list<ZMPacket *>::iterator packetqueue_iterator; typedef std::list<ZMPacket *>::iterator packetqueue_iterator;
class PacketQueue { class PacketQueue {

View File

@ -17,14 +17,9 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#include "zm_poly.h" #include "zm_poly.h"
#ifndef SOLARIS
#include <math.h>
#else
#include <cmath> #include <cmath>
#endif
void Polygon::calcArea() { void Polygon::calcArea() {
double float_area = 0.0L; double float_area = 0.0L;

View File

@ -20,11 +20,9 @@
#ifndef ZM_POLY_H #ifndef ZM_POLY_H
#define ZM_POLY_H #define ZM_POLY_H
#include "zm.h"
#include "zm_coord.h"
#include "zm_box.h" #include "zm_box.h"
#include <math.h> class Coord;
// //
// Class used for storing a box, which is defined as a region // Class used for storing a box, which is defined as a region

View File

@ -17,11 +17,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <string.h>
#include "zm.h"
#include "zm_regexp.h" #include "zm_regexp.h"
#include "zm_logger.h"
#include <cstring>
#if HAVE_LIBPCRE #if HAVE_LIBPCRE
RegExpr::RegExpr( const char *pattern, int flags, int p_max_matches ) : max_matches( p_max_matches ), match_buffers( nullptr ), match_lengths( nullptr ), match_valid( nullptr ) RegExpr::RegExpr( const char *pattern, int flags, int p_max_matches ) : max_matches( p_max_matches ), match_buffers( nullptr ), match_lengths( nullptr ), match_valid( nullptr )

View File

@ -17,11 +17,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "zm.h"
#ifndef ZM_REGEXP_H #ifndef ZM_REGEXP_H
#define ZM_REGEXP_H #define ZM_REGEXP_H
#include "zm_config.h"
#if HAVE_LIBPCRE #if HAVE_LIBPCRE
#if HAVE_PCRE_H #if HAVE_PCRE_H

View File

@ -20,6 +20,8 @@
#include "zm_remote_camera.h" #include "zm_remote_camera.h"
#include "zm_utils.h" #include "zm_utils.h"
#include <arpa/inet.h>
#include <netdb.h>
RemoteCamera::RemoteCamera( RemoteCamera::RemoteCamera(
unsigned int p_monitor_id, unsigned int p_monitor_id,

View File

@ -22,12 +22,7 @@
#include "zm_camera.h" #include "zm_camera.h"
#include "zm_rtsp_auth.h" #include "zm_rtsp_auth.h"
#include <string> #include <string>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#define SOCKET_BUF_SIZE 8192 #define SOCKET_BUF_SIZE 8192

View File

@ -18,14 +18,12 @@
// //
#include "zm_remote_camera_http.h" #include "zm_remote_camera_http.h"
#include "zm_rtsp_auth.h"
#include "zm_mem_utils.h" #include "zm_packet.h"
#include "zm_signal.h" #include "zm_signal.h"
#include "zm_regexp.h"
#include <sys/types.h> #include "zm_utils.h"
#include <sys/socket.h> #include <arpa/inet.h>
#include <errno.h>
#include <netdb.h> #include <netdb.h>
#ifdef SOLARIS #ifdef SOLARIS

View File

@ -20,11 +20,8 @@
#ifndef ZM_REMOTE_CAMERA_HTTP_H #ifndef ZM_REMOTE_CAMERA_HTTP_H
#define ZM_REMOTE_CAMERA_HTTP_H #define ZM_REMOTE_CAMERA_HTTP_H
#include "zm_remote_camera.h"
#include "zm_buffer.h" #include "zm_buffer.h"
#include "zm_regexp.h" #include "zm_remote_camera.h"
#include "zm_utils.h"
// //
// Class representing 'http' cameras, i.e. those which are // Class representing 'http' cameras, i.e. those which are

View File

@ -19,12 +19,10 @@
#include "zm_remote_camera_nvsocket.h" #include "zm_remote_camera_nvsocket.h"
#include "zm_mem_utils.h" #include "zm_packet.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <sys/socket.h>
#include <sys/types.h>
#ifdef SOLARIS #ifdef SOLARIS
#include <sys/filio.h> // FIONREAD and friends #include <sys/filio.h> // FIONREAD and friends

View File

@ -20,11 +20,8 @@
#ifndef ZM_REMOTE_CAMERA_NVSOCKET_H #ifndef ZM_REMOTE_CAMERA_NVSOCKET_H
#define ZM_REMOTE_CAMERA_NVSOCKET_H #define ZM_REMOTE_CAMERA_NVSOCKET_H
#include "zm_remote_camera.h"
#include "zm_buffer.h" #include "zm_buffer.h"
#include "zm_regexp.h" #include "zm_remote_camera.h"
#include "zm_utils.h"
class RemoteCameraNVSocket : public RemoteCamera { class RemoteCameraNVSocket : public RemoteCamera {
protected: protected:

View File

@ -17,17 +17,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h" #include "zm_remote_camera_rtsp.h"
#include "zm_config.h"
#include "zm_packet.h"
#if HAVE_LIBAVFORMAT #if HAVE_LIBAVFORMAT
#include "zm_remote_camera_rtsp.h"
#include "zm_ffmpeg.h"
#include "zm_mem_utils.h"
#include <sys/types.h>
#include <sys/socket.h>
RemoteCameraRtsp::RemoteCameraRtsp( RemoteCameraRtsp::RemoteCameraRtsp(
unsigned int p_monitor_id, unsigned int p_monitor_id,
const std::string &p_method, const std::string &p_method,

View File

@ -20,14 +20,9 @@
#ifndef ZM_REMOTE_CAMERA_RTSP_H #ifndef ZM_REMOTE_CAMERA_RTSP_H
#define ZM_REMOTE_CAMERA_RTSP_H #define ZM_REMOTE_CAMERA_RTSP_H
#include "zm_remote_camera.h"
#include "zm_buffer.h"
#include "zm_utils.h"
#include "zm_rtsp.h"
#include "zm_ffmpeg.h" #include "zm_ffmpeg.h"
#include "zm_videostore.h" #include "zm_remote_camera.h"
#include "zm_packetqueue.h" #include "zm_rtsp.h"
// //
// Class representing 'rtsp' cameras, i.e. those which are // Class representing 'rtsp' cameras, i.e. those which are

View File

@ -20,7 +20,9 @@
#ifndef ZM_RGB_H #ifndef ZM_RGB_H
#define ZM_RGB_H #define ZM_RGB_H
typedef uint32_t Rgb; // RGB colour type #include "zm_define.h"
typedef uint32 Rgb; // RGB colour type
#define WHITE 0xff #define WHITE 0xff
#define WHITE_R 0xff #define WHITE_R 0xff

View File

@ -20,8 +20,6 @@
#ifndef ZM_RTP_H #ifndef ZM_RTP_H
#define ZM_RTP_H #define ZM_RTP_H
#include "zm.h"
#define RTP_VERSION 2 #define RTP_VERSION 2
#endif // ZM_RTP_H #endif // ZM_RTP_H

View File

@ -17,16 +17,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#if HAVE_LIBAVFORMAT
#include "zm_rtp_ctrl.h" #include "zm_rtp_ctrl.h"
#include "zm_time.h" #include "zm_config.h"
#include "zm_rtp.h"
#include "zm_rtsp.h" #include "zm_rtsp.h"
#include <errno.h> #if HAVE_LIBAVFORMAT
RtpCtrlThread::RtpCtrlThread( RtspThread &rtspThread, RtpSource &rtpSource ) RtpCtrlThread::RtpCtrlThread( RtspThread &rtspThread, RtpSource &rtpSource )
: mRtspThread( rtspThread ), mRtpSource( rtpSource ), mStop( false ) : mRtspThread( rtspThread ), mRtpSource( rtpSource ), mStop( false )

View File

@ -20,8 +20,6 @@
#ifndef ZM_RTP_CTRL_H #ifndef ZM_RTP_CTRL_H
#define ZM_RTP_CTRL_H #define ZM_RTP_CTRL_H
#include "zm_rtp.h"
#include "zm_comms.h"
#include "zm_thread.h" #include "zm_thread.h"
// Defined in ffmpeg rtp.h // Defined in ffmpeg rtp.h

View File

@ -17,15 +17,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#if HAVE_LIBAVFORMAT
#include "zm_rtp_data.h" #include "zm_rtp_data.h"
#include "zm_config.h"
#include "zm_rtsp.h" #include "zm_rtsp.h"
#include "zm_signal.h"
#include <arpa/inet.h> #if HAVE_LIBAVFORMAT
RtpDataThread::RtpDataThread(RtspThread &rtspThread, RtpSource &rtpSource) : RtpDataThread::RtpDataThread(RtspThread &rtspThread, RtpSource &rtpSource) :
mRtspThread(rtspThread), mRtpSource(rtpSource), mStop(false) mRtspThread(rtspThread), mRtpSource(rtpSource), mStop(false)

View File

@ -20,7 +20,6 @@
#ifndef ZM_RTP_DATA_H #ifndef ZM_RTP_DATA_H
#define ZM_RTP_DATA_H #define ZM_RTP_DATA_H
#include "zm_buffer.h"
#include "zm_define.h" #include "zm_define.h"
#include "zm_thread.h" #include "zm_thread.h"

View File

@ -21,7 +21,7 @@
#include "zm_time.h" #include "zm_time.h"
#include "zm_rtp_data.h" #include "zm_rtp_data.h"
#include "zm_utils.h"
#include <arpa/inet.h> #include <arpa/inet.h>
#if HAVE_LIBAVCODEC #if HAVE_LIBAVCODEC

View File

@ -21,12 +21,12 @@
#define ZM_RTP_SOURCE_H #define ZM_RTP_SOURCE_H
#include "zm_buffer.h" #include "zm_buffer.h"
#include "zm_config.h"
#include "zm_define.h" #include "zm_define.h"
#include "zm_ffmpeg.h" #include "zm_ffmpeg.h"
#include "zm_thread.h" #include "zm_thread.h"
#include <sys/time.h>
#include <string> #include <string>
#include <sys/time.h>
#if HAVE_LIBAVCODEC #if HAVE_LIBAVCODEC

View File

@ -17,20 +17,14 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#if HAVE_LIBAVFORMAT
#include "zm_rtsp.h" #include "zm_rtsp.h"
#include "zm_config.h"
#include "zm_rtp_data.h" #include "zm_rtp_data.h"
#include "zm_rtp_ctrl.h" #include "zm_rtp_ctrl.h"
#include "zm_db.h" #include "zm_db.h"
#include <sys/time.h> #if HAVE_LIBAVFORMAT
#include <signal.h>
#include <stdlib.h>
#include <errno.h>
int RtspThread::smMinDataPort = 0; int RtspThread::smMinDataPort = 0;
int RtspThread::smMaxDataPort = 0; int RtspThread::smMaxDataPort = 0;

View File

@ -20,16 +20,12 @@
#ifndef ZM_RTSP_H #ifndef ZM_RTSP_H
#define ZM_RTSP_H #define ZM_RTSP_H
#include "zm.h"
#include "zm_ffmpeg.h"
#include "zm_comms.h" #include "zm_comms.h"
#include "zm_thread.h"
#include "zm_rtp_source.h" #include "zm_rtp_source.h"
#include "zm_rtsp_auth.h" #include "zm_rtsp_auth.h"
#include "zm_sdp.h" #include "zm_sdp.h"
#include <set>
#include <map> #include <map>
#include <set>
class RtspThread : public Thread { class RtspThread : public Thread {
public: public:

View File

@ -16,13 +16,11 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h"
#include "zm_utils.h"
#include "zm_rtsp_auth.h" #include "zm_rtsp_auth.h"
#include <stdio.h> #include "zm_logger.h"
#include <stdlib.h> #include "zm_utils.h"
#include <string.h> #include <cstring>
namespace zm { namespace zm {

View File

@ -19,6 +19,9 @@
#ifndef ZM_RTSP_AUTH_H #ifndef ZM_RTSP_AUTH_H
#define ZM_RTSP_AUTH_H #define ZM_RTSP_AUTH_H
#include "zm_config.h"
#include <string>
#if HAVE_GNUTLS_GNUTLS_H #if HAVE_GNUTLS_GNUTLS_H
#include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
#endif #endif

View File

@ -6,17 +6,15 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#include "zm.h" #include "zm_rtsp_server_adts_source.h"
#include "zm_config.h"
#include <sstream>
#if HAVE_RTSP_SERVER #if HAVE_RTSP_SERVER
#include <sstream>
#include <iomanip>
// live555 // live555
#include <Base64.hh> #include <Base64.hh>
#include "zm_rtsp_server_adts_source.h"
static unsigned const samplingFrequencyTable[16] = { static unsigned const samplingFrequencyTable[16] = {
96000, 88200, 64000, 48000, 96000, 88200, 64000, 48000,
44100, 32000, 24000, 22050, 44100, 32000, 24000, 22050,
@ -47,4 +45,4 @@ ADTS_ZoneMinderDeviceSource::ADTS_ZoneMinderDeviceSource(
<< "\r\n"; << "\r\n";
m_auxLine.assign(os.str()); m_auxLine.assign(os.str());
} }
#endif #endif // HAVE_RTSP_SERVER

View File

@ -9,17 +9,13 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#include "zm.h" #ifndef ZM_RTSP_SERVER_ADTS_SOURCE_H
#define ZM_RTSP_SERVER_ADTS_SOURCE_H
#include "zm_config.h"
#include "zm_rtsp_server_device_source.h"
#if HAVE_RTSP_SERVER #if HAVE_RTSP_SERVER
#ifndef ADTS_ZoneMinder_DEVICE_SOURCE
#define ADTS_ZoneMinder_DEVICE_SOURCE
// project
#include "zm_rtsp_server_device_source.h"
#include "zm_rtsp_server_frame.h"
// --------------------------------- // ---------------------------------
// ADTS(AAC) ZoneMinder FramedSource // ADTS(AAC) ZoneMinder FramedSource
// --------------------------------- // ---------------------------------
@ -67,5 +63,6 @@ class ADTS_ZoneMinderDeviceSource : public ZoneMinderDeviceSource {
int samplingFrequencyIndex; int samplingFrequencyIndex;
int channels; int channels;
}; };
#endif #endif // HAVE_RTSP_SERVER
#endif
#endif // ZM_RTSP_SERVER_ADTS_SOURCE_H

View File

@ -8,13 +8,14 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#include <utility>
#include "zm_rtsp_server_device_source.h" #include "zm_rtsp_server_device_source.h"
#include "zm_rtsp_server_frame.h"
#include "zm_logger.h"
#if HAVE_RTSP_SERVER
#include "zm_config.h"
#include "zm_logger.h"
#include "zm_rtsp_server_frame.h"
#include "zm_signal.h"
#if HAVE_RTSP_SERVER
ZoneMinderDeviceSource::ZoneMinderDeviceSource( ZoneMinderDeviceSource::ZoneMinderDeviceSource(
UsageEnvironment& env, UsageEnvironment& env,
Monitor* monitor, Monitor* monitor,
@ -213,4 +214,4 @@ unsigned char* ZoneMinderDeviceSource::extractFrame(unsigned char* frame, size_
size = 0; size = 0;
return frame; return frame;
} }
#endif #endif // HAVE_RTSP_SERVER

View File

@ -6,24 +6,19 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#include "zm.h" #ifndef ZM_RTSP_SERVER_DEVICE_SOURCE_H
#define ZM_RTSP_SERVER_DEVICE_SOURCE_H
#include "zm_config.h"
#include "zm_monitor.h"
#include <list>
#include <string>
#include <utility>
#if HAVE_RTSP_SERVER #if HAVE_RTSP_SERVER
#ifndef DEVICE_SOURCE
#define DEVICE_SOURCE
#include <string>
#include <list>
#include <iostream>
#include <liveMedia.hh> #include <liveMedia.hh>
#include "zm_monitor.h" class NAL_Frame;
#include "zm_rtsp_server_frame.h"
#include "zm_packetqueue.h"
#include <linux/types.h>
class ZoneMinderDeviceSource: public FramedSource { class ZoneMinderDeviceSource: public FramedSource {
@ -77,6 +72,6 @@ class ZoneMinderDeviceSource: public FramedSource {
std::string m_auxLine; std::string m_auxLine;
int stop; int stop;
}; };
#endif // HAVE_RTSP_SERVER
#endif #endif // ZM_RTSP_SERVER_DEVICE_SOURCE_H
#endif

View File

@ -1,11 +1,12 @@
#pragma once #ifndef ZM_RTSP_SERVER_FRAME_H
#define ZM_RTSP_SERVER_FRAME_H
#include "zm_config.h"
#include "zm_logger.h" #include "zm_logger.h"
#include "zm.h" #include <cstring>
#include <sys/time.h>
#if HAVE_RTSP_SERVER #if HAVE_RTSP_SERVER
#include <sys/time.h>
#include <string.h>
// --------------------------------- // ---------------------------------
// Captured frame // Captured frame
// --------------------------------- // ---------------------------------
@ -60,4 +61,6 @@ class NAL_Frame {
private: private:
int m_ref_count; int m_ref_count;
}; };
#endif #endif // HAVE_RTSP_SERVER
#endif // ZM_RTSP_SERVER_FRAME_H

View File

@ -6,18 +6,18 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#include "zm.h" #include "zm_rtsp_server_h264_device_source.h"
#include "zm_config.h"
#include "zm_logger.h"
#include "zm_rtsp_server_frame.h"
#include <iomanip>
#include <sstream>
#if HAVE_RTSP_SERVER #if HAVE_RTSP_SERVER
#include <sstream>
#include <iomanip>
// live555 // live555
#include <Base64.hh> #include <Base64.hh>
#include "zm_rtsp_server_h264_device_source.h"
// --------------------------------- // ---------------------------------
// H264 ZoneMinder FramedSource // H264 ZoneMinder FramedSource
// --------------------------------- // ---------------------------------
@ -226,4 +226,4 @@ unsigned char* H26X_ZoneMinderDeviceSource::extractFrame(unsigned char* frame,
return outFrame; return outFrame;
} }
#endif #endif // HAVE_RTSP_SERVER

View File

@ -9,17 +9,16 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#ifndef ZM_RTSP_H264_DEVICE_SOURCE_H
#define ZM_RTSP_H264_DEVICE_SOURCE_H
#ifndef H264_ZoneMinder_DEVICE_SOURCE #include "zm_config.h"
#define H264_ZoneMinder_DEVICE_SOURCE
#include "zm_rtsp_server_device_source.h" #include "zm_rtsp_server_device_source.h"
#include "zm_rtsp_server_frame.h"
// --------------------------------- // ---------------------------------
// H264 ZoneMinder FramedSource // H264 ZoneMinder FramedSource
// --------------------------------- // ---------------------------------
#if HAVE_RTSP_SERVER
class H26X_ZoneMinderDeviceSource : public ZoneMinderDeviceSource { class H26X_ZoneMinderDeviceSource : public ZoneMinderDeviceSource {
protected: protected:
H26X_ZoneMinderDeviceSource( H26X_ZoneMinderDeviceSource(
@ -100,4 +99,6 @@ class H265_ZoneMinderDeviceSource : public H26X_ZoneMinderDeviceSource {
protected: protected:
std::string m_vps; std::string m_vps;
}; };
#endif #endif // HAVE_RTSP_SERVER
#endif // ZM_RTSP_H264_DEVICE_SOURCE_H

View File

@ -4,15 +4,13 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#include "zm.h" #include "zm_rtsp_server_server_media_subsession.h"
#if HAVE_RTSP_SERVER #include "zm_config.h"
#include "zm_rtsp_server_adts_source.h"
#include <sstream> #include <sstream>
#include "zm_rtsp_server_server_media_subsession.h" #if HAVE_RTSP_SERVER
#include "zm_rtsp_server_device_source.h"
#include "zm_rtsp_server_adts_source.h"
// --------------------------------- // ---------------------------------
// BaseServerMediaSubsession // BaseServerMediaSubsession
// --------------------------------- // ---------------------------------
@ -106,4 +104,4 @@ char const* BaseServerMediaSubsession::getAuxLine(
} }
return auxLine; return auxLine;
} }
#endif #endif // HAVE_RTSP_SERVER

View File

@ -7,19 +7,13 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#pragma once #ifndef ZM_RTSP_SERVER_SERVER_MEDIA_SUBSESSION_H
#define ZM_RTSP_SERVER_SERVER_MEDIA_SUBSESSION_H
#include "zm.h" #include "zm_config.h"
#include <string>
#if HAVE_RTSP_SERVER #if HAVE_RTSP_SERVER
#include <sys/stat.h>
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <liveMedia.hh> #include <liveMedia.hh>
class ZoneMinderDeviceSource; class ZoneMinderDeviceSource;
@ -48,4 +42,6 @@ class BaseServerMediaSubsession {
protected: protected:
StreamReplicator* m_replicator; StreamReplicator* m_replicator;
}; };
#endif #endif // HAVE_RTSP_SERVER
#endif // ZM_RTSP_SERVER_SERVER_MEDIA_SUBSESSION_H

View File

@ -1,12 +1,11 @@
#include "zm_rtsp_server_thread.h"
#include "zm.h" #include "zm_config.h"
#include "zm_rtsp_server_adts_source.h"
#include "zm_rtsp_server_h264_device_source.h"
#include "zm_rtsp_server_unicast_server_media_subsession.h"
#if HAVE_RTSP_SERVER #if HAVE_RTSP_SERVER
#include "zm_rtsp_server_thread.h"
#include "zm_rtsp_server_device_source.h"
#include "zm_rtsp_server_h264_device_source.h"
#include "zm_rtsp_server_adts_source.h"
#include "zm_rtsp_server_unicast_server_media_subsession.h"
#include <StreamReplicator.hh> #include <StreamReplicator.hh>
RTSPServerThread::RTSPServerThread(Monitor *p_monitor) : RTSPServerThread::RTSPServerThread(Monitor *p_monitor) :
@ -155,4 +154,4 @@ const std::string RTSPServerThread::getRtpFormat(AVCodecID codec_id, bool muxTS)
return ""; return "";
} }
#endif #endif // HAVE_RTSP_SERVER

View File

@ -1,17 +1,16 @@
#include "zm.h"
#if HAVE_RTSP_SERVER
#ifndef ZM_RTSP_SERVER_THREAD_H #ifndef ZM_RTSP_SERVER_THREAD_H
#define ZM_RTSP_SERVER_THREAD_H #define ZM_RTSP_SERVER_THREAD_H
#include "zm_config.h"
#include "zm_ffmpeg.h"
#include "zm_thread.h" #include "zm_thread.h"
#include <signal.h> #include <list>
#include "zm_monitor.h"
#if HAVE_RTSP_SERVER
#include <BasicUsageEnvironment.hh> #include <BasicUsageEnvironment.hh>
#include <RTSPServer.hh> #include <RTSPServer.hh>
#include "zm_ffmpeg.h"
class Monitor;
class RTSPServerThread : public Thread { class RTSPServerThread : public Thread {
private: private:
@ -39,6 +38,6 @@ class RTSPServerThread : public Thread {
const std::list<ServerMediaSubsession*> & subSession const std::list<ServerMediaSubsession*> & subSession
); );
}; };
#endif // HAVE_RTSP_SERVER
#endif #endif // ZM_RTSP_SERVER_THREAD_H
#endif

View File

@ -7,11 +7,12 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#include "zm.h"
#if HAVE_RTSP_SERVER
#include "zm_rtsp_server_unicast_server_media_subsession.h" #include "zm_rtsp_server_unicast_server_media_subsession.h"
#include "zm_config.h"
#include "zm_rtsp_server_device_source.h" #include "zm_rtsp_server_device_source.h"
#if HAVE_RTSP_SERVER
// ----------------------------------------- // -----------------------------------------
// ServerMediaSubsession for Unicast // ServerMediaSubsession for Unicast
// ----------------------------------------- // -----------------------------------------
@ -46,4 +47,4 @@ char const* UnicastServerMediaSubsession::getAuxSDPLine(
) { ) {
return this->getAuxLine(dynamic_cast<ZoneMinderDeviceSource*>(m_replicator->inputSource()), rtpSink->rtpPayloadType()); return this->getAuxLine(dynamic_cast<ZoneMinderDeviceSource*>(m_replicator->inputSource()), rtpSink->rtpPayloadType());
} }
#endif #endif // HAVE_RTSP_SERVER

View File

@ -7,13 +7,16 @@
** **
** -------------------------------------------------------------------------*/ ** -------------------------------------------------------------------------*/
#pragma once #ifndef ZM_RTSP_SERVER_UNICAST_SERVER_MEDIA_SUBSESSION_H
#define ZM_RTSP_SERVER_UNICAST_SERVER_MEDIA_SUBSESSION_H
#include "zm_config.h"
#include "zm_rtsp_server_server_media_subsession.h" #include "zm_rtsp_server_server_media_subsession.h"
// ----------------------------------------- // -----------------------------------------
// ServerMediaSubsession for Unicast // ServerMediaSubsession for Unicast
// ----------------------------------------- // -----------------------------------------
#if HAVE_RTSP_SERVER
class UnicastServerMediaSubsession : class UnicastServerMediaSubsession :
public OnDemandServerMediaSubsession, public OnDemandServerMediaSubsession,
public BaseServerMediaSubsession public BaseServerMediaSubsession
@ -43,3 +46,6 @@ class UnicastServerMediaSubsession :
protected: protected:
const std::string m_format; const std::string m_format;
}; };
#endif // HAVE_RTSP_SERVER
#endif // ZM_RTSP_SERVER_UNICAST_SERVER_MEDIA_SUBSESSION_H

View File

@ -17,12 +17,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
#include "zm.h" #include "zm_sdp.h"
#include "zm_config.h"
#include "zm_logger.h"
#if HAVE_LIBAVFORMAT #if HAVE_LIBAVFORMAT
#include "zm_sdp.h"
#if (LIBAVCODEC_VERSION_CHECK(52, 64, 0, 64, 0) || LIBAVUTIL_VERSION_CHECK(50, 14, 0, 14, 0)) #if (LIBAVCODEC_VERSION_CHECK(52, 64, 0, 64, 0) || LIBAVUTIL_VERSION_CHECK(50, 14, 0, 14, 0))
SessionDescriptor::StaticPayloadDesc SessionDescriptor::smStaticPayloads[] = { SessionDescriptor::StaticPayloadDesc SessionDescriptor::smStaticPayloads[] = {
{ 0, "PCMU", AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_PCM_MULAW, 8000, 1 }, { 0, "PCMU", AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_PCM_MULAW, 8000, 1 },

View File

@ -20,14 +20,8 @@
#ifndef ZM_SDP_H #ifndef ZM_SDP_H
#define ZM_SDP_H #define ZM_SDP_H
#include "zm.h"
#include "zm_utils.h"
#include "zm_exception.h"
#include "zm_ffmpeg.h" #include "zm_ffmpeg.h"
#include "zm_utils.h"
#include <stdlib.h>
#include <string> #include <string>
#include <vector> #include <vector>

Some files were not shown because too many files have changed in this diff Show More