videoframeprocessor.h 886 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef VIDEOFRAMEPROCESSOR_H
  2. #define VIDEOFRAMEPROCESSOR_H
  3. #include <QObject>
  4. #include <QAbstractVideoSurface>
  5. #include <QAbstractVideoBuffer>
  6. #include <QVideoFrame>
  7. #include <QList>
  8. #include <QSize>
  9. #include <QImage>
  10. #include <QString>
  11. //#include <QTimer>
  12. class VideoFrameProcessor : public QAbstractVideoSurface
  13. {
  14. Q_OBJECT
  15. signals:
  16. void medialLoaded();
  17. void newFrame(QImage);
  18. public:
  19. explicit VideoFrameProcessor(QObject *parent = 0);
  20. ~VideoFrameProcessor();
  21. bool present(const QVideoFrame& frame);
  22. QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const;
  23. bool isFormatSupported(const QVideoSurfaceFormat &format) const;
  24. //QImage curFrame;
  25. QSize mediaResolution;
  26. bool hasFrame;
  27. // QTimer timer;
  28. private:
  29. private slots:
  30. void OnFrameTimeout();
  31. };
  32. #endif // VIDEOFRAMEPROCESSOR_H