4 #include <QGraphicsWidget>
5 #include <QGraphicsItem>
11 #include "dronecontrol.h"
12 #undef _GNU_SOURCE // just get rid of error message double definition
13 #define TARGET_CPU_ARM 1
15 #include <VP_Os/vp_os_malloc.h>
16 #include <VP_Os/vp_os_print.h>
19 #include <VLIB/Stages/vlib_stage_decode.h>
20 void vp_stages_YUV420P_to_RGB565(void *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes);
27 class DroneVideo:public QGraphicsWidget
32 void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
34 QRectF boundingRect() const;
37 QHostAddress droneHost; // Ip address of the drone
38 VideoThread *videoThread;
43 class VideoThread:public QThread {
46 VideoThread(DroneVideo *parentp,QHostAddress host,QImage *_image);
50 void sendVideoPort(QString cmd);
51 void decodeTransform(QByteArray &videoData);
54 void videoDataReady();
61 video_controller_t controller;
62 vp_api_picture_t picture;
66 unsigned int num_picture_decoded;
67 QHostAddress droneHost; // Ip address of the drone
69 volatile bool stopped;
71 QUdpSocket *videoSock; // Navigation data receive socket port 5554