VidMag
Eulerian Video Magnification
VideoPlayer.h
Go to the documentation of this file.
1 #ifndef VIDEOPLAYER_H
2 #define VIDEOPLAYER_H
3 #include <QMutex>
4 #include <QThread>
5 #include <QImage>
6 #include <QWaitCondition>
7 #include <opencv2/core/core.hpp>
8 #include <opencv2/imgproc/imgproc.hpp>
9 #include <opencv2/highgui/highgui.hpp>
10 #include <VideoManager.hpp>
11 
12 using namespace cv;
13 class VideoPlayer : public QThread
14 {
15  Q_OBJECT
16 private:
17  VideoManager* vidMgr;
18 
19  bool stop;
20  QMutex mutex;
21  QWaitCondition condition;
22  Mat frame;
23  int frameRate;
24 
25  Mat RGBframe;
26  QImage img;
27 signals:
28  void processedImage(const QImage &image); //signal for processed video frame
29 protected:
30  void run();
31  void msleep(int ms);
32 public:
33  VideoPlayer(VideoManager* videoManager, QObject *parent = 0);
34  ~VideoPlayer();
35 
36  bool loadVideo(std::string filename); //set input in VideoManager
37  void Play(); //start playback
38  void Stop(); //stop playback
39  bool isStopped() const; //is playback stopped?
40 
41  void setCurrentFrame(int frameNumber); //jump to specific frame
42 
43  //video properties
44  double getFrameRate();
45  double getCurrentFrame();
46  double getNumberOfFrames();
47 };
48 #endif // VIDEOPLAYER_H
Definition: VideoManager.hpp:41
Definition: VideoPlayer.h:13