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.

105 lines
2.9 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __VIDEO_WIDGET_HEADER__
  2. #define __VIDEO_WIDGET_HEADER__
  3. //#define USE_OPENGL
  4. #include <vector>
  5. #include "../guiClass.h"
  6. #include "../../components/base/basicLIBAV.h"
  7. #include "../../components/base/basicMediaDestination.h"
  8. #include "../../components/base/basicMutex.h"
  9. #include "../../components/base/basicCameraPTZ.h"
  10. #include "../../components/base/basicStatus.h"
  11. #include "../../hardware/stick/joystick.h"
  12. #include <opencv2/opencv.hpp>
  13. #ifdef USE_OPENGL
  14. #include "FSGLVideoWidget.h"
  15. #else
  16. #include "FSVideoWidget.h"
  17. #endif
  18. class VideoWidget : public QWidget, public basicMediaDestination {
  19. private:
  20. U8 m_bStatus;
  21. int m_nMouseX;
  22. int m_nMouseY;
  23. U32 m_nKeyCode;
  24. U32 m_nOldKeyCode;
  25. basicLogCollection *m_pLog;
  26. ControlDirection m_nManualControlMode;
  27. #ifndef NO_JOYSTICK
  28. joysticObject *m_pJO;
  29. #endif
  30. bool m_bMouseActive;
  31. int m_nMenuActivityCounter;
  32. bool m_bGrayScale;
  33. bool m_bEnhanced;
  34. bool m_bDirectDrawing;
  35. bool m_bFullScreenView;
  36. objectCaps m_nCameraCaps;
  37. basicCamera *m_pCamera;
  38. QFrame *m_pBorder;
  39. QDialog *m_pFullScreenView;
  40. FrameAspectRatio m_eWidgetAspectRatio;
  41. FrameAspectRatio m_eStreamAspectRatio;
  42. IplImage *m_pGraber;
  43. cv::Mat *m_mFrame;
  44. cv::Mat *m_mOutput;
  45. //basicVideoSource *m_pCapture;
  46. basicMutex *m_pPropertiesProtectorMutex;
  47. basicMutex *m_pWidgetProtectorMutex;
  48. void m_fThreadProc(void);
  49. protected:
  50. //QPixmap *m_pFSPixmap;
  51. virtual void resizeEvent(QResizeEvent *event);
  52. #ifdef USE_OPENGL
  53. FSGLVideoWidget *m_pFSVideoWidget;
  54. #else
  55. FSVideoWidget *m_pFSVideoWidget;
  56. #endif
  57. QPixmap *m_pPixmap;
  58. //QPixmap *m_pOverlayPixmap;
  59. QPixmap *m_pManualMode;
  60. QPixmap *m_pPixUp;
  61. QPixmap *m_pPixDown;
  62. QPixmap *m_pPixLeft;
  63. QPixmap *m_pPixRight;
  64. QPixmap *m_pPixWide;
  65. QPixmap *m_pPixTele;
  66. public:
  67. explicit VideoWidget(QWidget *parent = NULL);
  68. ~VideoWidget();
  69. virtual void render(QPainter *painter);
  70. bool init( void );
  71. virtual void pushFrame(cv::Mat *Frame, void *src = NULL);
  72. void showFullScreen(void);
  73. void hideFullScreen(void);
  74. void showSettingsWindow( bool doModal );
  75. void setCameraControl(basicCamera *C, objectCaps CC);
  76. void setGrayScale( bool AAA );
  77. void setEnhanced( bool AAA );
  78. void setSoutceType( int Type );
  79. //public slots:
  80. void renderLater();
  81. void renderNow();
  82. QSize sizeHint() const;
  83. protected:
  84. bool event(QEvent *event);
  85. //void resizeEvent(QResizeEvent *event);
  86. void exposeEvent(QExposeEvent *event);
  87. void paintEvent(QPaintEvent *event);
  88. //void drawContents(QPainter * p, const QRectF & rect = QRectF());
  89. private:
  90. bool m_bUpdateIsPending;
  91. QTimer *m_pTimer;
  92. };
  93. #endif