You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __PROTOCOL_ZL_MEDIASERVER_REST_HEADER__
  2. #define __PROTOCOL_ZL_MEDIASERVER_REST_HEADER__
  3. #ifdef __linux__
  4. #include <features.h>
  5. #endif
  6. #include "protocolHTTP.h"
  7. #include <time.h>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <sys/types.h>
  11. #include <sys/timeb.h>
  12. #include <string>
  13. #include "../../components/base/basicFunctionality.h"
  14. #include "../../components/base/basicLogCollection.h"
  15. #include "../../components/base/basicSettingsProvider.h"
  16. #define ZL_ADD_ENCODER_SOURCE ((CSTR) "index/api/addFFmpegSource" )
  17. #define ZL_ADD_STREAM_PROXY ((CSTR) "index/api/addStreamProxy" )
  18. #define ZL_CLOSE_STREAM ((CSTR) "index/api/close_stream" )
  19. #define ZL_DEL_ENCODER_SOURCE ((CSTR) "index/api/delFFmepgSource" )
  20. #define ZL_DEL_STREAM_PROXY ((CSTR) "index/api/delStreamProxy" )
  21. #define ZL_LIST_SESSIONS ((CSTR) "index/api/getAllSession" )
  22. #define ZL_LIST_API ((CSTR) "index/api/getApiList" )
  23. #define ZL_LIST_MEDIA ((CSTR) "index/api/getMediaList" )
  24. #define ZL_GET_SERVER_CONFIG ((CSTR) "index/api/getServerConfig" )
  25. #define ZL_GET_LOAD_STATS ((CSTR) "index/api/getThreadsLoad" )
  26. #define ZL_GET_WORK_LOAD_STATS ((CSTR) "index/api/getWorkThreadsLoad" )
  27. #define ZL_KICK_SESSION ((CSTR) "index/api/kick_session" )
  28. #define ZL_RESTART_SERVER ((CSTR) "index/api/restartServer" )
  29. #define ZL_SET_SERVER_CONFIG ((CSTR) "index/api/setServerConfig" )
  30. class protocolZLMEDIA : public protocolHTTP {
  31. private:
  32. basicLogCollection * m_pLog;
  33. config_setting_t * m_pSettings;
  34. char m_pSecret[256];
  35. char m_pAccessPoint[256];
  36. char m_pIP[16];
  37. bool m_bSessionOnGo;
  38. bool m_bServerIsPresent;
  39. bool m_bUseSSL;
  40. uint16_t m_nPort;
  41. protected:
  42. virtual bool packetHandler( protocolPackage *Package );
  43. public:
  44. explicit protocolZLMEDIA( config_setting_t *Settings = NULL );
  45. explicit protocolZLMEDIA( CSTR key, CSTR host, CSTR ip, uint32_t port );
  46. ~protocolZLMEDIA();
  47. bool isOnline();
  48. bool restartServer();
  49. bool getConfig();
  50. CSTR addStreamProxy();
  51. bool delStreamProxy(CSTR key);
  52. bool listMedia();
  53. bool requestIsFinished();
  54. };
  55. #endif