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.

52 lines
1.2 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __DATA_MEDIA_IMAGE_SEQUENCE_HEADER__
  2. #define __DATA_MEDIA_IMAGE_SEQUENCE_HEADER__
  3. #include <vector>
  4. #include <stdio.h>
  5. #include <opencv2/opencv.hpp>
  6. #include "dataMediaImage.h"
  7. //#include "../../basic/basicTimeStamp.h"
  8. #include "../../globals/globalToolKit.h"
  9. #define IMAGE_SEQ_DEFAULT_LENGTH 30
  10. #define IMAGE_SEQ_SAVE_IMAGE 1
  11. #define IMAGE_SEQ_SAVE_VIDEO 2
  12. #define IMAGE_SEQ_SAVE_STREAM 3
  13. #define IMAGE_SEQ_SAVE_STORAGE "/tmp"
  14. typedef struct imageSequenceNode{
  15. basicMediaImage *frame;
  16. imageSequenceNode *next;
  17. } imageSequenceNode;
  18. class imageSequence{
  19. private:
  20. imageSequenceNode *head;
  21. imageSequenceNode *tail;
  22. int currentCount;
  23. int maxCount;
  24. bool saveMode;
  25. //basicTimeStamp *TS;
  26. int TS;
  27. int saveCount;
  28. CSTR savePath;
  29. int saveMethod;
  30. void saveImage( basicMediaImage *Img );
  31. cv::Size frameSize;
  32. double framePerSecond;
  33. cv::VideoWriter *videoWriter;
  34. public:
  35. imageSequence();
  36. imageSequence( int frameCount );
  37. ~imageSequence();
  38. bool pushImage( basicMediaImage *Img );
  39. bool alarm( void );
  40. void setSaveMethod( U8 Method, CSTR Destination );
  41. bool flush( void );
  42. };
  43. #endif