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.

84 lines
2.4 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __FULL_SCREEN_VIDEO_WIDGET_HEADER__
  2. #define __FULL_SCREEN_VIDEO_WIDGET_HEADER__
  3. #include <vector>
  4. #include "../guiClass.h"
  5. #include <opencv2/opencv.hpp>
  6. #include "../../components/base/basicLIBAV.h"
  7. #include "../../components/base/basicMediaDestination.h"
  8. #include "../../components/base/basicMutex.h"
  9. #include "../../components/base/basicCamera.h"
  10. #include "../../components/base/basicCameraPTZ.h"
  11. #include "../../components/base/basicStatus.h"
  12. class FSVideoWidget : public QWidget, public basicMediaDestination {
  13. private:
  14. U8 m_bStatus;
  15. int m_nMouseX;
  16. int m_nMouseY;
  17. U32 m_nKeyCode;
  18. U32 m_nOldKeyCode;
  19. ControlDirection m_nManualControlMode;
  20. //bool m_bMouseActive;
  21. int m_nMenuActivityCounter;
  22. bool m_bGrayScale;
  23. bool m_bEnhanced;
  24. bool m_bDirectDrawing;
  25. FrameAspectRatio m_eWidgetAspectRatio;
  26. FrameAspectRatio m_eStreamAspectRatio;
  27. IplImage *m_pGraber;
  28. cv::Mat *m_mFrame;
  29. cv::Mat *m_mOutput;
  30. objectCaps m_nCameraCaps;
  31. basicCamera *m_pCamera;
  32. basicMediaDestination *m_pParentViewer;
  33. basicMutex *m_pPropertiesProtectorMutex;
  34. basicMutex *m_pWidgetProtectorMutex;
  35. void m_fThreadProc(void);
  36. protected:
  37. QPixmap *m_pPixmap;
  38. //QPixmap *m_pOverlayPixmap;
  39. QPixmap *m_pManualMode;
  40. QPixmap *m_pPixUp;
  41. QPixmap *m_pPixDown;
  42. QPixmap *m_pPixLeft;
  43. QPixmap *m_pPixRight;
  44. QPixmap *m_pPixWide;
  45. QPixmap *m_pPixTele;
  46. public:
  47. explicit FSVideoWidget(QWidget *parent = NULL);
  48. ~FSVideoWidget();
  49. virtual void render(QPainter *painter);
  50. void setCameraControl(basicCamera *C, objectCaps CC);
  51. bool init( void );
  52. virtual void pushFrame(cv::Mat *Frame, void *src = NULL);
  53. void showSettingsWindow( bool doModal );
  54. void setGrayScale( bool AAA );
  55. void setEnhanced( bool AAA );
  56. void setSoutceType( int Type );
  57. void setBindingSize( basicMediaDestination *P, int x, int y);
  58. //public slots:
  59. void renderLater();
  60. void renderNow();
  61. protected:
  62. bool event(QEvent *event);
  63. //void resizeEvent(QResizeEvent *event);
  64. void exposeEvent(QExposeEvent *event);
  65. void paintEvent(QPaintEvent *event);
  66. //void drawContents(QPainter * p, const QRectF & rect = QRectF());
  67. private:
  68. bool m_bUpdateIsPending;
  69. QTimer *m_pTimer;
  70. };
  71. #endif