summaryrefslogtreecommitdiff
path: root/src/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/pixelsudpstreamer.cpp16
-rw-r--r--src/protocols/pixelsudpstreamer.h19
2 files changed, 29 insertions, 6 deletions
diff --git a/src/protocols/pixelsudpstreamer.cpp b/src/protocols/pixelsudpstreamer.cpp
index d7c66c7..e7498d7 100644
--- a/src/protocols/pixelsudpstreamer.cpp
+++ b/src/protocols/pixelsudpstreamer.cpp
@@ -1,7 +1,17 @@
#include "pixelsudpstreamer.h"
-PixelsUdpStreamer::PixelsUdpStreamer(std::shared_ptr<ICamera> camera)
- : IProtocol{camera}
+#include <QUdpSocket>
+
+PixelsUdpStreamer::PixelsUdpStreamer(std::shared_ptr<ICamera> camera, QObject *parent)
+ : QObject{parent}
+ , IProtocol{camera}
{}
-bool PixelsUdpStreamer::start() {}
+bool PixelsUdpStreamer::start()
+{
+ m_socket = std::make_shared<QUdpSocket>();
+
+ return true;
+}
+
+void PixelsUdpStreamer::stop() {}
diff --git a/src/protocols/pixelsudpstreamer.h b/src/protocols/pixelsudpstreamer.h
index db8acc3..a7f69b7 100644
--- a/src/protocols/pixelsudpstreamer.h
+++ b/src/protocols/pixelsudpstreamer.h
@@ -1,14 +1,27 @@
#pragma once
+// qt
+#include <QObject>
+#include <QReadWriteLock>
+
+// orpheus
#include "iprotocol.h"
-class PixelsUdpStreamer : public IProtocol
+// qt
+class QUdpSocket;
+
+class PixelsUdpStreamer : public QObject, public IProtocol
{
+ Q_OBJECT
+
public:
- explicit PixelsUdpStreamer(std::shared_ptr<ICamera> camera);
+ explicit PixelsUdpStreamer(std::shared_ptr<ICamera> camera, QObject *parent = nullptr);
~PixelsUdpStreamer() override = default;
-public:
+public slots:
bool start() override;
void stop() override;
+
+private:
+ std::shared_ptr<QUdpSocket> m_socket;
};