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.8 KiB
105 lines
2.8 KiB
#ifndef __VIDEO_WIDGET_HEADER__
|
|
#define __VIDEO_WIDGET_HEADER__
|
|
|
|
//#define USE_OPENGL
|
|
|
|
#include <vector>
|
|
#include "../guiClass.h"
|
|
#include <opencv2/opencv.hpp>
|
|
#include "../../components/base/basicLIBAV.h"
|
|
#include "../../components/base/basicMediaDestination.h"
|
|
#include "../../components/base/basicMutex.h"
|
|
#include "../../components/base/basicCameraPTZ.h"
|
|
#include "../../components/base/basicStatus.h"
|
|
#include "../../hardware/stick/joystick.h"
|
|
#ifdef USE_OPENGL
|
|
#include "FSGLVideoWidget.h"
|
|
#else
|
|
#include "FSVideoWidget.h"
|
|
#endif
|
|
class VideoWidget : public QWidget, public basicMediaDestination {
|
|
private:
|
|
U8 m_bStatus;
|
|
int m_nMouseX;
|
|
int m_nMouseY;
|
|
|
|
U32 m_nKeyCode;
|
|
U32 m_nOldKeyCode;
|
|
|
|
ControlDirection m_nManualControlMode;
|
|
#ifndef NO_JOYSTICK
|
|
joysticObject *m_pJO;
|
|
#endif
|
|
bool m_bMouseActive;
|
|
int m_nMenuActivityCounter;
|
|
bool m_bGrayScale;
|
|
bool m_bEnhanced;
|
|
bool m_bDirectDrawing;
|
|
bool m_bFullScreenView;
|
|
objectCaps m_nCameraCaps;
|
|
basicCamera *m_pCamera;
|
|
QFrame *m_pBorder;
|
|
QDialog *m_pFullScreenView;
|
|
FrameAspectRatio m_eWidgetAspectRatio;
|
|
FrameAspectRatio m_eStreamAspectRatio;
|
|
|
|
IplImage *m_pGraber;
|
|
cv::Mat *m_mFrame;
|
|
cv::Mat *m_mOutput;
|
|
|
|
//basicVideoSource *m_pCapture;
|
|
basicMutex *m_pPropertiesProtectorMutex;
|
|
basicMutex *m_pWidgetProtectorMutex;
|
|
void m_fThreadProc(void);
|
|
|
|
protected:
|
|
//QPixmap *m_pFSPixmap;
|
|
virtual void resizeEvent(QResizeEvent *event);
|
|
#ifdef USE_OPENGL
|
|
FSGLVideoWidget *m_pFSVideoWidget;
|
|
#else
|
|
FSVideoWidget *m_pFSVideoWidget;
|
|
#endif
|
|
QPixmap *m_pPixmap;
|
|
//QPixmap *m_pOverlayPixmap;
|
|
QPixmap *m_pManualMode;
|
|
QPixmap *m_pPixUp;
|
|
QPixmap *m_pPixDown;
|
|
QPixmap *m_pPixLeft;
|
|
QPixmap *m_pPixRight;
|
|
QPixmap *m_pPixWide;
|
|
QPixmap *m_pPixTele;
|
|
public:
|
|
|
|
explicit VideoWidget(QWidget *parent = NULL);
|
|
~VideoWidget();
|
|
|
|
virtual void render(QPainter *painter);
|
|
|
|
bool init( void );
|
|
virtual void pushFrame(cv::Mat *Frame, void *src = NULL);
|
|
void showFullScreen(void);
|
|
void hideFullScreen(void);
|
|
void showSettingsWindow( bool doModal );
|
|
void setCameraControl(basicCamera *C, objectCaps CC);
|
|
void setGrayScale( bool AAA );
|
|
void setEnhanced( bool AAA );
|
|
void setSoutceType( int Type );
|
|
|
|
//public slots:
|
|
void renderLater();
|
|
void renderNow();
|
|
QSize sizeHint() const;
|
|
protected:
|
|
bool event(QEvent *event);
|
|
|
|
//void resizeEvent(QResizeEvent *event);
|
|
void exposeEvent(QExposeEvent *event);
|
|
void paintEvent(QPaintEvent *event);
|
|
//void drawContents(QPainter * p, const QRectF & rect = QRectF());
|
|
private:
|
|
bool m_bUpdateIsPending;
|
|
QTimer *m_pTimer;
|
|
};
|
|
|
|
#endif
|