summaryrefslogtreecommitdiff
path: root/src/camera/veyeimx287m.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera/veyeimx287m.h')
-rw-r--r--src/camera/veyeimx287m.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/camera/veyeimx287m.h b/src/camera/veyeimx287m.h
index 5afc84b..7d7e2c6 100644
--- a/src/camera/veyeimx287m.h
+++ b/src/camera/veyeimx287m.h
@@ -31,6 +31,7 @@ public:
bool init();
+ bool setExposureTime(const std::chrono::microseconds us);
bool setExposureTimeUs(int value) override;
bool setGain(int value) override;
@@ -38,14 +39,14 @@ public:
bool setSomething(int value) override;
- // bool dequeueImageBuffer(Image &image);
bool dequeueImageBuffer(size_t &image);
bool getImage(Image &image);
- // Image &getImage();
public:
- // libcamera::Signal<std::shared_ptr<Pixels>> newPixels;
- // libcamera::Signal<std::shared_ptr<Image>> newImage;
+ /*!
+ * \brief processedCounter - count of images processed in current second.
+ * Used for performance measurement and bottlenecks analysing
+ */
uint32_t processedCounter{0};
private:
@@ -55,18 +56,26 @@ private:
bool initCam();
bool initHttpServer();
- void dequeueFrameLoop(std::stop_token stopToken);
void calcFrameLoop(std::stop_token stopToken);
private:
+ /*!
+ * \brief m_cam_fd - camera file descriptor
+ */
int m_cam_fd{-1};
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;
+ /*!
+ * \brief m_imageMutexes - lock while processing image from m_images
+ */
+ std::array<std::mutex, BUFFER_COUNT> m_imageMutexes;
+ /*!
+ * \todo copy image right after dequeue to avoid situation with ioctl writing
+ * to m_videoBuffers[i] which is being copied to m_images[i]. In theory, it
+ * should not overlap if BUFFER_COUNT > theads count
+ */
std::array<uint8_t *, BUFFER_COUNT> m_videoBuffers;
struct buffer