-
Notifications
You must be signed in to change notification settings - Fork 10
/
videocompositor.h
54 lines (45 loc) · 1.3 KB
/
videocompositor.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
#ifndef VIDEOCOMPOSITOR_H
#define VIDEOCOMPOSITOR_H
#include "flvtag.h"
#include "videocap.h"
#include <QUuid>
#include <QSharedPointer>
extern "C"
{
#include <x264.h>
#include <libswscale/swscale.h>
}
class VideoCompositor : public VideoCap
{
Q_OBJECT
public:
explicit VideoCompositor(QSize resolution, double fps = DEFAULT_FPS, QObject *parent = 0);
virtual void setFps(double fps);
void setResolution(QSize resolution);
void setBackgroundImage(QImage);
void setForegroundImage(QImage);
// VideoCompositor takes possession of 'source'. and frees it when done
QUuid addSource(VideoCap *source, QRect position = QRect(), int zorder = 0, double opacity = 1.0);
bool modifySource(QUuid id, QRect position, int zorder, double opacity);
bool removeSource(QUuid id);
bool removeAllSources();
signals:
void flvTag(FlvTag);
private slots:
virtual void doGrabFrame(QImage &frame);
private:
QSize m_resolution;
QMutex m_mutex;
public:
struct CompositeInfo
{
QSharedPointer<VideoCap> m_capSource;
QUuid m_id;
QRect m_position;
int m_zorder;
double m_opacity;
};
private:
QList<CompositeInfo> m_capSource;
};
#endif // VIDEOCOMPOSITOR_H