-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvideoplayer.h
77 lines (59 loc) · 1.47 KB
/
videoplayer.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
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <QDebug>
#include <QGroupBox>
#include <QFileDialog>
#include <QGlib/Connect>
#include <QGst/Parse>
#include <QGst/Pipeline>
#include <QGst/Bus>
#include <QGst/Message>
#include <QGst/Query>
#include <QGst/Event>
#include "mediasourcebase.h"
#include "audioappsink.h"
#include "videoappsink.h"
namespace Ui {
class VideoPlayer;
}
class VideoPlayer : public MediaSourceBase
{
Q_OBJECT
public:
/// PROPERTIES ///
bool getLoop();
void setLoop(bool newState);
/// METHODS ///
explicit VideoPlayer(QWidget *parent = 0);
~VideoPlayer();
void init(QString videocaps, QString audiocaps);
void setPosition(const QTime & pos);
private slots:
void selectFolder();
void newFileSelected(QString newFile);
void goButtonClicked();
void onStateChanged();
void onPositionChanged();
void updatePositionLabel(QTime len, QTime pos);
void setPosition(int position);
public slots:
void play();
void pause();
void playOrPause();
void stop();
void prevFile();
void nextFile();
signals:
void loopChanged(bool newState);
private:
Ui::VideoPlayer *ui;
QString currentDir;
QString videocaps;
QString audiocaps;
QTimer positionTimer;
QTime length() const;
QTime position() const;
void onBusMessage(const QGst::MessagePtr & message);
void handlePipelineStateChange(const QGst::StateChangedMessagePtr & scm);
};
#endif // VIDEOPLAYER_H