#ifndef __PROTOCOL_ZL_MEDIASERVER_REST_HEADER__ #define __PROTOCOL_ZL_MEDIASERVER_REST_HEADER__ #ifdef __linux__ #include #endif #include "protocolHTTP.h" #include #include #include #include #include #include #include "../../components/base/basicFunctionality.h" #include "../../components/base/basicLogCollection.h" #include "../../components/base/basicSettingsProvider.h" #define ZL_ADD_ENCODER_SOURCE ((CSTR) "index/api/addFFmpegSource" ) #define ZL_ADD_STREAM_PROXY ((CSTR) "index/api/addStreamProxy" ) #define ZL_CLOSE_STREAM ((CSTR) "index/api/close_stream" ) #define ZL_DEL_ENCODER_SOURCE ((CSTR) "index/api/delFFmepgSource" ) #define ZL_DEL_STREAM_PROXY ((CSTR) "index/api/delStreamProxy" ) #define ZL_LIST_SESSIONS ((CSTR) "index/api/getAllSession" ) #define ZL_LIST_API ((CSTR) "index/api/getApiList" ) #define ZL_LIST_MEDIA ((CSTR) "index/api/getMediaList" ) #define ZL_GET_SERVER_CONFIG ((CSTR) "index/api/getServerConfig" ) #define ZL_GET_LOAD_STATS ((CSTR) "index/api/getThreadsLoad" ) #define ZL_GET_WORK_LOAD_STATS ((CSTR) "index/api/getWorkThreadsLoad" ) #define ZL_KICK_SESSION ((CSTR) "index/api/kick_session" ) #define ZL_RESTART_SERVER ((CSTR) "index/api/restartServer" ) #define ZL_SET_SERVER_CONFIG ((CSTR) "index/api/setServerConfig" ) class protocolZLMEDIA : public protocolHTTP { private: basicLogCollection * m_pLog; config_setting_t * m_pSettings; char m_pSecret[256]; char m_pAccessPoint[256]; char m_pIP[16]; bool m_bSessionOnGo; bool m_bServerIsPresent; bool m_bUseSSL; uint16_t m_nPort; protected: virtual bool packetHandler( protocolPackage *Package ); public: explicit protocolZLMEDIA( config_setting_t *Settings = NULL ); explicit protocolZLMEDIA( CSTR key, CSTR host, CSTR ip, uint32_t port ); ~protocolZLMEDIA(); bool isOnline(); bool restartServer(); bool getConfig(); CSTR addStreamProxy(); bool delStreamProxy(CSTR key); bool listMedia(); bool requestIsFinished(); }; #endif