-
Notifications
You must be signed in to change notification settings - Fork 1
/
mycamera.h
58 lines (44 loc) · 1.31 KB
/
mycamera.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef MYCAMERA_H
#define MYCAMERA_H
#include <QObject>
#include <QCamera>
#include <QVideoFrame>
#include <QVideoSurfaceFormat>
#include <QImage>
#include <QAbstractVideoSurface>
#include <qdeclarative.h>
#include <QDeclarativeItem>
#include <videosurface.h>
class MyCamera : public QDeclarativeItem
{
Q_OBJECT
public:
explicit MyCamera(QDeclarativeItem *parent = 0);
protected:
//void paintEvent(QPaintEvent *);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
signals:
public slots:
void repaint();
void output(QCamera::Error err);
private:
QCamera *m_camera;
myVideoSurface *videoSurface;
};
/*class MySurface : public QAbstractVideoSurface
{
public:
MySurface(QObject *parent = 0);
bool isFormatSupported ( const QVideoSurfaceFormat & format ) const;
bool present(const QVideoFrame & frame);
bool start(const QVideoSurfaceFormat & format);
void stop();
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
QVideoSurfaceFormat nearestFormat ( const QVideoSurfaceFormat & format ) const;
QImage currentFrame;
QImage backBuffer;
QImage::Format m_imageFormat;
QVideoSurfaceFormat m_videoFormat;
};*/
#endif // MYCAMERA_H