EasyGBD_DemoDlg.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. 
  2. // EasyGBD_DemoDlg.h: 头文件
  3. //
  4. #pragma once
  5. //#include "osthread.h"
  6. #include "osmutex.h"
  7. #include <vector>
  8. //#include "../AudioTranscode/AudioTranscodeAPI.h"
  9. #include "GB28181DeviceAPI.h"
  10. #include "EasyStreamClientAPI.h"
  11. #pragma comment(lib, "libEasyStreamClient.lib")
  12. #pragma comment(lib, "GB28181Device.lib")
  13. #include <string>
  14. using namespace std;
  15. typedef vector<string> LOG_VECTOR;
  16. #define WM_UPDATE_LOG (WM_USER+1001)
  17. typedef struct __GB28181_CHANNEL_T
  18. {
  19. int id;
  20. char sourceURL[260];
  21. Easy_Handle streamClientHandle;
  22. //ATC_HANDLE atcHandle;
  23. EASY_MEDIA_INFO_T mediaInfo;
  24. int videoCodec;
  25. int srcAudioCodec;
  26. int sendStatus;
  27. int videoFrameNum;
  28. int audioOutputFormat;
  29. double longitude;
  30. double latitude;
  31. FILE* fDat;
  32. void* userptr;
  33. }GB28181_CHANNEL_T;
  34. typedef struct __GB28181_DEVICE_T
  35. {
  36. GB28181_CHANNEL_T* pChannel;
  37. }GB28181_DEVICE_T;
  38. #define MAX_GB28181_CHANNEL_NUM 1
  39. typedef struct __GB28181_DEVICE_LIST_T
  40. {
  41. GB28181_DEVICE_T* pGB28181Device;
  42. int nDeviceNum;
  43. bool shareSource;
  44. }GB28181_DEVICE_LIST_T;
  45. // CEasyGBDDemoDlg 对话框
  46. class CEasyGBDDemoDlg : public CDialogEx
  47. {
  48. // 构造
  49. public:
  50. CEasyGBDDemoDlg(CWnd* pParent = nullptr); // 标准构造函数
  51. CEdit* pEdtServerSipID; //IDC_EDIT_SERVER_SIPID
  52. CEdit* pEdtServerIP; //IDC_EDIT_SERVER_IP
  53. CEdit* pEdtServerPort; //IDC_EDIT_SERVER_PORT
  54. CEdit* pEdtRegExpire; //IDC_EDIT_REG_EXPIRE
  55. CEdit* pEdtHeartbeatCount; //IDC_EDIT_HEARTBEAT_COUNT
  56. CEdit* pEdtHeartbeatInterval; //IDC_EDIT_HEARTBEAT_INTERVAL
  57. CComboBox* pComboxProtocol; //IDC_COMBO_PROTOCOL
  58. CEdit* pEdtPassword; //IDC_EDIT_PASSWORD
  59. CEdit* pEdtLocalSipID; //IDC_EDIT_LOCAL_SIPID
  60. CEdit* pEdtLocalPort; //IDC_EDIT_LOCAL_PORT
  61. CEdit* pEdtDeviceName; //IDC_EDIT_DEVICE_NAME
  62. CEdit* pEdtSourceURL; //IDC_EDIT_SOURCE_URL
  63. CButton* pBtnStartup; //IDC_BUTTON_STARTUP
  64. CButton* pBtnShutdown; //IDC_BUTTON_SHUTDOWN
  65. CRichEditCtrl* pRichEditLog; //IDC_RICHEDIT2_LOG
  66. int Startup(const char *serverSIPId, const char *serverIP, const int serverPort,
  67. const int reg_expires, const int heartbeatCount, const int heartbeatInterval,
  68. const int protocol, const char *password, const int deviceNum, const char *localSIPId, const int localPort,
  69. const char *deviceName, const char *sourceURL);
  70. void Shutdown();
  71. GB28181_DEVICE_T mGB28181Device;
  72. GB28181_DEVICE_LIST_T mGB28181DeviceList;
  73. int OutputLog(char* szFormat, ...);
  74. void OutputLog2UI();
  75. void LockLogMutex() { LockMutex(&mLogMutex); }
  76. void UnlockLogMutex() { UnlockMutex(&mLogMutex); }
  77. LOG_VECTOR mLogVector;
  78. OSMutex mLogMutex;
  79. // 对话框数据
  80. #ifdef AFX_DESIGN_TIME
  81. enum { IDD = IDD_EASYGBD_DEMO_DIALOG };
  82. #endif
  83. protected:
  84. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  85. // 实现
  86. protected:
  87. HICON m_hIcon;
  88. // 生成的消息映射函数
  89. virtual BOOL OnInitDialog();
  90. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  91. afx_msg void OnPaint();
  92. afx_msg HCURSOR OnQueryDragIcon();
  93. DECLARE_MESSAGE_MAP()
  94. afx_msg LRESULT OnUpdateLog(WPARAM, LPARAM);
  95. public:
  96. afx_msg void OnBnClickedButtonStart();
  97. afx_msg void OnDestroy();
  98. afx_msg void OnBnClickedButtonShutdown();
  99. afx_msg void OnBnClickedButtonBrowse();
  100. };