#ifndef MYVIDEOSURFACE_H #define MYVIDEOSURFACE_H #include #include #include #include #include #include #include #include class VideoIF { public: virtual void updateVideo() = 0; }; class MyVideoSurface: public QAbstractVideoSurface { Q_OBJECT public: MyVideoSurface(QWidget* widget, VideoIF* target, QObject * parent = 0); ~MyVideoSurface(); bool start(const QVideoSurfaceFormat &format); bool present(const QVideoFrame &frame); QList supportedPixelFormats( QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; void paint(QPainter*); private: QWidget* m_targetWidget; VideoIF* m_target; QVideoFrame m_frame; QImage::Format m_imageFormat; QVideoSurfaceFormat m_videoFormat; }; #endif // MYVIDEOSURFACE_H