-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathmyvideosurface.h
36 lines (27 loc) · 983 Bytes
/
myvideosurface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef MYVIDEOSURFACE_H
#define MYVIDEOSURFACE_H
#include <QAbstractVideoSurface>
class MyVideoSurface : public QAbstractVideoSurface
{
Q_OBJECT
public:
MyVideoSurface(QObject *parent = 0);
//支持的像素格式
QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const override;
//检测视频流的格式是否合法,返回bool
bool isFormatSupported(const QVideoSurfaceFormat &format) const override;
bool start(const QVideoSurfaceFormat &format) override;
bool present(const QVideoFrame &frame) override;
QRect videoRect() const;
void updateVideoRect();
void paint(QPainter *painter);
//private:
// QWidget * widget_;
// QImage::Format imageFormat_;
// QRect targetRect_;
// QSize imageSize_;
// QVideoFrame currentFrame_;
signals:
void frameAvailable(QVideoFrame);
};
#endif // MYVIDEOSURFACE_H