summaryrefslogtreecommitdiff
path: root/src/camera/veyeimx287m.h
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2025-11-11 14:55:09 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2025-11-11 14:55:09 +0100
commitfac69ff02f36e45d49da832c6bf246167d1025a6 (patch)
tree4fd412200df3361ead604c3e77a089508bb7dd4b /src/camera/veyeimx287m.h
parent7bc77048d2bac80b675dbc0270a1a83559cb4b0f (diff)
works on radxa zero 3e, 420 fps
Diffstat (limited to 'src/camera/veyeimx287m.h')
-rw-r--r--src/camera/veyeimx287m.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/camera/veyeimx287m.h b/src/camera/veyeimx287m.h
index 37da5b0..e1eb76d 100644
--- a/src/camera/veyeimx287m.h
+++ b/src/camera/veyeimx287m.h
@@ -1,7 +1,7 @@
#pragma once
#include <cstdint>
-
+#include <linux/videodev2.h>
#include <queue>
#include <thread>
@@ -57,17 +57,30 @@ private:
private:
int m_cam_fd{-1};
- static constexpr uint8_t BUFFER_COUNT{8};
+ static constexpr uint8_t BUFFER_COUNT{16};
+ struct v4l2_plane planes[VIDEO_MAX_PLANES];
std::array<std::mutex, BUFFER_COUNT> m_imageMutexes;
std::array<Image, BUFFER_COUNT> m_images;
std::array<std::mutex, BUFFER_COUNT> m_bufferMutexes;
std::array<uint8_t *, BUFFER_COUNT> m_videoBuffers;
+ struct buffer
+ {
+ unsigned int idx;
+ unsigned int padding[VIDEO_MAX_PLANES];
+ unsigned int size[VIDEO_MAX_PLANES];
+ void *mem[VIDEO_MAX_PLANES];
+ };
+ std::vector<buffer> buffers;
+
// std::mutex m_queueMtx;
std::mutex m_camMtx;
std::queue<size_t> m_buffersQueue;
std::jthread m_streamThread;
+ // std::jthread m_calcThreads[1];
std::jthread m_calcThreads[4];
+
+ uint32_t processedCounter{0};
};