summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2025-11-18 21:27:02 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2025-11-18 21:27:02 +0100
commit33467d4924e2b7c63316435764c6909e681f7007 (patch)
tree68a304cbe3476e1db940483cb205bece74b9138f
parent0fdae0386e2e55f489853561dc15055a168e5df1 (diff)
use moc remotely
-rw-r--r--CMakeLists.txt24
-rw-r--r--src/camera/veyeimx287m.cpp3
-rw-r--r--src/camera/veyeimx287m.h8
-rw-r--r--src/protocols/pixelsudpstreamer.cpp16
-rw-r--r--src/protocols/pixelsudpstreamer.h19
5 files changed, 52 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80c3782..46ed7d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,18 +39,18 @@ macro(_add_imported_target target_name file)
endmacro()
# use the host versions of these executables
-if (false)
-_add_imported_target(Qt6::moc "/usr/lib64/qt6/libexec/moc")
-_add_imported_target(Qt6::rcc "/usr/lib64/qt6/libexec/rcc")
-_add_imported_target(Qt6::cmake_automoc_parser "/usr/lib64/qt6/libexec/cmake_automoc_parser")
-_add_imported_target(Qt6::tracegen "/usr/lib64/qt6/libexec/tracegen")
-_add_imported_target(Qt6::qlalr "/usr/lib64/qt6/libexec/qlalr")
-_add_imported_target(Qt6::qtpaths "/usr/lib64/qt6/bin/qtpaths")
-_add_imported_target(Qt6::qmake "/usr/lib64/qt6/bin/qmake6")
-_add_imported_target(Qt6::androiddeployqt "/tmp/androiddeployqt")
-_add_imported_target(Qt6::androidtestrunner "/tmp/androidtestrunner")
-# _add_imported_target(Qt6::moc "/usr/lib64/qt6/libexec/moc")
-# _add_imported_target(Qt6::qmake "/usr/lib64/qt6/bin/qmake6")
+if (true)
+_add_imported_target(Qt6::moc "/home/nikita/Qt/6.4.2/gcc_64/libexec/moc")
+_add_imported_target(Qt6::rcc "/home/nikita/Qt/6.4.2/gcc_64/libexec/rcc")
+_add_imported_target(Qt6::cmake_automoc_parser "/home/nikita/Qt/6.4.2/gcc_64/libexec/cmake_automoc_parser")
+_add_imported_target(Qt6::tracegen "/home/nikita/Qt/6.4.2/gcc_64/libexec/tracegen")
+_add_imported_target(Qt6::qlalr "/home/nikita/Qt/6.4.2/gcc_64/libexec/qlalr")
+_add_imported_target(Qt6::qtpaths "/home/nikita/Qt/6.4.2/gcc_64/bin/qtpaths")
+_add_imported_target(Qt6::qmake "/home/nikita/Qt/6.4.2/gcc_64/bin/qmake6")
+_add_imported_target(Qt6::androiddeployqt "/home/nikita/Qt/6.4.2/gcc_64/bin/androiddeployqt")
+_add_imported_target(Qt6::androidtestrunner "/home/nikita/Qt/6.4.2/gcc_64/bin/androidtestrunner")
+# _add_imported_target(Qt6::moc "/home/nikita/Qt/6.4.2/gcc_64/libexec/moc")
+# _add_imported_target(Qt6::qmake "/home/nikita/Qt/6.4.2/gcc_64/bin/qmake6")
endif()
# NOTE: /aarch64-none-linux-gnu/bin/ld: cannot find -lm: No such file or directory
diff --git a/src/camera/veyeimx287m.cpp b/src/camera/veyeimx287m.cpp
index 21d95c6..2e4a4aa 100644
--- a/src/camera/veyeimx287m.cpp
+++ b/src/camera/veyeimx287m.cpp
@@ -618,6 +618,9 @@ void VeyeIMX287m::calcFrameLoop(std::stop_token stopToken)
continue;
}
+ // ++processedCounter;
+ // continue;
+
std::lock_guard lock{m_imageMutexes[bufferIdx]};
auto &image = m_images[bufferIdx];
diff --git a/src/camera/veyeimx287m.h b/src/camera/veyeimx287m.h
index 4de51af..03b7df9 100644
--- a/src/camera/veyeimx287m.h
+++ b/src/camera/veyeimx287m.h
@@ -5,6 +5,8 @@
#include <queue>
#include <thread>
+#include <QReadWriteLock>
+
#include "constants.h"
#include "image.h"
@@ -79,6 +81,12 @@ private:
static constexpr uint8_t BUFFER_COUNT{16};
+ struct MA
+ {
+ QReadWriteLock rwLock;
+ Image image;
+ } bbbbb[BUFFER_COUNT];
+
std::array<Image, BUFFER_COUNT> m_images;
/*!
* \brief m_imageMutexes - lock while processing image from m_images
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;
};