diff options
| author | Nikita Kostovsky <nikita@kostovsky.me> | 2025-11-14 11:16:23 +0100 |
|---|---|---|
| committer | Nikita Kostovsky <nikita@kostovsky.me> | 2025-11-14 11:16:23 +0100 |
| commit | 921b118472da6c9d4f4d1b76549b4c3672926925 (patch) | |
| tree | cb63abafbe1e4307979df7680a4dba0f1523e605 /src/camera/veyeimx287m.h | |
| parent | 3396ea3e7cf5a0def0ea720bcb863b374fd1cd0e (diff) | |
cleanup, add comments
Diffstat (limited to 'src/camera/veyeimx287m.h')
| -rw-r--r-- | src/camera/veyeimx287m.h | 25 |
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 |
