EasyGBD_DemoDlg.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. int videoCodec;
  24. int srcAudioCodec;
  25. int sendStatus;
  26. int audioOutputFormat;
  27. double longitude;
  28. double latitude;
  29. FILE* fDat;
  30. void* userptr;
  31. }GB28181_CHANNEL_T;
  32. typedef struct __GB28181_DEVICE_T
  33. {
  34. GB28181_CHANNEL_T* pChannel;
  35. }GB28181_DEVICE_T;
  36. #define MAX_GB28181_CHANNEL_NUM 1
  37. // CEasyGBDDemoDlg 对话框
  38. class CEasyGBDDemoDlg : public CDialogEx
  39. {
  40. // 构造
  41. public:
  42. CEasyGBDDemoDlg(CWnd* pParent = nullptr); // 标准构造函数
  43. CEdit* pEdtServerSipID; //IDC_EDIT_SERVER_SIPID
  44. CEdit* pEdtServerIP; //IDC_EDIT_SERVER_IP
  45. CEdit* pEdtServerPort; //IDC_EDIT_SERVER_PORT
  46. CEdit* pEdtRegExpire; //IDC_EDIT_REG_EXPIRE
  47. CEdit* pEdtHeartbeatCount; //IDC_EDIT_HEARTBEAT_COUNT
  48. CEdit* pEdtHeartbeatInterval; //IDC_EDIT_HEARTBEAT_INTERVAL
  49. CComboBox* pComboxProtocol; //IDC_COMBO_PROTOCOL
  50. CEdit* pEdtPassword; //IDC_EDIT_PASSWORD
  51. CEdit* pEdtLocalSipID; //IDC_EDIT_LOCAL_SIPID
  52. CEdit* pEdtLocalPort; //IDC_EDIT_LOCAL_PORT
  53. CEdit* pEdtSourceURL; //IDC_EDIT_SOURCE_URL
  54. CButton* pBtnStartup; //IDC_BUTTON_STARTUP
  55. CButton* pBtnShutdown; //IDC_BUTTON_SHUTDOWN
  56. CRichEditCtrl* pRichEditLog; //IDC_RICHEDIT2_LOG
  57. int Startup(const char *serverSIPId, const char *serverIP, const int serverPort,
  58. const int reg_expires, const int heartbeatCount, const int heartbeatInterval,
  59. const int protocol, const char *password, const char *localSIPId, const int localPort, const char *sourceURL);
  60. void Shutdown();
  61. GB28181_DEVICE_T mGB28181Device;
  62. int OutputLog(char* szFormat, ...);
  63. void OutputLog2UI();
  64. void LockLogMutex() { LockMutex(&mLogMutex); }
  65. void UnlockLogMutex() { UnlockMutex(&mLogMutex); }
  66. LOG_VECTOR mLogVector;
  67. OSMutex mLogMutex;
  68. // 对话框数据
  69. #ifdef AFX_DESIGN_TIME
  70. enum { IDD = IDD_EASYGBD_DEMO_DIALOG };
  71. #endif
  72. protected:
  73. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  74. // 实现
  75. protected:
  76. HICON m_hIcon;
  77. // 生成的消息映射函数
  78. virtual BOOL OnInitDialog();
  79. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  80. afx_msg void OnPaint();
  81. afx_msg HCURSOR OnQueryDragIcon();
  82. DECLARE_MESSAGE_MAP()
  83. afx_msg LRESULT OnUpdateLog(WPARAM, LPARAM);
  84. public:
  85. afx_msg void OnBnClickedButtonStart();
  86. afx_msg void OnDestroy();
  87. afx_msg void OnBnClickedButtonShutdown();
  88. afx_msg void OnBnClickedButtonBrowse();
  89. };