class VideoThread;
-
-class DroneVideo:public QGraphicsWidget
-{
- Q_OBJECT
-public:
- DroneVideo();
- void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
- QWidget *widget);
- QRectF boundingRect() const;
-
-private:
- QHostAddress droneHost; // Ip address of the drone
- VideoThread *videoThread;
- QImage *image;
- int depth;
- bool initialized;
-};
+class DroneVideo;
class VideoThread:public QThread {
Q_OBJECT
void run();
void sendVideoPort(QString cmd);
void decodeTransform(QByteArray &videoData);
+ unsigned int getFrameSeq();
+ bool getVideoRec();
+ bool getVideoPlay();
+ QString getVideoFileName();
+ void setVideoFileName(QString name);
+signals:
+ void frameSeqChanged();
public slots:
void videoDataReady();
+ void setVideoRec(bool rec);
+
+ void setVideoPlay(bool play);
void timer();
int pictureWidth;
int pictureHeight;
bool luma_only;
+ bool videoRec;
+ bool videoPlay;
+ QFile *videoFile;
+ QString videoFileName;
+ unsigned int frameSeq;
unsigned int num_picture_decoded;
QHostAddress droneHost; // Ip address of the drone
QTimer *stateTimer;
};
+class DroneVideo:public QGraphicsWidget
+{
+ Q_OBJECT
+public:
+
+ DroneVideo();
+ void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
+ QWidget *widget);
+ QRectF boundingRect() const;
+ Q_PROPERTY(QImage* idleImage READ idleImage WRITE setIdleImage )
+ Q_PROPERTY(bool recVideo READ recVideo WRITE setRecVideo )
+ Q_PROPERTY(bool playVideo READ playVideo WRITE setPlayVideo )
+ Q_PROPERTY(QString videoFileName READ videoFileName WRITE setVideoFileName NOTIFY frameSeqChanged)
+ Q_PROPERTY(unsigned int frameSeq READ frameSeq NOTIFY frameSeqChanged)
+
+
+ QImage* idleImage(); void setIdleImage(QImage *);
+ void setRecVideo(bool val_) { if(videoThread) videoThread->setVideoRec(val_);};
+ bool recVideo() {return videoThread ? videoThread->getVideoRec():false;};
+
+ void setPlayVideo(bool val_) { if(videoThread) videoThread->setVideoPlay(val_);};
+ bool playVideo() {return videoThread ? videoThread->getVideoPlay():false;};
+
+ int frameSeq() {return videoThread ? videoThread->getFrameSeq():0;};
+
+ QString videoFileName() const { return videoThread ? videoThread->getVideoFileName():"";};
+ void setVideoFileName(const QString &name_) {if(videoThread) videoThread->setVideoFileName(name_);}
+signals:
+ void frameSeqChanged();
+
+public slots:
+ void frameSeqUpdated();
+private:
+ QHostAddress droneHost; // Ip address of the drone
+
+ VideoThread *videoThread;
+ QImage *image;
+ QImage *m_idleImage;
+ int depth;
+ bool initialized;
+};
+
+
#endif // VIDEO_H