videolabel.h 873 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef VIDEOLABEL_H
  2. #define VIDEOLABEL_H
  3. #include <QWidget>
  4. #include <QString>
  5. #include <QLabel>
  6. #include <QImage>
  7. #include <QMediaPlayer>
  8. #include <QMediaPlaylist>
  9. #include <QSize>
  10. #include <QMutex>
  11. #include "videoframeprocessor.h"
  12. class VideoLabel : public QLabel
  13. {
  14. Q_OBJECT
  15. signals:
  16. void medialLoaded();
  17. public:
  18. explicit VideoLabel(QString path, QString filename, QWidget *parent = 0);
  19. ~VideoLabel();
  20. bool videoError();
  21. QSize getResolution() { return vfp.mediaResolution; }
  22. bool hasFrame() { return m_medialLoaded; }
  23. bool resolution_set;
  24. private:
  25. QString m_path;
  26. QString m_filename;
  27. VideoFrameProcessor vfp;
  28. QMediaPlayer mediaPlayer;
  29. QMediaPlaylist playlist;
  30. bool m_videoError;
  31. bool m_medialLoaded;
  32. QMutex mutex;
  33. private slots:
  34. void OnNewFrame(QImage newVideoFrame);
  35. };
  36. #endif // VIDEOLABEL_H