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.

66 lines
1.8 KiB

8 years ago
​
​
​
8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 years ago
​
​
  1. #ifndef __OBJECTEVENTREPORT_H_INCL__
  2. #define __OBJECTEVENTREPORT_H_INCL__
  3. #include <time.h>
  4. #include <vector>
  5. #include "../base/basicFunctionality.h"
  6. #include "../base/basicEventHandler.h"
  7. #include "../../data/storage/storageProvider.h"
  8. #include "../base/basicSettings.h"
  9. #include "../base/basicReportRecord.h"
  10. #include "../base/basicCamera.h"
  11. typedef struct S_REPORT_RECORD {
  12. uint32_t chunk_size; //4
  13. uint32_t ms; //4
  14. uint16_t ums; //2
  15. uint8_t cls_id; //1
  16. uint8_t type; //1
  17. uint32_t src; //4
  18. uint8_t media_type; //1
  19. uint8_t media_count; //1
  20. uint16_t data_size; //2
  21. //----------------------------------- 20 bytes = Fixed Size Header
  22. void * data;
  23. uint8_t media_allocated;
  24. char ** media_names;
  25. uint32_t * media_markers;
  26. }REPORT_RECORD;
  27. #define REPORT_RECORD_HEADER_SIZE 20
  28. typedef std::vector<char*> Rere;
  29. class mediaVideoSourceManager;
  30. /**
  31. * TODO: Add class description
  32. *
  33. * @author Gagua
  34. */
  35. class objectEventReport : public basicEventHandler {
  36. private:
  37. storageProvider * m_pStorageProvider;
  38. basicSettings * m_pSettingsEngine;
  39. mediaVideoSourceManager * m_pMediaManager;
  40. char m_pReportFileName[MAX_PATH];
  41. bool saveReportRecord(REPORT_RECORD *Record);
  42. bool getMedia(REPORT_RECORD* Record);
  43. bool prefill(basicEvent* Evt, REPORT_RECORD* Record);
  44. bool utilize(REPORT_RECORD* Record);
  45. REPORT_RECORD * loadReportRecord(FILE* FD);
  46. Rere m_vLoaddedReports;
  47. public:
  48. static objectEventReport *getInstance(void);
  49. virtual ~objectEventReport(void);
  50. void dispatchEvent( basicEvent *Evt);
  51. bool loadReportList(struct tm *LTM);
  52. Rere * getLoaddedReports(void);
  53. private:
  54. static objectEventReport *_instance;
  55. protected:
  56. objectEventReport(void);
  57. };
  58. #endif // __OBJECTEVENTREPORT_H_INCL__