-
Notifications
You must be signed in to change notification settings - Fork 1
/
rtspwidget.h
48 lines (35 loc) · 995 Bytes
/
rtspwidget.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
#pragma once
#include <QLabel>
#include <QMutex>
#include <QDateTime>
#include "rtspvideostreamdecoder.h"
class RtspWidget : public QLabel
{
Q_OBJECT
QTimer * checkNewFrameTimer = nullptr;
QMutex mtx;
AVFrame * frameForShow = nullptr;
QString infoText;
RtspVideoStreamDecoder * rtsp = nullptr;
QDateTime lastFrameDt;
int maxFrameDelay = 3000;
void mousePressEvent(QMouseEvent* event) override;
public:
explicit RtspWidget(QWidget *parent = nullptr);
void setUpdateInterval(int msec);
void setMaxFrameDelay(int msec);
signals:
void started();
void stopped();
void clicked();
public slots:
void start(const QString & rtsp_url);
void stop();
private slots:
void onRtspVideoStreamDecoderStarted();
void onRtspVideoStreamDecoderFinished();
void onRtspInfoChanged(QString info);
void onRtspNewFrame(AVFrame * frame);
void displayFrame (const AVFrame * fr);
void onCheckNewFrameTimerTimeout();
};