user_app.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #pragma once
  2. #include <iostream>
  3. #include <signal.h>
  4. // ZLMediaKit
  5. #include "Util/logger.h"
  6. #include "Util/NoticeCenter.h"
  7. #include "Poller/EventPoller.h"
  8. #include "Player/PlayerProxy.h"
  9. #include "Rtmp/RtmpPusher.h"
  10. #include "Common/config.h"
  11. #include "Pusher/MediaPusher.h"
  12. #include "Extension/Frame.h"
  13. #include "Util/SqlPool.h"
  14. #include "Network/TcpClient.h"
  15. #include "TCPClient.h"
  16. #include "inifile.h"
  17. #include <gst/gst.h>
  18. #include <vector>
  19. #include "inference.h"
  20. using namespace toolkit;
  21. using namespace mediakit;
  22. using namespace inifile;
  23. using namespace std;
  24. #define ERR -1
  25. #define OK 0
  26. namespace VIA
  27. {
  28. class UserApp
  29. {
  30. public:
  31. static std::shared_ptr<UserApp> CreateNew();
  32. UserApp();
  33. ~UserApp();
  34. int32_t Init(std::string appName);
  35. void Destroy();
  36. void StartTask();
  37. private:
  38. IniFile m_ini;
  39. std::string m_appName;
  40. const std::string m_configSrc = "../config/config.ini";
  41. private:
  42. // Natty
  43. std::string Netty_ip;
  44. int32_t Netty_port;
  45. std::string Netty_idName;
  46. // PIS
  47. std::string PIS_ip;
  48. int32_t PIS_port;
  49. std::string PIS_IdName;
  50. // Mysql
  51. std::string sql_ip;
  52. int32_t sql_port;
  53. std::string user;
  54. std::string password;
  55. std::string character;
  56. int device_id;
  57. std::string Log_src;
  58. private:
  59. // 负责链接Netty的Socker
  60. std::shared_ptr<TCPClient> m_tcpClient;
  61. };
  62. }