-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathmonitorwindow.h
65 lines (53 loc) · 1.15 KB
/
monitorwindow.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
59
60
61
62
63
64
65
#ifndef MONITORWINDOW_H
#define MONITORWINDOW_H
#include <QObject>
#include <QLabel>
#include <QString>
class QFFmpeg;
class RtspThread;
//监视窗口,视频图像就显示在监视窗口上
class MonitorWindow : public QLabel
{
Q_OBJECT
public:
MonitorWindow(QWidget *parent);
~MonitorWindow();
public slots:
//判断窗口是否在播放中
bool isPlaying() const;
//判断窗口是否在录制中
bool isRecording() const;
//判断窗口是否出于活动状态
bool isActive() const;
//获得窗口的解码器
QFFmpeg* ffmpeg() const;
//设置窗口的url路径
void setUrl(QString& url);
void setRtspUrl(QString& rtsp_url);
//设置窗口视频的录制文件的输出路径
void setOutPath(QString& path,QString& format);
//开始播放
void startPlaying();
//暂停播放
void pausePlaying();
//继续播放
void resumePlaying();
//开始录制
void startRecording();
//停止录制
void stopRecording();
//关闭播放和录制,此时isActive会返回false
void stop();
//把一帧图像设置到窗口上显示
void setImage(const QImage& img);
private:
RtspThread *m_thread;
QFFmpeg *m_ffmpeg;
QString m_url;
QString m_recordPath;
QString m_format;
bool m_isRecording;
bool m_isPlaying;
bool m_isActive;
};
#endif // MONITORWINDOW_H