Initial commit

This commit is contained in:
Benjamin Sigonneau
2019-03-25 14:57:47 +01:00
commit 9524fff66d
5 changed files with 448 additions and 0 deletions

58
videoplayer.h Normal file
View File

@@ -0,0 +1,58 @@
#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <QWidget>
#include <QLayout>
#include <gst/gst.h>
QT_BEGIN_NAMESPACE
class QAbstractButton;
QT_END_NAMESPACE
class VideoPlayer : public QWidget
{
Q_OBJECT
public:
VideoPlayer(QWidget *parent = nullptr);
~VideoPlayer();
void load(const QUrl &url);
public slots:
void play();
void pause();
void playPause();
void stop();
private slots:
void debugSlot();
void useTcp(bool value);
void setRtspUrl(QString url);
void benSlot();
private:
QList<QWidget *> videoDisplays = {};
QWidget *playerWidget = nullptr;
QAbstractButton *m_stopButton = nullptr;
QAbstractButton *m_playButton = nullptr;
QAbstractButton *m_seekBackwardButton = nullptr;
QAbstractButton *m_seekForwardButton = nullptr;
bool playing = false;
GstElement *pipeline = nullptr;
GstElement *video_sink = nullptr;
bool use_tcp = true;
QString rtspUrl = "rtsp://127.0.0.1:8554/test";
void print_status_of_all();
void initGst();
void setGstTestVideo();
void setGstTestVideo(int pattern);
void setGstFileVideo();
void setGstRtspVideo();
};
#endif