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.

86 lines
2.5 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __VIDEO_THUMB_WIDGET_HEADER__
  2. #define __VIDEO_THUMB_WIDGET_HEADER__
  3. #ifndef __linux__
  4. #include <winsock2.h>
  5. #include <ws2tcpip.h>
  6. #endif
  7. #include <vector>
  8. #include <opencv2/opencv.hpp>
  9. #include "../../components/base/basicLIBAV.h"
  10. #include "../../components/base/basicMediaDestination.h"
  11. //#include "../../components/base/basicMediaViewer.h"
  12. #include "../../components/base/basicMutex.h"
  13. #include "../guiClass.h"
  14. class DialogSettingsCamera;
  15. class VideoSourceChooser;
  16. class basicCamera;
  17. class VideoThumbWidget : public QWidget, public basicMediaDestination {
  18. //class VideoThumbWidget : public QWidget, public basicMediaViewer{
  19. private:
  20. U8 m_bStatus;
  21. int m_nMouseX;
  22. int m_nMouseY;
  23. bool m_bMouseActive;
  24. bool m_bSelected;
  25. int m_nMenuActivityCounter;
  26. bool m_bGrayScale;
  27. bool m_bEnhanced;
  28. bool m_bErrorMode;
  29. CSTR m_pErrorMsg;
  30. bool m_bDirectDrawing;
  31. basicCamera *m_pSignalParameter;
  32. VideoSourceChooser *m_pParent;
  33. DialogSettingsCamera *m_pSettingsDialog;
  34. FrameAspectRatio m_eWidgetAspectRatio;
  35. FrameAspectRatio m_eStreamAspectRatio;
  36. IplImage *m_pGraber;
  37. cv::Mat *m_mFrame;
  38. cv::Mat *m_mOutput;
  39. //basicVideoSource *m_pCapture;
  40. basicMutex *m_pPropertiesProtectorMutex;
  41. basicMutex *m_pWidgetProtectorMutex;
  42. void m_fThreadProc(void);
  43. protected:
  44. QPixmap *m_pPixmap;
  45. QPixmap *m_pOverlayPixmap;
  46. public:
  47. explicit VideoThumbWidget(QWidget *parent = NULL);
  48. ~VideoThumbWidget();
  49. virtual void render(QPainter *painter);
  50. bool init( void );
  51. virtual void pushFrame(cv::Mat *Frame, void *src = NULL);
  52. void setSignalParameter(VideoSourceChooser *P, basicCamera *A){ m_pParent = P; m_pSignalParameter = A; };
  53. void showSettingsWindow( bool doModal );
  54. void setSourceType(int Type);
  55. void setError( bool AAA, CSTR Message = NULL );
  56. signals:
  57. void selected(void *P);
  58. public slots:
  59. void setGrayScale();
  60. void setEnhanced();
  61. void showCameraSettings();
  62. void removeThisCamera();
  63. void renderLater();
  64. void renderNow();
  65. void ShowContextMenu(const QPoint &pos);
  66. protected:
  67. bool event(QEvent *event);
  68. //void resizeEvent(QResizeEvent *event);
  69. void exposeEvent(QExposeEvent *event);
  70. void paintEvent(QPaintEvent *event);
  71. //void drawContents(QPainter * p, const QRectF & rect = QRectF());
  72. private:
  73. bool m_bUpdateIsPending;
  74. QTimer *m_pTimer;
  75. };
  76. #endif