Skip to content

Commit

Permalink
Remove all conditional compile checks in vidstream
Browse files Browse the repository at this point in the history
  • Loading branch information
steveatinfincia committed Oct 31, 2019
1 parent dd7937f commit 583f274
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
8 changes: 0 additions & 8 deletions inc/openhdvideostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

#include <QObject>

#if defined(ENABLE_VIDEO)
#include "../src/VideoStreaming/VideoStreaming.h"
#include "../src/VideoStreaming/VideoSurface.h"
#include "../src/VideoStreaming/VideoReceiver.h"
#endif

class OpenHDVideoStream : public QObject
{
Expand All @@ -17,18 +15,14 @@ class OpenHDVideoStream : public QObject
OpenHDVideoStream(QObject *parent = nullptr);
virtual ~OpenHDVideoStream();

#if defined(ENABLE_VIDEO)
Q_PROPERTY(VideoReceiver* videoReceiver READ getVideoReceiver NOTIFY videoReceiverChanged)
VideoReceiver* getVideoReceiver() { return &m_receiver; }
#endif

Q_PROPERTY(QString uri MEMBER m_uri WRITE setUri NOTIFY uriChanged)
void setUri(QString uri);

signals:
#if defined(ENABLE_VIDEO)
void videoReceiverChanged(VideoReceiver* videoReceiver);
#endif
void uriChanged(QString uri);

public slots:
Expand All @@ -41,9 +35,7 @@ public slots:
void _stop();
QString m_uri;

#if defined(ENABLE_VIDEO)
VideoReceiver m_receiver;
#endif
};

#endif // OpenHDVideoStream_H
10 changes: 0 additions & 10 deletions src/openhdvideostream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,29 @@ void OpenHDVideoStream::init() {
}

void OpenHDVideoStream::_start() {
#if defined(ENABLE_VIDEO)
qDebug() << "OpenHDVideoStream::_start()";
if (!m_receiver.running()) {
m_receiver.start();
}
#endif
}

void OpenHDVideoStream::startVideo() {
#if defined(ENABLE_VIDEO)
QFuture<void> future = QtConcurrent::run(this, &OpenHDVideoStream::_start);
#endif
}

void OpenHDVideoStream::_stop() {
#if defined(ENABLE_VIDEO)
qDebug() << "OpenHDVideoStream::_stop()";
if (m_receiver.running()) {
m_receiver.stop();
}
#endif
}

void OpenHDVideoStream::stopVideo() {
#if defined(ENABLE_VIDEO)
QFuture<void> future = QtConcurrent::run(this, &OpenHDVideoStream::_stop);
#endif
}

void OpenHDVideoStream::setUri(QString uri) {
m_uri = uri;
emit uriChanged(m_uri);
#if defined(ENABLE_VIDEO)
m_receiver.setUri(m_uri);
#endif
}

0 comments on commit 583f274

Please sign in to comment.